HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: -1 in the jsp file: nullGenerated servlet error:
[javac] Compiling 1 source fileD:\Tomcat 4.1\work\Standalone\localhost\jsp\myfunc_jsp.java:16: cannot resolve symbol
symbol : class PrintWriter
location: class org.apache.jsp.myfunc_jsp
PrintWriter out=response.getWriter();
^
1 error
[javac] Compiling 1 source fileD:\Tomcat 4.1\work\Standalone\localhost\jsp\myfunc_jsp.java:16: cannot resolve symbol
symbol : class PrintWriter
location: class org.apache.jsp.myfunc_jsp
PrintWriter out=response.getWriter();
^
1 error
解决方案 »
- 使用hibernate查询时出现列名无效????
- 如何将下面的sql语句转换为hibernate的 hql语句
- spring hibernate整合中出的一个问题
- jsp播放视频
- 关于Action中request的值没有保存住的问题。
- tomcat中无法访问access,普通java中能访问
- div中能嵌人iframe或frame嘛?
- 细心的请看
- .war和.jar的含义。
- ················很简单的问题·················
- linux下安装websphere,出现jvm找不到错误,快疯调了.
- java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable
symbol : class PrintWriter
symbol : class PrintWriter
location: class org.apache.jsp.myfunc_jsp
PrintWriter out=response.getWriter();
^
<%--
功能:JSP例程-在JSP中定义函数
--%>
<%@ page contentType="text/html;GBK"%>
<%@ page import="java.io.PrintWriter"%>
<%!
//这一段程序用来将字符串s以波浪形输出,response对象传递进入方法以做输出
public void WaveText(String s,HttpServletResponse response) throws java.io.IOException{
int j=0;
boolean up=true;
response.setContentType("text/html;GBK");
PrintWriter out=response.getWriter();
for (int i=0;i<s.length();i++){
if (j<0){
j=0;
up=true;
}
if (j==7){
up=false;
}
out.println("<font size="+j+">"+GBK2UNI(s.substring(i,i+1))+"</font>");
if (up) j++;
else j--;
}
}
//这一段代码将GBK字符集转为Unicode
public String GBK2UNI(String s){
try{
String temp=new String(s.getBytes("GBK"),"ISO8859_1");
return temp;
}
catch(java.io.UnsupportedEncodingException e){
return "sorry";
}
}
//这一段代码将Unicode转为GBK
public String UNI2GBK(String s){
try{
String temp=new String(s.getBytes("ISO8859_1"),"GBK");
return temp;
}
catch(java.io.UnsupportedEncodingException e){
return "sorry";
}
}
%>
<html>
<head>
<title>JSP例程-在JSP中定义函数</title>
</head>
<body>
<% WaveText(UNI2GBK("这是波浪形的文字,大家快来看呀,走过路过不要错过"),response); %>
<% WaveText(UNI2GBK("这句话也是波浪形文字,大家来看看啊"),response); %>
</body>
</html>
有错,改成
<%@ page contentType="text/html; charset=GBK"%>