File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes HTTP Status 404 - /Struts2Application1/clientAction + Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "HTTP Status 404 - /Struts2Application1/clientAction + Please help" Watch "HTTP Status 404 - /Struts2Application1/clientAction + Please help" New topic
Author

HTTP Status 404 - /Struts2Application1/clientAction + Please help

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
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


Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
Attached is the war file of my application which also contains source code (.java file)

Rename Struts2Application1.jpg to Struts2Application1.war






[Struts2Application1.jpg]

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
[color=red]Dear Ranchers I got bellow error while uploading the attachment at first time

[/color]
Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Dec 12, 2006
Posts: 755
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
------------------------------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404 - /Struts2Application1/clientAction + Please help