请教jsp问题,最后关头出错了!!帮忙

dorian1981 2004-05-06 10:07:29
我用的tomact4.1,jsdk1,4
DBAccess。class为javabean,编译通过,数据库采用access,odbc数据源,连接测试通过,tomact工作正常

现在要访问一个页面logon.jsp

代码如下:
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html;charset=GB2312">
<TITLE>用户登录</TITLE>
</HEAD>

<BODY BGCOLOR="PINK">

<%@page contentType="text/html;charset=gb2312" %>

<%@page import="java.io.*"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*%>

<jsp:useBean id="dbaccess" scope="page" class="DBAccess.DBAccess" />

<%
ResultSet rs=null;

String uid =request.getParameter("UID");
String pid =request.getParameter("PID");
String logonStyle=dbaccess.native2unicode(request.getParameter("LogonStyle"));

char dl[]={'\u767b','\u5f55'};
char zc[]={'\u6ce8','\u518c','\u65b0'.'\u7528','\u6237'};
char wc[]={'\u5b8c','\u6210'};

if(uid==null)
uid="";
if(pid==null)
pid="";
if(logonStyle==null)
logonStyle="";

String sql=null;
int judge=0;
int rsnum=0;

sql="SELECT * FROM CID WHERE ((UID=\'"+uid+"\')&&(PID=\'"
+pid+"\'))
rs=DBAccess.executeQuery(sql);
while(rs.next())
judge=judge+1;
if(judge==0)
{
%>
<CENTER><FONT FACE="隶书" COLOR="#FF0080"><BIG><BIG>
用户名或密码错误!
</BIG></BIG>
</FONT><BR>
</CENTER>
<%
}
else
{
%>
<DIV ALIGN="CENTER"><CENTER><P>
<FONT FACE="隶书" COLOR="#FF0080"><BIG><BIG>
欢迎到这里来
</BIG></BIG>
</FONT></P>
</CENTER></DIV>

<FORM METHOD="POST" ACTION="logon.jsp">

<DIV ALIGN="CENTER"><CENTER><P>
<FONT FACE="隶书" COLOR="FF0080"><BIG><BIG>
用户ID:
</BIG></BIG></FONT>
<INPUT TYPE="TEXT" NAME="UID" SIZE="20" VALUE="<%=uid%>">
<BR>

<FONT FACE="隶书" COLOR="FF0080"><BIG><BIG>
用户密码:
</BIG></BIG></FONT>
<INPUT TYPE="PASSWORD" NAME="PID" SIZE="20" VALUE="<%=pid%>">
<BR>
</P>
</CENTER></DIV>

<DIV ALIGN="CENTER"><CENTER><P>
<INPUT TYPE="SUBMIT" NAME="LogonStyle" VALUE="登录">
<INPUT TYPE="SUBMIT" NAME="LogonStyle" VALUE="取消">
</P>
</CENTER></DIV>
</FORM>
</BODY>
</HTML>

可是无法显示,出现错误:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /logon.jsp(14,25) equal symbol expected
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126)
at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:169)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:136)
at org.apache.jasper.compiler.Parser.parsePageDirective(Parser.java:316)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:375)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:795)
at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:536)

可是同样文件夹里的其他.jsp文件可以访问,请问是不是我的logon.jsp有错误啊?
头疼一天了,找不出来

各位帮忙





...全文
24 13 点赞 打赏 收藏 举报
写回复
13 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
dorian1981 2004-05-07
不好意思,我敲代码时候不够仔细,有些不应该的错误
我又重看了一遍
现在编译只有3个错误
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 14 in the jsp file: /logon.jsp

Generated servlet error:
[javac] Compiling 1 source file

C:\Tomcat 4.1\work\Standalone\localhost\school\logon_jsp.java:55: package DBAccess does not exist
DBAccess.DBAccess dbaccess = null;
^



An error occurred at line: 14 in the jsp file: /logon.jsp

Generated servlet error:
C:\Tomcat 4.1\work\Standalone\localhost\school\logon_jsp.java:57: package DBAccess does not exist
dbaccess = (DBAccess.DBAccess) pageContext.getAttribute("dbaccess", PageContext.PAGE_SCOPE);
^



An error occurred at line: 14 in the jsp file: /logon.jsp

Generated servlet error:
C:\Tomcat 4.1\work\Standalone\localhost\school\logon_jsp.java:60: package DBAccess does not exist
dbaccess = (DBAccess.DBAccess) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "DBAccess.DBAccess");
^
3 errors

应该是我的DBAccess包的问题,但是我已经将编译过的DBAccess.class放到了
...\webapps\school\WEB-INF\classes下,还有什么需要的我没做吗?
大家在帮忙看看吧
  • 打赏
  • 举报
回复
dorian1981 2004-05-07
汗颜~~~
太粗心大意了

马上改正
  • 打赏
  • 举报
回复
Arias 2004-05-07
sql="SELECT * FROM CID WHERE ((UID=\'"+uid+"\')&&(PID=\'"
+pid+"\'))

sql语句中能用&&表示and吗?

错误提示好像是在你的页面中涉及到的一些特殊的符号无法解析。
  • 打赏
  • 举报
回复
bengan 2004-05-07
char zc[]={'\u6ce8','\u518c','\u65b0'.'\u7528','\u6237'};
','\u65b0'.'\u7528','

这里也有错吧!
楼主写代码太不小心了,建议一行一行代码的写上去调试!
  • 打赏
  • 举报
回复
dorian1981 2004-05-07
果然,补上了

还是不行啊

郁闷
  • 打赏
  • 举报
回复
snowy_howe 2004-05-07
sql="SELECT * FROM CID WHERE ((UID=\'"+uid+"\')&&(PID=\'"
+pid+"\'))

这句话是不是还没结束啊?!后面缺少结束的"号吧
  • 打赏
  • 举报
回复
dorian1981 2004-05-07
wangdongzjk(东) :
能不能说的具体点?在那里捕捉错误
gnodiew(闪电神) :
我已经将else语句去掉还是不行

  • 打赏
  • 举报
回复
dorian1981 2004-05-07
自己up下

大虾帮忙
  • 打赏
  • 举报
回复
snowy_howe 2004-05-06
/logon.jsp(14,25) equal symbol expected
是语法错误,缺少等于号?
  • 打赏
  • 举报
回复
gnodiew 2004-05-06
问题可能出在这里
1.
String logonStyle=dbaccess.native2unicode(request.getParameter("LogonStyle"));
native2unicode()有处理null判断?
2.
else
{
结尾没有对应的<% } %>

  • 打赏
  • 举报
回复
wangdongzjk 2004-05-06
我想应该是没有捕捉错误
加上
try{
}
catch(){
}
试试
  • 打赏
  • 举报
回复
sean_gao 2004-05-06
是不是需要import你的DBAccess包和类?
  • 打赏
  • 举报
回复
gift2u 2004-05-06
up,帮你顶住帖子吧。呵呵
  • 打赏
  • 举报
回复
相关推荐
发帖
Web 开发
加入

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2004-05-06 10:07
社区公告
暂无公告