请各位帮我看一下这个简单的jsp程序,谢谢!

来源:百度知道 编辑:UC知道 时间:2024/05/23 15:35:25
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 16 in the jsp file: /sum.jsp
Generated servlet error:
E:\Chapter01\work\org\apache\jsp\sum_jsp.java:60: 需要 '{'
try()
^

An error occurred at line: 25 in the jsp file: /sum.jsp
Generated servlet error:
E:\Chapter01\work\org\apache\jsp\sum_jsp.java:72: "catch" 不带有 "try"
catch(Exception e)
^

Generated servlet error:
E:\Chapter01\work\org\apache\jsp\sum_jsp.java:30: "try" 不带有 "catch" 或 "finally"
try {
^

Generated servlet error:
E:\Chapter01\work\org\apache\jsp\sum_jsp.java:96: 需要 '}'
^

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

<%@ page contentType="text/html;charset=gb2312"%>
<html>
<head>
<title>
request 对象
</title>
</head>
<body>
<%
request.setCharacterEncoding("gb2312");
String num1=request.getParameter("num1");
String num2=request.getParameter("num2");
int i=0;
int j=0;
%>
<%
try()
{
i=Integer.parseInt(num1);
j=Integer.parseInt(num2);
%>
两数之和是:<font color="red">
<%=(i+j)%>
<% }
catch(Exception e)
{
%>
input error!
<%
}
%>
</font>
</body>
</html>

try下面少了个

{

如果还是解决不了...百度HI我...