wood burning stoves*
The moose likes Struts and the fly likes url problem in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "url problem in struts" Watch "url problem in struts" New topic

url problem in struts

Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 65
hi friends,

i have an issue in url. my application have a login action and when user submit username and password control goes to login action and on successfull login i redirect to showuser action
my struts config part is as below

<action path="/login" type="com..action.Login" name="login" scope="request" input="input">
<forward name="success" path="/showuser.do?command=group" />
<forward name="failure" path="/pages/loginnew.jsp" />

in browser i can see the page corresponding to showuser, but the url still shows login.do, so on calling links from this page it not works as expected. all my links direct to login action

how can i show the showuser.do in url?

thanks in advance.....
Rudy Gireyev
Ranch Hand

Joined: May 03, 2011
Posts: 39
The browser will only show what you entered in your HTML/JSP form tag. The action attribute of HTML form tag to be precise. What you have in your STRUTS is completely irrelevant.
Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 65
thanks Rudy Gireyev

i solved that issue by adding redirect = "true" in forward section
It is sorta covered in the JavaRanch Style Guide.
subject: url problem in struts
Similar Threads
Struts and JDBC/realm
PRoblem in displaying ActionForm
Security Constraint problem
Navigating with form actions in Struts
How to invoke a web page on logout action