Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

HTTP Status 404 - /Struts2Application1/clientAction + Please help

 
Ranch Hand
Posts: 763
  • 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: 763
  • 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
[Thumbnail for Struts2Application1.jpg]
Rename Struts2Application1.jpg to Struts2Application1.war
 
Jigar Naik
Ranch Hand
Posts: 763
  • 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]
 
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
 
Author
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: 763
  • 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
------------------------------------------
 
You can't expect to wield supreme executive power just because
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic