Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java struts
Hi all,
please try to give me satisfactory explanation
<action path="/listforums"
            type="com.mvnforum.actions.ListForumsAction">
 
<forward name="success"
	         path="/mvnplugin/mvnforum/user/listforums.jsp"
	         redirect="false"/>
 
</action>
 
Hi all,
Please go through the code above. I have couple of very technical questions in my mind,
 
(1) in the URI when "http://......../app_name/listforums.do" request comes, the container will execute the "type" attribute in action tag. i.e. ListForumsAction.java file. Now, when we return mapping.findForward("success"), it will find the logical name "success" in that action tag and forwards the page to the specified path. HERE COMES MY DOUBT. When container see "success" it will display the content of listfurms.jsp page. But what would be the URI at that time on the address bar ???? will it be the same as "http://......../app_name/listforums.do" or "http://......../app_name/mvnplugin/mvnforum/user/listforums.jsp" ??
 
(2) what if we've made redirect="true"
 
[edit by benjymous - added pre tags and escaped your html so we can see your code snippets]
Posted 5-Jan-10 10:09am
Edited 20-Oct-10 12:09pm
Henry Minute223.8K
v5

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

(1)
The URI in the address should be the redirected address, that is the page being shown.
 
(2)
If you specify redirect="true", Struts uses a client-side redirect [response.sendRedirect()]. The JSP will be invoked by a new browser request, and any data stored in the old request will be lost.
  Permalink  
Comments
Dalek Dave at 3-Nov-10 6:22am
   
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 186
4 Aajmot Sk 153
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 3 Nov 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100