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

Not calling .action extension

 
ravi kanth
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
can any one faced the below problem..
i am new to struts 2 .
i am writting a sample ,in that user enter name , i am showing some custom message.
ex : if he enter name from UI jsp via <s:textfiled> something like james, I am showing as Hello James.
my jsp is working fine but i am unable reach my action class.
It is reaching but ".action" not appending in browser that why i cant reach action class..
i am using default package in struts.xml file..

can any body help me in solving the problem..

Thanks & regards,
Tvnrrk..
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not providing much to go on.

Are you accessing the JSP page directly, or through an action? (You should access JSP pages with S2 tags only through an action.)
 
ravi kanth
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David,

Its working..

You mean to say (in struts2) every jsp has to call with its own action class. Please correct me if i am wrong.

Thanks & Regards,
tvnrrk.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I'm saying that JSP pages should rarely, if ever, be accessed directly. That doesn't necessarily mean that *you* have to write the action class; if you create an action config with no "class" attribute then S2 will use a default action:The Convention plugin also creates actions for us if we don't create our own.

JSP pages should generally be under /WEB-INF anyway, to avoid direct access, as directly accessing JSPs can often times mess up application flow.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic