Thats easy if I understood yoour problem.
return new ActionForward(mapping.findForward("success").getPath() +
"dynamic.jsp");
-----Original Message-----
From: Sidhartha Jain [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 5:49 PM
To: Struts Users Mailing List
Subject: Regarding URL
Hi All,
I am trying to subsitute a java servlet code into an Struts Action class
code.Here we are to forward to next page depending upon the variable jspurl
value.I dont know how to do that in struts because what i Know we do
return(mapping.findforward("sucess")) which is specified in config.xml to
which page to forward which is a fixed url.
How can we code this to make a dynamic url.I need this becos everytime i
might have a difft action or type.Becos I am generating Dynamic JSP.
Anyone who could answer this will be of great help for me.
String jspURL = "/" + action + type + ".jsp";
File testFile = new File(getServletContext
().getRealPath(jspURL));
if (!testFile.exists())
{
jspURL = "/" + action + "Object.jsp";
}
System.out.println(jspURL + " ****");
RequestDispatcher reqDis = getServletContext
().getRequestDispatcher(jspURL);
reqDis.forward(request, response);
Thanks in advance
Sidh
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>