• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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?
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic