aspose file tools*
The moose likes Struts and the fly likes Not calling .action extension Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Not calling .action extension" Watch "Not calling .action extension" New topic
Author

Not calling .action extension

ravi kanth
Ranch Hand

Joined: Jun 04, 2008
Posts: 36
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jun 04, 2008
Posts: 36
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

Joined: Sep 29, 2008
Posts: 12617

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.
 
 
subject: Not calling .action extension