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 Struts Action Forword 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 "Struts Action Forword" Watch "Struts Action Forword" New topic
Author

Struts Action Forword

Ggaurav Gupta
Greenhorn

Joined: Mar 26, 2010
Posts: 9
Hi all,

I m forwording from action class and in the url i m getting ActionClass Name like http://localhost:8080/Test/TestLogin.do

i want the in the URL the jsp name should be displayed is it possible in struts 1.3

like : http://localhost:8080/Test/HomePage.jsp

in the ActionClass i m returning ..............

return mapping.findForward("test");

in struts-config.xml

<forward name="test" path="/HomePage.jsp" />

Please suggest me



Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Change the mapping in web.xml from *.do to *.jsp. It'll do the trick.


Never try to be a hard-worker. Be a smart-worker.
My Blog
Ggaurav Gupta
Greenhorn

Joined: Mar 26, 2010
Posts: 9
Hello ,

I tried it after that i m getting Invalid path was requested. Not able to run my application. Everytime it is saying Invalid path was requested
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Do you want the entire app to look like you're hitting JSP pages, or do you just want that one page to be a JSP?
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Ggaurav Gupta wrote:Hello ,

I tried it after that i m getting Invalid path was requested. Not able to run my application. Everytime it is saying Invalid path was requested


Stacktrace?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts Action Forword
 
Similar Threads
tomcat4
configuring struts with tomcat 6.0
Use welcome-file-list to run struts action?
Struts 2 URL Rename
integration of struts- jsf Problem related t url