Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts Action mapped error

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my struts project war file.
I think it is ok including this site.If not please don't banned my account.

http://www.megaupload.com/?d=QH6OB51A

when i run http://localhost:8080/My/my/HelloWorld.action it gives this error


i don't know why?
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but if i try this url
http://localhost:8080/My/my/HelloWorld

it gives this error?


please anyone answer my question.
I am new to struts and i have this problem now 3 days.
I can't proceed without doing this.
I am reading ManningStruts2inAction book.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you expect anybody to help if you don't post your configuration? Don't append a WAR file--that's basically asking us to download, check the code for potential security issues, deploy, run, and debug.

Let's just jump right to the debug part. Post your config.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is web.xml which is in WEB-INF folder



this is struts.xml which is in WEB-INF


this is HelloWorld.jsp which is in WebContent folder



this is Struts2HelloWorld.java class


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your package's namespace is "/roseindia".
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oho,thanks,thanks

finally after 4 days it works.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyway i need to know how to run my action without typing "action" at last of URl?
example
now i am typing
http://localhost:8080/My/my/Struts2HelloWorld.action

i need to run my action using this url
http://localhost:8080/My/my/Struts2HelloWorld

how can i archive this?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please start new topics for new questions.

Use Struts 2.1, which has this enabled by default, or set the action extension constant.

I would *strongly* recommend spending some time with the Struts 2 documentation before proceeding much further; it will save you a *lot* of time and effort.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic