JSP中遇到的问题,我用的JBuilder2006
错误信息:
"cymxleftcx.jsp ": org.apache.jasper.JasperException: file:E:/hp_Touch/hp_Touch/fycx/cymxleftcx.jsp(16,0) Plugin: Mandatory attribute type missing
'try ' without 'catch ' or 'finally '
illegal start of type
<identifier> expected
'class ' or 'interface ' expected
'class ' or 'interface ' expected
"_zymxleftcx.jsp ": cannot find symbol; symbol : class string, location: class org.apache.jsp.fycx._005fzymxleftcx_jsp
"zymxleft.jsp ": cannot find symbol; symbol : class string, location: class org.apache.jsp.fycx.zymxleft_jsp
源文件如下:
<%@page contentType= "text/html; charset=GBK " language= "java " import= "java.sql.*,DBBean.* " errorPage= " "%>
<%
Connection con = ConnectDB.connectCon();
Yjxmcost cost1 = new Yjxmcost();
Brinfo info = new Brinfo();
request.setCharacterEncoding( "GBK ");
%>
<html>
<head>
<title> 触摸屏系统 </title>
<link rel= "stylesheet " type= "text/css " href= "../css/touch.css ">
</head>
<body style= "overflow-y:hidden;overflow-y:hidden " ONMOUSEDOWN= "DepressButton(); " ONMOUSEOVER= "RaiseButton(); " ONMOUSEUP= "RaiseButton(); ">
<script language= "JavaScript "
src= "../js/button.js " type= " "> </script>
<jsp:plugin code= " " codebase= " "> </jsp:plugin>
<%
String zyh = (String) session.getAttribute( "zyh ");
String zycs = (String) session.getAttribute( "zycs ");
String colvalue[] = new String[6];
colvalue = info.selectValue(con, "zycybrjbxxb where zyh = ' " + zyh + " ' and zycs= ' " + zycs + " ' ");
ResultSet rs1 = null;
rs1 = cost1.selectValue(con, "ZYBB_ALLFY_cur a, ZDzysfxmyjkmb b where a.yjxmdm=b.dm and a.zyh= ' " + zyh + " ' and a.zycs= ' " + zycs + " ' group by a.yjxmdm,b.mc ");
%>
<TABLE cellSpacing=0 cellPadding=0 width= "265 " align= "left " border= "0 " bgcolor= "#003663 ">
<TBODY>
<TR>
<td valign= "top " height= "525 " bgcolor= "3366cc ">
<table width= "100% " align= "center " BORDER= "0 " CELLSPACING= "0 " CELLPADDING= "0 ">
<tr>
<td width= "100% " bgcolor= "#3366cc " valign= "top ">
<img SRC= "../image/line.gif " WIDTH= "250 " HEIGHT= "2 " BORDER= "0 " alt= " ">
<br>
<font SIZE= "2 " FACE= "VERDANA,ARIAL,HELVETICA " STYLE= "COLOR:#FFFFFF " COLOR= "#FFFFFF ">
<span CLASS= "LeftNavOff "> 住院号: <%=zyh%> </span>
</font>
<br>
<font SIZE= "2 " FACE= "VERDANA,ARIAL,HELVETICA " STYLE= "COLOR:#FFFFFF " COLOR= "#FFFFFF ">
<span CLASS= "LeftNavOff "> 姓 名: <%=colvalue[5] %> </span>
</font>
<br>
<font SIZE= "2 " FACE= "VERDANA,ARIAL,HELVETICA " STYLE= "COLOR:#FFFFFF " COLOR= "#FFFFFF ">
<span CLASS= "LeftNavOff "> 第几次住院: <%=zycs %> </span>
</font>
<br>
<img SRC= "../image/line.gif " WIDTH= "250 " HEIGHT= "2 " BORDER= "0 " alt= " ">
<br>
<font SIZE= "2 " FACE= "VERDANA,ARIAL,HELVETICA " STYLE= "COLOR:#FFFFFF " COLOR= "#FFFFFF ">
<span CLASS= "LeftNavOff "> 费用名称 </span>
</font>
<font SIZE= "2 " FACE= "VERDANA,ARIAL,HELVETICA " STYLE= "COLOR:#FFFFFF " COLOR= "#FFFFFF "> 金额(元) </font>
<br>
<%
while (rs1.next()) {
String je = rs1.getString( "je ");
%>
<a href= "cymxfy.jsp?dm= <%=rs1.getString( "yjxmdm ")%> " target= "mainFrame ">
<font SIZE= "2 " FACE= "VERDANA,ARIAL,HELVETICA " STYLE= "COLOR:#FFFFFF " COLOR= "#FFFFFF ">
<span buttonType= "LeftNav " CLASS= "LeftNavOff "> <%=rs1.getString( "mc ")%> </span>
</font>
</a>
<font SIZE= "2 " FACE= "VERDANA,ARIAL,HELVETICA " STYLE= "COLOR:#FFFFFF " COLOR= "#FFFFFF "> <%=je.substring(0,je.trim().length()-2)%> </font>
<br>
<%
}
con.close();
%>
<img SRC= "../image/line.gif " WIDTH= "250 " HEIGHT= "2 " BORDER= "0 " alt= " ">
<br>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
[解决办法]
missing
'try ' without 'catch ' or 'finally '
可能是没攘来捕获异常吧。。。。
为什么逻辑都写在jsp页面里呢??
[解决办法]
数据库操作那块,用try{}catch抓异常
[解决办法]
try{}catch{}跑哪里去了?