aspose file tools*
The moose likes Struts and the fly likes how will arrange in the action mapping in the strut-config.xml? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how will arrange in the action mapping in the strut-config.xml?" Watch "how will arrange in the action mapping in the strut-config.xml?" New topic
Author

how will arrange in the action mapping in the strut-config.xml?

karthik ekantha
Ranch Hand

Joined: Feb 08, 2012
Posts: 78
this is strut-config.xml file
1)doubt for the <action-mappings> inside the
11) first page is page login.jsp
after login success go to success.jsp page but success page contain registration name ,mobile no again save the details.
12) second page is success.jsp
this page follow <action mapping >


how will arrange in the action mapping in the strut-config.xml???



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">

<struts-config>

<!-- ========== Form Bean Definitions ================================== -->
<form-beans>

<form-bean name="loginForm" type="com.raistudies.forms.LoginForm"/>
<form-bean name="RegistrationForm" type="com.raistudies.forms.RegistrationForm"/>

</form-beans>

<!-- ========== Action Mapping Definitions ============================= -->
<action-mappings>
<action name="loginForm" path="/Login" type="com.raistudies.actions.LoginAction" scope="request" input="/Login.jsp">
<forward name="failure" path="/Failure.jsp" redirect="true"/>
<forward name="success" path="/Success.jsp" redirect="true"/>
</action>

<action name="RegistrationForm" path="/Save" type="com.raistudies.actions.RegistrationAction" scope="request" input="/Success.jsp">
<forward name="Save" path="/Save.jsp" redirect="true"/>
</action>

</action-mappings>

<message-resources parameter="com/raistudies/ApplicationResource"/>
<!-- ========================= Validator plugin ================================= -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validation.xml"/>
</plug-in>

</struts-config>



dont know how actionmapping in the structconfig.xml


after i got some error in my application

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: java.lang.ClassCastException: com.raistudies.actions.RegistrationAction cannot be cast to org.apache.struts.action.Action
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.lang.ClassCastException: com.raistudies.actions.RegistrationAction cannot be cast to org.apache.struts.action.Action
org.apache.struts.chain.commands.servlet.CreateAction.createAction(CreateAction.java:98)
org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:68)
org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:91)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.18
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how will arrange in the action mapping in the strut-config.xml?
 
Similar Threads
Struts Without Form Bean
javax.servlet.jsp.JspException: Exception creating bean of class com.LoginForm ????
struts1 application: error in struts-config.xml
can't find this error .i got this error in strut
HTTP Status 404