解决暴风影音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>
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>
相关文章推荐
- 解决FLV视频文件在IIS6.0上无法播放的问题
- 解决FLV视频文件在服务器上无法播放的问题
- 解决FLV视频文件在服务器上无法播放的问题
- 有关android中加载MP4,3gp等视频文件,无法播放问题的解决
- 解决CentOS-6下totem无法播放MP4视频文件的问题
- 解决FLV视频文件在IIS6.0上无法播放的问题
- 解决coursera视频无法播放问题
- mplayer无法播放RMVB文件如何解决
- XP里所有视频无法播放、黑屏或者白屏问题解决方法
- 怎样解决部分网站网页中IE9无法播放flash视频的问题--硬件加速功能存在冲突
- AVI编码方式及OpenCV读取AVI文件-解决opencv无法读AVI视频的问题
- 解决Win8系统中exe格式的视频课件无法播放问题
- Windows 2008 R2 中 IE9无法播放HTML5视频文件的解决方法!
- AVI编码方式及OpenCV读取AVI文件-解决opencv无法读AVI视频的问题
- Android使用VideoView出现无法播放此视频问题的解决方法
- 解决webView无法播放视频的问题
- Android 使用Webview无法播放视频问题的解决办法
- Ubuntu 下totem无法播放rmvb文件的解决
- Windows Media Player播放AVI视频文件时,只有声音,没有图像,问题解决
- KMPlayer 无法正常在win2003中播放rmvb视频的解决方法