用resin作服务器,最简单的jsp程序为何无法运行?请帮忙??

cenlink 2003-03-27 10:26:06
一个很简单的jsp程序,如下:
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
Jsp1
</title>
</head>
<body>
<h1>
JBuilder Generated JSP
</h1>
<form method="post">
<br>Enter new value : <input name="sample"><br>
<br><br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" value="Reset">
</form>
</body>
</html>
可是输入:http://localhost:8080/jsp1.jsp时:
却出现:
500 Servlet Exception
/Jsp1.jsp:24: cannot resolve symbol
symbol : method setCharacterEncoding (java.lang.String)
location: interface javax.servlet.http.HttpServletRequest
request.setCharacterEncoding("GBK");
^
1 error



--------------------------------------------------------------------------------
Resin 2.1.8 (built Thu Mar 6 11:50:23 PST 2003)

请大家帮忙??
...全文
58 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
zeeler 2003-04-11
  • 打赏
  • 举报
回复
你出的错误可能是其他的代码的错误,resin运行时会自动编译所有有效目录的程序,你要保证其他目录没有错误的程序。
zeeler 2003-04-11
  • 打赏
  • 举报
回复
你把jsp1.jsp放在哪里了?你在webapps下建立一个目录,例如test,把它放在里面,然后
http://localhost:8080/test/jsp1.jsp
sangyei 2003-04-11
  • 打赏
  • 举报
回复
中文字符集 可能会有问题,还有就是 用post 和get 换换试一下
cenlink 2003-04-11
  • 打赏
  • 举报
回复
问题没有解决,不过谢谢大家,请大家接分。
laoer 2003-03-28
  • 打赏
  • 举报
回复
用JDK1.4
cenlink 2003-03-28
  • 打赏
  • 举报
回复
请问大家:是不是resin中的中文字符集的配置问题?
xdev 2003-03-27
  • 打赏
  • 举报
回复
<%@page contentTyoe="text/html;charset=gb2312"%>
keen_9 2003-03-27
  • 打赏
  • 举报
回复
<%@ page contentType="text/html; charset=gb2312" %>
bubblebird 2003-03-27
  • 打赏
  • 举报
回复
这也有问题???我用tomcat好的
你将gbk改为小写试试~~
redwh 2003-03-27
  • 打赏
  • 举报
回复
可能是resin的配置问题
cenlink 2003-03-27
  • 打赏
  • 举报
回复
源程序如下:
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
Jsp1
</title>
</head>
<jsp:useBean id="Jsp1BeanId" scope="session" class="untitled4.Jsp1Bean" />
<jsp:setProperty name="Jsp1BeanId" property="*" />
<body>
<h1>
JBuilder Generated JSP
</h1>
<form method="post">
<br>Enter new value : <input name="sample"><br>
<br><br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" value="Reset">
<br>
Value of Bean property is :<jsp:getProperty name="Jsp1BeanId" property="sample" />
</form>
</body>
</html>
cenlink 2003-03-27
  • 打赏
  • 举报
回复
我用的是JBuilder6,jdk1.3.1,resin2.1.8。此程序是在jbuilder6下自动生成的。用tomcat 没有问题。
peter207 2003-03-27
  • 打赏
  • 举报
回复
删除第一行不就ok了,^_^
bsd 2003-03-27
  • 打赏
  • 举报
回复
resin自带的包可能没有该方法
bsd 2003-03-27
  • 打赏
  • 举报
回复
setCharacterEncoding是新加的一个方法,检查一下你的J2EE的版本
换一个新版的试试
cenlink 2003-03-27
  • 打赏
  • 举报
回复
Jsp1.jsp的代码就在楼顶,此程序在tomcat3.2.3中没有问题。
aleccheung 2003-03-27
  • 打赏
  • 举报
回复
把Jsp1.jsp:代码拿出来看看。
GBK 肯定没错的。和gb2312 一样的.
cenlink 2003-03-27
  • 打赏
  • 举报
回复
修改了gbk,gb2312还是不行,错误和原来相同。
marobinson 2003-03-27
  • 打赏
  • 举报
回复
<%@page contentTyoe="text/html;charset=gb2312"%>

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧