大家来看一个这个错误

jhtisboy 2002-04-15 12:42:49
/home/bea/wlserver6/config/mydomain/applications/DefaultWebApp/WEB-INF/_tmp_war_myserver_myserver_DefaultWebApp/jsp_servlet/_jht/_public/__submitpass.java:85: 'try' without 'catch' or 'finally'
(No more information available, probably caused by another error)

/home/bea/wlserver6/config/mydomain/applications/DefaultWebApp/WEB-INF/_tmp_war_myserver_myserver_DefaultWebApp/jsp_servlet/_jht/_public/__submitpass.java:211: 'class' or 'interface' expected
(No more information available, probably caused by another error)

/home/bea/wlserver6/config/mydomain/applications/DefaultWebApp/WEB-INF/_tmp_war_myserver_myserver_DefaultWebApp/jsp_servlet/_jht/_public/__submitpass.java:212: 'class' or 'interface' expected
(No more information available, probably caused by another error)

/home/bea/wlserver6/config/mydomain/applications/DefaultWebApp/WEB-INF/_tmp_war_myserver_myserver_DefaultWebApp/jsp_servlet/_jht/_public/__submitpass.java:223: 'class' or 'interface' expected
我看不懂,请帮忙一下
...全文
13 点赞 收藏 17
写回复
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
apboy 2002-04-15
也有可能是你在if语句忘记了{}符号
回复
可乐加水 2002-04-15
'try' without 'catch' or 'finally'
检查一下,在模块
try
{
}后面是不是没有加
catch{}
回复
stupidball 2002-04-15
是的,用第一种就可以。
回复
jhtisboy 2002-04-15
是不是有两种写法
一个是
<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" />
一个是
<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" >
</jsp:useBean>

回复
stupidball 2002-04-15
<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" />
去掉</jsp:useBean>
回复
jhtisboy 2002-04-15
<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" />
</jsp:useBean>
可能是后面多了一个"/"符号 
<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" >
</jsp:useBean>
但是这样写了以后,也有问题
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.


回复
stupidball 2002-04-15
你只需将你的bean的完整目录放在/WEB-INF/classes里面,我用的是tomcat:(。
回复
jhtisboy 2002-04-15
我现在用的服务器是weblogic
我的DBBaseBean是在/home/bea/wlserver6/config/mydomain/applications/DefaultWebApp/eeot/evar/lanbusi/jb

我的jsp文件是在
/home/bea/wlserver6/config/mydomain/applications/DefaultWebApp/jht/public下,
请问我应该怎么调用bean呢
回复
stupidball 2002-04-15
哦,你的DBBaseBean找到了吗?可以用吗?好像没找到。
回复
jhtisboy 2002-04-15
去掉
将<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" />
</jsp:useBean>
当然没有错误了,所以我的意思是
usebean这个语句是不是有问题
回复
jhtisboy 2002-04-15
去掉就没有错误了,
回复
stupidball 2002-04-15
将<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" />
</jsp:useBean>
去掉,错误还一样吗?
我刚刚试了,没有看到你说的错误,对了,String OperCode,OldPass,NewPass,FirmPass,errorinfo,errorpage;
这几个还没初始化呢!
回复
jhtisboy 2002-04-15
你说的也有可能
不过我看了一下,可能是usebean的问题
我现在把usebean下的所有代码删除,只剩下:
<%@page language="java" import="java.sql.*,eeot.evar.lanbusi.jb.*"%>
<%
String OperCode,OldPass,NewPass,FirmPass,errorinfo,errorpage;
OperCode=(String)session.getAttribute("OPER_CODE");
OldPass=request.getParameter("OldPass");
NewPass=request.getParameter("NewPass");
FirmPass=request.getParameter("FirmPass");
if (!NewPass.equals(FirmPass)){
errorinfo="新密码和确认密码不正确";
errorpage="specerror.jsp";
%>
<jsp:forward page="<%=errorpage%>">
<jsp:param name="error_info" value="<%=errorinfo%>" />
</jsp:forward>
<%
}
%>
<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" />
</jsp:useBean>
错误一模一样
回复
stupidball 2002-04-15
你将try,catch加上,再贴出来,应该就是try,catch的问题。
回复
jhtisboy 2002-04-15
我的错误好像不是这个引起的
我刚开始加了try,catch
但是我上面的错误还是一样,
我想先解决上面的错误
回复
stupidball 2002-04-15
没有try{},catch{},你的BaseBean,Connection,statement都应该被捕获异常的。
回复
jhtisboy 2002-04-15
你们看一看,这个代码有什么问题
<%@page language="java" import="java.sql.*"%>
<%
String OperCode,OldPass,NewPass,FirmPass,errorinfo,errorpage;
OperCode=(String)session.getAttribute("OPER_CODE");
OldPass=request.getParameter("OldPass");
NewPass=request.getParameter("NewPass");
FirmPass=request.getParameter("FirmPass");
if (!NewPass.equals(FirmPass)){
errorinfo="新密码和确认密码不正确";
errorpage="specerror.jsp";
%>
<jsp:forward page="<%=errorpage%>">
<jsp:param name="error_info" value="<%=errorinfo%>" />
</jsp:forward>
<%
}
%>
<jsp:useBean id="BaseBean" scope="page" class="eeot.evar.lanbusi.jb.DBBaseBean" />
<%
BaseBean.OpenConnect();
Connection conn=BaseBean.DBConnect;
Statement stmt=conn.createStatement();
String sql="select oper_passwd from mp_operator where oper_code="+OperCode;
String Passwd="";
ResultSet Record = stmt.executeQuery(sql);
if (Record.next())
Passwd = Record.getString("oper_passwd");
if (!OldPass.equals(Passwd)){
errorinfo="旧密码输入不正确";
errorpage="specerror.jsp";
%>
<jsp:forward page="<%=errorpage%>">
<jsp:param name="error_info" value="<%=errorinfo%>" />
</jsp:forward>
<%
}
String UpdateSql="update mp_operator set oper_passwd="+NewPass+
"where oper_code="+OperCode;
boolean result=stmt.execute(UpdateSql);
BaseBean.CloseConnect();
%>
</jsp:useBean>
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告