struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastián Gorgo <sgo...@frro.utn.edu.ar>
Subject Re: Problem with starting the samplecode-urgent help
Date Mon, 13 Dec 2004 20:51:48 GMT

You must change "strutsTutorial.UserRegistrationAction" to 
"StrutsTutorial.UserRegistrationAction".
Its case-sensitive.

S.B. wrote:
> I have a created a subclass of Action, called UserRegistrationAction:
> package StrutsTutorial;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> 
> import org.apache.struts.action.Action;
> import org.apache.struts.action.ActionForm;
> import org.apache.struts.action.ActionForward;
> import org.apache.struts.action.ActionMapping;
> public class UserRegistrationAction extends Action{
> public ActionForward execute(
> 		ActionMapping mapping,
> 		ActionForm form,
> 		HttpServletRequest request,
> 		HttpServletResponse response)
> throws Exception{
> 	
> return mapping.findForward("success");	
> }
> }
> 
> --------
> I have following struts-config file: (i have added the last action
> mapping
> <action path="/UserRegistration"
> type="strutsTutorial.UserRegistrationAction"
> parameter="/pages/regSuccess.jsp">
> 		<forward name="success"
> path="/pages/strutsTutorial/regSuccess.jsp" />
> 			</action>
> )
> <!-- =================================== Global Forward Definitions -->
>     <global-forwards>
> 
>         <!-- Default forward to "Welcome" action -->
> 
>         <!-- Demonstrates using index.jsp to forward -->
> 
>         <forward name="welcome" path="/Welcome.do" />
> 
>     </global-forwards>
> 
> <!-- =================================== Action Mapping Definitions -->
>     <action-mappings>
> 
>             <!-- Default "Welcome" action -->
>             <!-- Forwards to Welcome.jsp -->
>         <action path="/Welcome"
> type="org.apache.struts.actions.ForwardAction"
> parameter="/pages/Welcome.jsp" />
> 
>     <!-- sample input and input submit actions
>         <action
> 
>             path="/Input"
> 
>             type="org.apache.struts.actions.ForwardAction"
> 
>             parameter="/pages/Input.jsp"/>
> 
>         <action
> 
>             path="/InputSubmit"
> 
>             type="app.InputAction"
> 
>             name="inputForm"
> 
>             scope="request"
> 
>             validate="true"
> 
>             input="/pages/Input.jsp"/>
> 
>     end samples -->
> 
> 		<action path="/UserRegistration"
> type="strutsTutorial.UserRegistrationAction"
> parameter="/pages/regSuccess.jsp">
> 
> 		<forward name="success"
> path="/pages/strutsTutorial/regSuccess.jsp" />
> 			</action>
> 
>     </action-mappings>
> ----------
> The jsp file is just like hello world jsp.
> I have UserRegistrationAction.class in the directory structure at:
> C:\....\webapps\strutsTutorial\WEB-INF\classes\StrutsTutorial\UserRegist
> rationAction.class
> Ant is ok. Building ok. Deployed war on tomcat 4.1. but-
> -----------
> What's the problem? When I give :
> http://localhost:8080/strutsTutorial/UserRegistration.do it gives me
> error:
> 
> Status report
> 
> message No action instance for path /UserRegistration could be created
> 
> description The server encountered an internal error (No action instance
> for path /UserRegistration could be created) that prevented it from
> fulfilling this request.
> =--------------
> Following is command line messages:
> -------------------------------------
> SEVERE: No action instance for path /UserRegistration could be created
> java.lang.ClassNotFoundException: strutsTutorial.UserRegistrationAction
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
> der.java:1443)
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
> der.java:1289)
>         at
> org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.jav
> a:207)
>         at
> org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.
> java:231)
>         at
> org.apache.struts.action.RequestProcessor.processActionCreate(Request
> Processor.java:326)
>         at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:268)
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
>         at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:247)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:193)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> alve.java:256)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
> t.invokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> .
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message