我在eclipse下写了一个简单的页面用struts写的.但是运行时老是报这样的错误!!
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: /User_EditForm.jsp(163,1) The end tag "</html:form" is unbalanced
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:134)
org.apache.jasper.compiler.Parser.checkUnbalancedEndTag(Parser.java:1706)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1561)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1789)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1560)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1789)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1560)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.lztx.xygc.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:48)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
我仔细检查过了,并没有少</html:form>呀.而且用<form></form>可以正常显示.为什么,高手救命,以下是这个页面的源代码::
<%@ page language="java" contentType="text/html;charset=GB2312" %>
<%@ page import="com.lztx.xygc.util.Pagination"%>
<%@ page import="com.lztx.xygc.util.DbManager"%>
<%@ page import="com.lztx.xygc.util.DbUtil"%>
<%@ page import="com.lztx.xygc.util.DateUtil"%>
<%@ page import="java.sql.*"%>
<%@ include file="include/taglibs.jsp"%>
<%
request.setCharacterEncoding("GB2312");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", -1);
response.setDateHeader("max-age", 0);
%>
<!--
/usernameEdit.do?method=userEdid
-->
<!--
==========================================
'启鸣网站后管理系统
'当前模块:系统管理
'功能描述:系统管理>用户管理》添加/编辑用户页面
'开发人:启鸣
'开发时间:2006-6-22
'最后编辑:2006-6-22
'当前状态:使用中
===========================================
--><%
int id = 1;
String userID = request.getParameter("userID");
if(userID != null)
{
id = Integer.parseInt(userID);
}
Connection con = null;
PreparedStatement pre = null;
ResultSet res = null;
String sql = "SELECT UserName,PassWord,FullName,UserType,State FROM G_UserList where ID ="+id;
String username = null;
String password = null;
String fullname = null;
String usertype = null;
String state = "";
try{
con = DbManager.getConnection();
pre = con.prepareStatement(sql);
res = pre.executeQuery();
while(res.next())
{
username = res.getString(1);
password = res.getString(2);
fullname = res.getString(3);
usertype = res.getString(4);
state = res.getString(5);
}
System.out.println(username);
System.out.println(password);
System.out.println(fullname);
System.out.println(usertype);
System.out.println(state);
}catch(Exception e)
{
e.printStackTrace();
}
finally
{
DbManager.closeResultSet(res);
DbManager.closePreparedStatement(pre);
DbManager.closeConnection(con);
}
%>
<html>
<head>
<LINK href="css/css.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户管理</title>
</head><body >
<!--======导航条=======-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="Images/bg4.png">
<tr height="33">
<td height="33" class="NavFont" > 系统管理>用户管理>修改用户</td>
<td align="right" >
<A href="JavaScript:history.back();" class="Link2">返回</A>
</td>
<td width="20"> </td>
</tr>
<tr><td height="1" bgcolor="#336699" colspan="3"></td></tr>
</table><br>
<html:form action="/usernameEdit.do?method=userEdid" method="post">
<TABLE width="100%" border="0" align="center" valign="top" cellpadding="0" cellspacing="0" bgcolor="#EFEFEF" Text="#000000">
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >用 户 名:</TD>
<TD width="20"></TD>
<TD align="left"><html:text property="yhName" value="<%=username%>" styleClass="input" size="25"> <html:errors property="userNameNull"/></TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >密    码:</TD>
<TD width="20"></TD>
<TD align="left"><html:password property="yhPassWord" value="<%=password%>" styleClass="input" size="25"/> <html:errors property="userPwdNull"/></TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >姓    名:</TD>
<TD width="20"></TD>
<TD align="left"><html:text property="yhFullName" value="<%=fullname%>" styleClass="input" size="25"/> <html:errors property="userFullNameNull"/></TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >状    态:</TD>
<TD width="20"></TD>
<TD align="left">
<html:select property="type_id" >
<%
String ListState = null;
if(state.equals("N"))
{
ListState="<font color='Green'>已激活</font>";
}
else if(state.equals("L"))
{
ListState="<font color='Red'>已锁定</font>";
}
%>
<html:option value="N">正常</html:option>
<html:option value="L">锁定</html:option>
</html:select>
</TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >类    型:</TD>
<TD width="20"></TD>
<TD align="left">
<html:select property="user_type" >
<html:option value="0">普通用户</html:option>
<html:option value="1">管理员</html:option>
</html:select>
</TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" ><input type="button" onclick="window.location='User_ListForm.jsp';" value="取 消" style="width:58px;height:19px;color: #336699; background-color: #EFEFEF; border: 1px solid #000000;font-size:14px;"/></TD>
<TD width="20"></TD>
<TD align="center"><html:submit value="确 定" style="width:58px;height:19px;color: #336699; background-color: #EFEFEF; border: 1px solid #000000;font-size:14px;"/></TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD colspan="5"> </TD>
</TR>
</TABLE>
</html:form>
</body>
</html>
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: /User_EditForm.jsp(163,1) The end tag "</html:form" is unbalanced
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:134)
org.apache.jasper.compiler.Parser.checkUnbalancedEndTag(Parser.java:1706)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1561)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1789)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1560)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1789)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1367)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1560)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.lztx.xygc.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:48)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
我仔细检查过了,并没有少</html:form>呀.而且用<form></form>可以正常显示.为什么,高手救命,以下是这个页面的源代码::
<%@ page language="java" contentType="text/html;charset=GB2312" %>
<%@ page import="com.lztx.xygc.util.Pagination"%>
<%@ page import="com.lztx.xygc.util.DbManager"%>
<%@ page import="com.lztx.xygc.util.DbUtil"%>
<%@ page import="com.lztx.xygc.util.DateUtil"%>
<%@ page import="java.sql.*"%>
<%@ include file="include/taglibs.jsp"%>
<%
request.setCharacterEncoding("GB2312");
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", -1);
response.setDateHeader("max-age", 0);
%>
<!--
/usernameEdit.do?method=userEdid
-->
<!--
==========================================
'启鸣网站后管理系统
'当前模块:系统管理
'功能描述:系统管理>用户管理》添加/编辑用户页面
'开发人:启鸣
'开发时间:2006-6-22
'最后编辑:2006-6-22
'当前状态:使用中
===========================================
--><%
int id = 1;
String userID = request.getParameter("userID");
if(userID != null)
{
id = Integer.parseInt(userID);
}
Connection con = null;
PreparedStatement pre = null;
ResultSet res = null;
String sql = "SELECT UserName,PassWord,FullName,UserType,State FROM G_UserList where ID ="+id;
String username = null;
String password = null;
String fullname = null;
String usertype = null;
String state = "";
try{
con = DbManager.getConnection();
pre = con.prepareStatement(sql);
res = pre.executeQuery();
while(res.next())
{
username = res.getString(1);
password = res.getString(2);
fullname = res.getString(3);
usertype = res.getString(4);
state = res.getString(5);
}
System.out.println(username);
System.out.println(password);
System.out.println(fullname);
System.out.println(usertype);
System.out.println(state);
}catch(Exception e)
{
e.printStackTrace();
}
finally
{
DbManager.closeResultSet(res);
DbManager.closePreparedStatement(pre);
DbManager.closeConnection(con);
}
%>
<html>
<head>
<LINK href="css/css.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户管理</title>
</head><body >
<!--======导航条=======-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="Images/bg4.png">
<tr height="33">
<td height="33" class="NavFont" > 系统管理>用户管理>修改用户</td>
<td align="right" >
<A href="JavaScript:history.back();" class="Link2">返回</A>
</td>
<td width="20"> </td>
</tr>
<tr><td height="1" bgcolor="#336699" colspan="3"></td></tr>
</table><br>
<html:form action="/usernameEdit.do?method=userEdid" method="post">
<TABLE width="100%" border="0" align="center" valign="top" cellpadding="0" cellspacing="0" bgcolor="#EFEFEF" Text="#000000">
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >用 户 名:</TD>
<TD width="20"></TD>
<TD align="left"><html:text property="yhName" value="<%=username%>" styleClass="input" size="25"> <html:errors property="userNameNull"/></TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >密    码:</TD>
<TD width="20"></TD>
<TD align="left"><html:password property="yhPassWord" value="<%=password%>" styleClass="input" size="25"/> <html:errors property="userPwdNull"/></TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >姓    名:</TD>
<TD width="20"></TD>
<TD align="left"><html:text property="yhFullName" value="<%=fullname%>" styleClass="input" size="25"/> <html:errors property="userFullNameNull"/></TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >状    态:</TD>
<TD width="20"></TD>
<TD align="left">
<html:select property="type_id" >
<%
String ListState = null;
if(state.equals("N"))
{
ListState="<font color='Green'>已激活</font>";
}
else if(state.equals("L"))
{
ListState="<font color='Red'>已锁定</font>";
}
%>
<html:option value="N">正常</html:option>
<html:option value="L">锁定</html:option>
</html:select>
</TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" >类    型:</TD>
<TD width="20"></TD>
<TD align="left">
<html:select property="user_type" >
<html:option value="0">普通用户</html:option>
<html:option value="1">管理员</html:option>
</html:select>
</TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD width="20"></TD>
<TD width="150" align="right" ><input type="button" onclick="window.location='User_ListForm.jsp';" value="取 消" style="width:58px;height:19px;color: #336699; background-color: #EFEFEF; border: 1px solid #000000;font-size:14px;"/></TD>
<TD width="20"></TD>
<TD align="center"><html:submit value="确 定" style="width:58px;height:19px;color: #336699; background-color: #EFEFEF; border: 1px solid #000000;font-size:14px;"/></TD>
<TD width="50"></TD>
</TR>
<TR height="30">
<TD colspan="5"> </TD>
</TR>
</TABLE>
</html:form>
</body>
</html>
解决方案 »
- 各位大大,求救!ssh两服务器问题
- Ant有人用过吗,能不能指点下?
- IIS转TOMCAT,运行几天之后网站就连不上了,可能是什么原因?
- 用struts1 做 表格 急用 请各位高手进来看看 本人刚实习 这是一个考核题 谢谢了
- ftp解析压缩包问题
- jsp分页显示的问题,老问题了。(就剩下10分了,可怜可怜吧)
- 如何java代码里调用jar?(转换这段applet/js至java代码里实现,见代码)
- 文件判断的问题
- jsp页面怎么探测服务器是否支持Jmail组件
- 简单问题——jbuiler8的new project web 除applet外的选项怎么激活???
- 新手问题,谢谢!
- Web页面链接中文名字的文档打不开,英文名字的文档可以打开,到底是怎么回事呢?
在试一下 好了 帮我加分 呵呵
在试一下 好了 帮我加分 呵呵
这样可以吗????????怀疑中,不过先试一下...
改成<html:text property="yhName" value="<%=username%>" styleClass="input" size="25"/>