jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Redirect to JSP from Action Class with Parameter in Struts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Redirect to JSP from Action Class with Parameter in Struts?" Watch "Redirect to JSP from Action Class with Parameter in Struts?" New topic
Author

Redirect to JSP from Action Class with Parameter in Struts?

Naveen
Greenhorn

Joined: Aug 27, 2003
Posts: 2
I am moving the files from one directory to other directory. After moving the files I want to give the message to the user
that how many files are moved.To display this message how to send a parameter from Action Class to Jsp file?
Just like response.sendRedirect("../admin/HRMAdmnShowTrgAgencyDetails.jsp?reg="+mode+"");
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi naveen

Then it seems that u r not that perfect with the concepts of request and all .u need not sent it as query string .u can set that count in request scope and u can access it in ur jsp to display the information.Hope u r getting me .
Naveen
Greenhorn

Joined: Aug 27, 2003
Posts: 2
Thanks Srinath, You are correct..I didn't work on Request objects earlier. You mean to say that that count will add to the Request Object and take that value in View (JSP) and will display there. May be I have to check the request object for not null and will display the count and have to remove that variable as the same jsp has to be displayed before and after moving files. If you are having that code sample can you post here? Thanks in Advance
Gilbert Prashant Singh
Greenhorn

Joined: Nov 02, 2011
Posts: 5
We can have dynamic redirection of JSP pages through action classes in Struts 2 using "redirect" result in struts.xml.

E.g:
In Struts.xml, have a dynamic result such as:


In the action:


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect to JSP from Action Class with Parameter in Struts?