This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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:


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Redirect to JSP from Action Class with Parameter in Struts?
 
Similar Threads
Moving files (urgent)
Specifying a message resource file within the Action class
How to know about MessageResources.properties file?
Resource not Found error continues even after resource is removed from xml file
Can i use java class in action attribute in form tag of jsp page?