struts显示列表出错!大家帮帮手
出错信息:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cannot find bean userActionForm in scope request
jsp文件:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html>
<head>
<title>
logon
</title>
</head>
<body bgcolor="#ffffff">
<h1> 用户列表:</h1>
<table width="100%" border="0" cellspacing="0">
<tr>
<td width="30%">
<div align="center">用户ID</div></td>
<td width="30%">
<div align="center">用户名</div></td>
<td width="30%">
<div align="center">密码</div></td>
</tr>
<logic:iterate id="userListAction" name="userActionForm" scope="request" type="com.jansky.weboa.entity.userActionForm">
<tr>
<td> <bean:write name="userActionForm" property="user_id"/></td>
<td> <bean:write name="userActionForm" property="user_name"/></td>
<td> <bean:write name="userActionForm" property="user_pwd"/></td>
</tr>
</logic:iterate>
</table>
<p> </p>
<center>
<html:errors />
</center>
<br>
</body>
</html:html>
struts-config.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="userActionForm" type="com.jansky.weboa.entity.userActionForm" />
</form-beans>
<action-mappings>
<action input="userList.jsp" path="/userListAction" scope="request" type="com.jansky.weboa.action.userListAction" validate="true">
<forward name="success" path="/userList.jsp" redirect="false" />
<forward name="add" path="/userAdd.jsp" redirect="false" />
</action>
</action-mappings>
</struts-config>
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cannot find bean userActionForm in scope request
jsp文件:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html>
<head>
<title>
logon
</title>
</head>
<body bgcolor="#ffffff">
<h1> 用户列表:</h1>
<table width="100%" border="0" cellspacing="0">
<tr>
<td width="30%">
<div align="center">用户ID</div></td>
<td width="30%">
<div align="center">用户名</div></td>
<td width="30%">
<div align="center">密码</div></td>
</tr>
<logic:iterate id="userListAction" name="userActionForm" scope="request" type="com.jansky.weboa.entity.userActionForm">
<tr>
<td> <bean:write name="userActionForm" property="user_id"/></td>
<td> <bean:write name="userActionForm" property="user_name"/></td>
<td> <bean:write name="userActionForm" property="user_pwd"/></td>
</tr>
</logic:iterate>
</table>
<p> </p>
<center>
<html:errors />
</center>
<br>
</body>
</html:html>
struts-config.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="userActionForm" type="com.jansky.weboa.entity.userActionForm" />
</form-beans>
<action-mappings>
<action input="userList.jsp" path="/userListAction" scope="request" type="com.jansky.weboa.action.userListAction" validate="true">
<forward name="success" path="/userList.jsp" redirect="false" />
<forward name="add" path="/userAdd.jsp" redirect="false" />
</action>
</action-mappings>
</struts-config>
...全文
相关推荐
struts2 出错
Struts2是一个非常流行的Java Web框架,用于构建和维护可扩展且易于管理的企业级应用程序。在标题"struts2 出错"中,我们可以推测这是一个关于在使用Struts2框架时遇到的问题。
Struts2集成json2.3.16架包.绝对不会出错.
绝对不会出错.适用于集成struts2开发.
Struts 中用Html 标签库的用法(第一部分).rar
**错误和消息显示** Struts提供`<html:errors>`标签用于显示ActionForm验证时的错误信息,以及`<html:message>`标签用于显示国际化消息。
Struts2上传文件出错
-- 系统常量定义,定义上传文件字符集编码 --> <constant name="struts.i18n.encoding" value="UTF-8"></con
配置Struts配置Struts
在Java Web开发中,使用框架如Struts能够提高开发效率,降低出错率,因为框架提供了标准的结构和组件,开发者只需关注业务逻辑,而无需处理底层的请求处理和视图渲染等细节。


