This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes problems with action mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problems with action mapping" Watch "problems with action mapping" New topic

problems with action mapping

meka toka
Ranch Hand

Joined: Dec 11, 2002
Posts: 75
I am new to Struts, i am facing the following a problem with the action mappings.
Here are my code snippets
In web.xml
In login.jsp
<html:form action="/Login"
type="" >

In struts-config.xml
<form-bean name="LoginForm" type=""/>
<forward name="Login" path="/login.jsp"/>
<action path="/Login" type="" scope="request" input="/login.jsp" name="LoginForm">
<forward name="Success" path="/welcome.jsp"/>
<forward name="Failure" path="/login.jsp"/>

With the above code, when the login.jsp is submitted the values have to be filled in LoginForm which is an ActionForm for the ActionClass LoginAction .
The associated action path is supposed to be /Login but when the jsp is submitted i get an error page saying
The requested resource (/MyApp/ is not available.
Can somebody point me where am i wrong ?
I am using Tomcat 4.1.24, Struts 1.1
Meka Toka

Thanks<br />MekaToka<br />SCJP 1.4
Junilu Lacar

Joined: Feb 26, 2001
Posts: 4419

Did you define the servlet in web.xml as well?
See the <servlet> definition in the example at
meka toka
Ranch Hand

Joined: Dec 11, 2002
Posts: 75
Yes i have defined the ActionServlet in the web.xml, the reason why i didnt provide the code snippet earlier is because i was trying to show all the code related to the action mapping in both the deployment descriptors.
This looks like a problem that many beginners face, i searched but found no solution.
Any more suggestions ?
Meka Toka
[ July 24, 2003: Message edited by: meka toka ]
Junilu Lacar

Joined: Feb 26, 2001
Posts: 4419

I vaguely remember this happening to me a while back. I'll have to get back to you later though...In the meantime, try searching this site and the web for that error message; use a search phrase like "Tomcat Struts resource not available"
meka toka
Ranch Hand

Joined: Dec 11, 2002
Posts: 75
Also can somebody clarify this
When a struts application is deployed on Tomcat server, should there be any pop ups of the Action Mapping, Success and Failure files.
If the pop up doesnt come up in stack trace when starting Tomcat, does it mean that the form-beans(ActionForms) are not properly configured in deployment descriptors ?
Does extending the ActionMapping and writing your own ActionMapping cause any of these pop ups ?
I am asking this because, when i start Tomcat no popups comeup, where as when i place storefront sample application, there are pop ups of the Form beans, and some other stuff.
Thank You
Meka Toka
Sazzad Rafique

Joined: Jul 29, 2003
Posts: 5
I guess the problem is in the jsp page from where you click on the link to invoke the action. I got the same error when I was using <a href=""></a> instead of <html:link></html:link>. My mistake was I was using an extra "/". So if you check the address in the task bar when you put your mouse on the link of that action you might get a clue.
I agree. Here's the link:
subject: problems with action mapping
Similar Threads
Newbie Question
forward action
Error while deploying struts application
How to use filters in struts 1.3
help with module level struts config