?
Solved

technical doubt in struts-config.xml

Posted on 2010-01-05
3
Medium Priority
?
850 Views
Last Modified: 2013-11-24
Hi all,
please try to give me satisfactory explaination ....




<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" attribut 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"  
0
Comment
Question by:jayz_smith
3 Comments
 
LVL 14

Accepted Solution

by:
boonleng earned 1000 total points
ID: 26188153
set redirect="false" will see "http://......../app_name/listforums.do" coz is using RequestDispatcher.forward().

set redirect="true" will see "http://......../app_name/mvnplugin/mvnforum/user/listforums.jsp" coz is using HttpServletResponse.sendRedirect()
0
 
LVL 40

Assisted Solution

by:Gurvinder Pal Singh
Gurvinder Pal Singh earned 1000 total points
ID: 26189286
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.

check this link
http://struts.apache.org/1.x/userGuide/building_controller.html

1) redirect="true" means that you are choosing response redirect over response forward, so you will see http://......../app_name/mvnplugin/mvnforum/user/listforums.jsp



0
 

Author Closing Comment

by:jayz_smith
ID: 31673132
perfect answer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A solution for Fortify Path Manipulation.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question