Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP Status 404 - /Struts2Application1/clientAction + Please help

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • 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: 762
  • Mark post as helpful
  • send pies
  • 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
Rename Struts2Application1.jpg to Struts2Application1.war
[Thumbnail for Struts2Application1.jpg]
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[color=red]Dear Ranchers I got bellow error while uploading the attachment at first time

[/color]
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • 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
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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: 762
  • Mark post as helpful
  • send pies
  • 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
------------------------------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic