This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts2 action adds folder path to url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 action adds folder path to url" Watch "Struts2 action adds folder path to url" New topic
Author

Struts2 action adds folder path to url

Ramesh kangamuthu
Ranch Hand

Joined: Mar 13, 2007
Posts: 79
In my Struts2 action i invoked loginAction_check.action and it generates the

url - /myapp/jsp/common/loginAction_check.action .


but i need only /myapp/loginAction_check.action. I think that it prepends the result jsp file path /jsp/common to the url.

How can I remove /jsp/common after /myapp in the url?







David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Without knowing how you're generating the URL it's impossible to help.
Ramesh kangamuthu
Ranch Hand

Joined: Mar 13, 2007
Posts: 79
I know how to execute Struts2 action and I followed it this project. But I want to know whether Struts2 specifies an action in the url exactly after the context root , ie App name, or not.

Only for the first time it adds jsp/common after the action. For subsequent requests the url comes as /AppName/actionName

 
 
subject: Struts2 action adds folder path to url
 
Similar Threads
Download pdf file in struts2
migration to Struts2
JSP unable to find Struts2 action
Struts2 : Suppressing the Context Path on the <s:form /> tag
URL rewrite Struts2