This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Action Mapping not found- Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action Mapping not found- Please help" Watch "Action Mapping not found- Please help" New topic
Author

Action Mapping not found- Please help

Vis Deo
Ranch Hand

Joined: Jul 02, 2004
Posts: 40
Hi,

I am trying simple example from , Using WSAD 5.0

http://www.sourcebeat.com/docs/Jakarta%20Struts%20Live/Rev_2/Jakarta%20Struts%20Live_SampleChapter.pdf


struts-config.xml has mapping that dosn't work

<action path="/userRegistration" type="strutsTutorial.UserRegistrationAction">
<forward name="success" path="/pages/regSuccess.jsp" redirect="false" />
</action>

But this mapping works fine
<action path="/MYWelcome" type="org.apache.struts.actions.ForwardAction" parameter="/pages/regSuccess.jsp" />


UserRegistrationAction.java has method

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
log.trace("in execute method of UserRegistrationAction");
System.out.println("I am in UserRegistration ");
return mapping.findForward("success");
}


I don't see any trace log, or System.out

Console output is
8/31/04 9:59:33:047 PDT] 60c88c43 WebGroup I SRVE0180I: [Struts Blank Application] [/strutsTutorial] [Servlet.LOG]: action: Processing a GET for /userRegistration
[8/31/04 9:59:33:047 PDT] 60c88c43 WebGroup I SRVE0180I: [Struts Blank Application] [/strutsTutorial] [Servlet.LOG]: action: Looking for Action instance for class strutsTutorial.UserRegistrationAction
[8/31/04 9:59:33:047 PDT] 60c88c43 WebGroup I SRVE0180I: [Struts Blank Application] [/strutsTutorial] [Servlet.LOG]: action: Double checking for Action instance already there
[8/31/04 9:59:33:047 PDT] 60c88c43 WebGroup I SRVE0180I: [Struts Blank Application] [/strutsTutorial] [Servlet.LOG]: action: Creating new Action instance



I guess it is not finding UserRegistrationAction class.

Help from all of you is appreciated.

Thanks,
Chris Gastin
Ranch Hand

Joined: Aug 13, 2002
Posts: 51
Does your web.xml properly define the ActionServlet?


Chris Gastin<br />SCJP 1.4<br />SCWCD 1.3
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Action Mapping not found- Please help
 
Similar Threads
getting error
Cannot retrieve mapping for action /UserRegistration
basics of struts
Runing an example struts application
Struts Tutorial