小弟做了个HTML.和一个JSP.可是通过HTML运行到JSP的时候显示不出来页面.显示的是代码.可能是语法上的错误
看了好长时间也看不出来.那位大虾能帮我下. 代码如下 QQ84001346
HTML:
(1)<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Compute</title>
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<form method="post" action="Divide.jsp">
<p>---整数除法---
<p>被除数
<input type="text"name="value1">
除数
<input type="text" name="value2">
</p>
<p>
<input type="submit" name="submit" value="计算">
</p>
</form>
</div>
</body>
</html>
(2)
Divide.jsp
< % @ page language="java" errorpage="error.jsp" contentType="test/html; charset=GBK"% >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Divide</title>
</head>
<body background="#ffffff">
<center>
<br>
<h1>
< %
int dividend = 0;
int divisor = 0;
int result = 0;
try{
dividend=Integer.parseInt( request.getParameter("value1"));
}
catch( NumberFormatException nfex ){
throw new NumberFormatException("被除数不是整数!");
}
try{
divisor = Integer.parseInt( request.getParameter("value2"));
}
catch( NumberFormatException nfex ){
throw new NumberFormatException("除数不是整数!");
}
result=dividend/divisor;
out.println( dividend + " / " + divisor + " = " + result );
% >
</h1>
<br><br>
<a href="javascript:history.back();>返回"
</center>
</body>
</html>
(3) error.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" isErrorpage="ture"
contentType="text/html;charset=GBK_1"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body background="#FFFFFF">
<div align="center"
<br><br>
<h1>错误信息</h1>
<hr>
<p><center>
<h3>< % = exception.toString() %></h3>
<br><br><br>
</center>
</p>
</body>
</html>
[此贴子已经被作者于2006-5-11 11:34:09编辑过]
----------------解决方案--------------------------------------------------------