Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

HTTP Status 404 - /Struts2Application1/clientAction + Please help

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i have written my first struts application

but i am getting following error when i submit the form

HTTP Status 404 - /Struts2Application1/clientAction

this same example runs which i have downloaded from black book website

i am not able to figure out the problem

please help



Bellow is my action class

CientAction.java



Struts.xml (which is in classpath)



web.xml



index.jsp



Please help me solve this issue.

 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Attached is the war file of my application which also contains source code (.java file)

Rename Struts2Application1.jpg to Struts2Application1.war



Struts2Application1.jpg
[Thumbnail for Struts2Application1.jpg]
Rename Struts2Application1.jpg to Struts2Application1.war
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[color=red]Dear Ranchers I got bellow error while uploading the attachment at first time

[/color]
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your struts.xml have no namespace attribute in the <package> tag

maybe you should try



that's my guess, give it a try
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure what that non-Struts stuff is, but it's possible it's interfering with Struts 2's default file upload mechanism: I'd suggest using only one method to handle file uploads. Taking out the "upload" interceptor may be enough to use whatever mechanism is causing the exception you're seeing, although I'd probably recommend just using the S2 functionality.
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Issue resolved..

The directory structure of dynamic web project (eclipse), struts could not understand that.

By changing he directory struture everything worked fine

Bellow structure worked fine.
------------------------------------------
Project/WEB-INF/src
Project/WEB-INF/classes
Prohect/WEB-INF/lib
Project/WEB-INF/classes/struts.xml
Project/WEB-INF/web.xml
Project/index.jsp
Project/error.jsp
------------------------------------------
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic