• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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

 
Ranch Hand
Posts: 96
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic