Solved - HTTP Status 500 - No action instance for path /Login could be created
Solution :- Don't use the pakage name as java or sun. use something else. Due to security issues, don't start your package name with java and/or sun word.
PFB. Actual Problem :-
I am running the tomacat server its perfectly working and welcome file is displayed. But on submitting login form with user name & password , following error is given in browser.
"HTTP Status 500 - No action instance for path /login could be created"
Code of Struts-config.xml :-
<?xml version="1.0" encoding="UTF-8" ?>
<!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="LoginForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="userName" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
</form-bean>
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
</global-forwards>
<action-mappings>
<action input="/login.jsp" name="LoginForm" path="/Login" scope="session" type="java.action.LoginAction">
<forward name="success" path="/success.jsp" />
<forward name="failure" path="/failure.jsp" />
</action>
</action-mappings>
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
<message-resources parameter="com/ApplicationResource"/>
<!-- ========= Tiles plugin =======-->
<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>
Code of Login.jsp :-
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<!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=UTF-8">
<title>JSP Page</title>
</head>
<body>
<div style="color:red">
<html:errors />
</div>
<html:form action="Login" >
User Name : <html:text name="LoginForm" property="userName" /> <br>
Password : <html:password name="LoginForm" property="password" /> <br>
<html:submit value="Login" />
</html:form>
</body>
</html>
Thanks !!!!!!!!!
If you have any other problem than this then please share it in comment
PFB. Actual Problem :-
I am running the tomacat server its perfectly working and welcome file is displayed. But on submitting login form with user name & password , following error is given in browser.
"HTTP Status 500 - No action instance for path /login could be created"
Code of Struts-config.xml :-
<?xml version="1.0" encoding="UTF-8" ?>
<!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="LoginForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="userName" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
</form-bean>
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
</global-forwards>
<action-mappings>
<action input="/login.jsp" name="LoginForm" path="/Login" scope="session" type="java.action.LoginAction">
<forward name="success" path="/success.jsp" />
<forward name="failure" path="/failure.jsp" />
</action>
</action-mappings>
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
<message-resources parameter="com/ApplicationResource"/>
<!-- ========= Tiles plugin =======-->
<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>
Code of Login.jsp :-
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<!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=UTF-8">
<title>JSP Page</title>
</head>
<body>
<div style="color:red">
<html:errors />
</div>
<html:form action="Login" >
User Name : <html:text name="LoginForm" property="userName" /> <br>
Password : <html:password name="LoginForm" property="password" /> <br>
<html:submit value="Login" />
</html:form>
</body>
</html>
Thanks !!!!!!!!!
If you have any other problem than this then please share it in comment
ReplyDeleteThanks for sharing this great article! That is very interesting I love reading and I am always searching for informative articles like this.
Struts Training in Chennai
Struts Training in Velachery
Struts Training in Tambaram
Wordpress Training in Chennai
Wordpress course in Chennai
Struts Training in Chennai
Struts course in Chennai