aspose file tools*
The moose likes Struts and the fly likes Resource not Found error continues even after resource is removed from xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Resource not Found error continues even after resource is removed from xml file" Watch "Resource not Found error continues even after resource is removed from xml file" New topic
Author

Resource not Found error continues even after resource is removed from xml file

Souvvik Basu
Ranch Hand

Joined: Apr 05, 2010
Posts: 96
I think this is a pretty common problem with new Struts 2 learners like me. So I searched the forum, but could not find any post that matches the exact problem I have.

I am writing a simple app that takes a person's name in a jsp, passes that name to an action class, which does nothing (it just has an execute() method which returns the "SUCCESS" string), and then the name gets displayed on another jsp.

When I deploy and run the application, the index page, asking for the user to input name, shows up. On entering the name and hitting submit button, it gives a 404 error (resource not found).
Because the first jsp shows up, I assume the app has been deployed properly. The web.xml file is



The struts.xml file is


The action class is as follows


Inside the webapps directory of tomcat, I have my application named HelloWorldinStruts2. The action class is in the following directory
C:\Program Files (x86)\Tomcat\webapps\HelloWorldinStruts2\WEB-INF\classes\helloworld



Error message

HTTP Status 404 - /HelloWorldinStruts2/helloworld

type Status report

message /HelloWorldinStruts2/helloworld

description The requested resource (/HelloWorldinStruts2/helloworld) is not available.


As an attempt to debug this, I removed the 'class' parameter from the action tag, the logic being....since its the class that is not being found, removing any mention of the class from the xml file should take care of the error. The new struts.xml looks like this




I made the change, restarted the server, and tried again. The error is still the same. My question is...
1. Why does it not find the resource in the first case?
2. When I remove the class name, how can this error continue to exist;because now, there is not even any mention of a resource called helloworld.SayHelloToUser?

Can anyone please help?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Resource not Found error continues even after resource is removed from xml file