• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirect to JSP from Action Class with Parameter in Struts?

 
Naveen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic