扶
扶程星云
Unregistered / Unconfirmed
GUEST, unregistred user!
该文件已经编译成isotogb.class,并放在jsp所在的目录下
public class isotogb
{
public static String convert( String str )
{
try
{
byte[] bytesStr=str.getBytes( "ISO-8859-1" ) ;
return new String( bytesStr, "gb2312" ) ;
}
catch( Exception ex)
{
return str ;
}
}
}
input.html源代码
<HTML>
<HEAD>
<TITLE>汉字处理</TITLE>
</HEAD>
<BODY>
<CENTER>
<FONT SIZE = 5 COLOR = blue>汉字处理</FONT>
</CENTER>
<BR>
<HR>
<BR>
<!-- 以Post方法, 将资料传递给gb.jsp档 -->
<FORM action="gb.jsp" method=post name=form>
<BR>我是
<INPUT type=text name=inputName>
<BR>我的留言:
<BR>
<TEXTAREA rows=5 cols=30 name=txtaMsg></TEXTAREA>
<INPUT type="submit" value="送出" name=submit>
<INPUT type="reset" value="清除" name=reset>
</FORM>
</BODY>
</HTML>
gb.jsp源代码
<%@ page contentType="text/html;
charset=GB2312" %>
<%@ page language="java" %>
<HTML>
<HEAD>
<TITLE>汉字处理</TITLE>
</HEAD>
<BODY>
<CENTER>
<FONT SIZE = 5 COLOR = blue>汉字处理</FONT>
</CENTER>
<BR>
<HR>
<BR>
<H3>
<FONT COLOR = RED>
<CENTER>
<!--取得Name文本区的输入值-->
<%
String tmpName = isotogb.convert( request.getParameter("inputName") );
out.println(tmpName);
%>
</FONT>
对大家说:
</CENTER>
<BR>
<FONT COLOR=BLUE>
<!--取得文字区的输入值-->
<%
String tmpMsg = isotogb.convert( request.getParameter("txtaMsg") );
out.println(tmpMsg);
%>
</FONT>
</H3>
</BODY>
</HTML>
错误提示
A Servlet Exception Has Occurred
org.apache.jasper.compiler.ParseException: /gb2312.jsp(1,23) Attribute java has no value
at org.apache.jasper.compiler.JspReader.parseAttributeValue(Unknown Source)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(Unknown Source)
请问问题怎么解决???
public class isotogb
{
public static String convert( String str )
{
try
{
byte[] bytesStr=str.getBytes( "ISO-8859-1" ) ;
return new String( bytesStr, "gb2312" ) ;
}
catch( Exception ex)
{
return str ;
}
}
}
input.html源代码
<HTML>
<HEAD>
<TITLE>汉字处理</TITLE>
</HEAD>
<BODY>
<CENTER>
<FONT SIZE = 5 COLOR = blue>汉字处理</FONT>
</CENTER>
<BR>
<HR>
<BR>
<!-- 以Post方法, 将资料传递给gb.jsp档 -->
<FORM action="gb.jsp" method=post name=form>
<BR>我是
<INPUT type=text name=inputName>
<BR>我的留言:
<BR>
<TEXTAREA rows=5 cols=30 name=txtaMsg></TEXTAREA>
<INPUT type="submit" value="送出" name=submit>
<INPUT type="reset" value="清除" name=reset>
</FORM>
</BODY>
</HTML>
gb.jsp源代码
<%@ page contentType="text/html;
charset=GB2312" %>
<%@ page language="java" %>
<HTML>
<HEAD>
<TITLE>汉字处理</TITLE>
</HEAD>
<BODY>
<CENTER>
<FONT SIZE = 5 COLOR = blue>汉字处理</FONT>
</CENTER>
<BR>
<HR>
<BR>
<H3>
<FONT COLOR = RED>
<CENTER>
<!--取得Name文本区的输入值-->
<%
String tmpName = isotogb.convert( request.getParameter("inputName") );
out.println(tmpName);
%>
</FONT>
对大家说:
</CENTER>
<BR>
<FONT COLOR=BLUE>
<!--取得文字区的输入值-->
<%
String tmpMsg = isotogb.convert( request.getParameter("txtaMsg") );
out.println(tmpMsg);
%>
</FONT>
</H3>
</BODY>
</HTML>
错误提示
A Servlet Exception Has Occurred
org.apache.jasper.compiler.ParseException: /gb2312.jsp(1,23) Attribute java has no value
at org.apache.jasper.compiler.JspReader.parseAttributeValue(Unknown Source)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(Unknown Source)
请问问题怎么解决???