您的位置:首页 > 编程语言 > VB

解决暴风影音2012无法播放rmvb视频文件的问题

2012-02-25 10:57 585 查看
package mypack;
import java.util.*;

public class Tool {
public static int add(String x, String y) {
int a = 0;
int b = 0;
try {
a = Integer.parseInt(x);
b = Integer.parseInt(y);
}catch(Exception e) {}

return a + b;
}

public static String convert(String s,String encode1,String encode2){
try{
return new String(s.getBytes(encode1),encode2);
}catch(Exception e){return null;}
}
}

<%@ page contentType="text/html; charset=GB2312" %>
<%@ taglib prefix="mm" uri="/mytaglib" %>
<html>
<head>
<title>functions</title>
</head>

<body>

<h3>Add Numbers</h3>
<p>
<form action="sum.jsp" method="get">
user= <input type="text" name="user"
value="${mm:convert(param.user,'ISO-8859-1','GB2312')}">
<br>

x = <input type="text" name="x" value="${param.x}">
<br>
y = <input type="text" name="y" value="${param.y}">
<input type="submit" value="Add Numbers">
</form>

<p>
the sum is: ${mm:add(param.x,param.y)}

</body>
</html>
mytaglib.tld

<?xml version="1.0" encoding="ISO-8859-1" ?>

<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
<tlib-version>1.1</tlib-version>
<short-name>mytaglib</short-name>
<uri>/mytaglib</uri>

<function>
<description>add x and y</description>
<name>add</name>
<function-class>mypack.Tool </function-class>
<function-signature>
int add(java.lang.String,java.lang.String)
</function-signature>
</function>

<function>
<description>convert encoding</description>
<name>convert</name>
<function-class>mypack.Tool </function-class>
<function-signature>
java.lang.String convert(java.lang.String,java.lang.String,java.lang.String)
</function-signature>
</function>

</taglib>

web.xml

<taglib>
<taglib-uri>/mytaglib</taglib-uri>
<taglib-location>/WEB-INF/mytaglib.tld</taglib-location>
</taglib>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: