No action instance for path /UsersLoginAction could be created
<?xml version= "1.0 " encoding= "ISO-8859-1 " ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN "
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd ">
<struts-config>
<form-beans>
<form-bean name= "usersLoginForm " type= "com.gton.formbean.UsersLoginForm " />
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
</global-forwards>
<action-mappings>
<action input= "/login.jsp " name= "usersLoginForm " path= "/UsersLoginAction " scope= "request "
type= "com.gton.action.user.UsersLoginAction " validate= "true " />
</action-mappings>
<controller processorClass= "org.apache.struts.tiles.TilesRequestProcessor "/>
<message-resources parameter= "res/ApplicationResources "/>
<!-- ========================= Tiles plugin ===============================-->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from
web.xml, thenoverload them with parameters defined here. All parameters
are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true
(default), there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this
later case, it is still needed to declare one plugin per module.
The factory will be initialized with parameters found in the first
initialized plugin (generally the one associated with the default
module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header (default)
false : no validation
Paths found in Tiles definitions are relative to the main context.
-->
<plug-in className= "org.apache.struts.tiles.TilesPlugin " >
<set-property property= "definitions-config " value= "/WEB-INF/tiles-defs.xml " />
<set-property property= "moduleAware " value= "true " />
</plug-in>
<!-- ========================= Validator plugin ================================= -->
<plug-in className= "org.apache.struts.validator.ValidatorPlugIn ">
<set-property
property= "pathnames "
value= "/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml "/>
</plug-in>
</struts-config>
struts-config.xml
////////////////////////////////////////////////////////
<%@ taglib uri= "http://jakarta.apache.org/struts/tags-bean " prefix= "bean " %>
<%@ taglib uri= "http://jakarta.apache.org/struts/tags-html " prefix= "html " %>
<%@ taglib uri= "http://jakarta.apache.org/struts/tags-logic " prefix= "logic " %>
<html:html>
<head>
<title>
<bean:message key= "jsp.user.login.title "/>
</title>
</head>
<body bgcolor= "#ffffff ">
<center>
<h1>
<bean:message key= "jsp.user.login.title "/>
</h1>
<html:form action= "UsersLoginAction.do " method= "post ">
<table>
<tr>
<td> <bean:message key= "jsp.user.login.username "/>
<html:text property= "users_Name "> </html:text> <font color= "red "> <html:errors property= "nameerr "/> </font>
</td>
</tr>
<tr>
<td> <bean:message key= "jsp.user.login.userpwd "/>
<html:password property= "users_Pwd "/> <font color= "red "> <html:errors property= "pwderr "/> </font>
</td>
</tr>
<tr>
<td>
<html:submit property= "Submit "> <bean:message key= "jsp.user.login.loginbut "/> </html:submit>
<html:reset> <bean:message key= "jsp.user.login.rebut "/> </html:reset>
<html:link href= "# " onclick= "javascript:window.open( 'reg.jsp '); "> <bean:message key= "jsp.user.login.reg "/> </html:link>
</td>
</tr>
</table>
</html:form>
</center>
</body>
</html:html>
login.jsp
/////////////////////////
package com.gton.formbean.UsersLoginForm;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
/**
*
* @author Administrator
* @version
*/
public class UsersLoginForm extends org.apache.struts.action.ActionForm {
private String users_Name;
private String users_Pwd;
public String getUsers_Name() {
return users_Name;
}
public void setUsers_Name(String users_Name) {
this.users_Name = users_Name;
}
public void setUsers_Pwd(String users_Pwd) {
this.users_Pwd = users_Pwd;
}
public String getUsers_Pwd() {
return users_Pwd;
}
public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest) {
/** @todo: finish this method, this is just the skeleton.*/
ActionErrors err = new ActionErrors();
if (this.getUsers_Name() == null ||this.getUsers_Name().length() <1) {
err.add( "nameerr ", new ActionMessage( "err.user.login.namenullerr "));
}
if (this.getUsers_Pwd() == null||this.getUsers_Pwd().length() <1) {
err.add( "pwderr ", new ActionMessage( "err.user.login.pwdnullerr "));
}
return err;
}
public void reset(ActionMapping actionMapping,
HttpServletRequest servletRequest) {
}
}
UsersLoginForm.java
怎么搞也出不来啊
[解决办法]
未找到action得实例,是不是你package配置得不对,还有你看看你得action编译了没有
[解决办法]
楼上的说的对
然后还看看你的class有没有放在该放的目录下面
包名对不对这些问题
