Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can i add url parameter to my forward from the action ?

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
How can i add url parameter to my forward from the action ?
i should add a parameter and its value to the forward , from the action
problem is that i can not use session attribute or request arrtibute , just parameter
Im trying to use google Search tag http://google-taglib.sourceforge.net/
for my project , but problem is that i should just search inside my own domain :

in google search : it is like this :
q=what i want to search + site:www.mydomain.com
now i should add this parameter to the result jsp
the forward should be something like :
results.jsp?q=.......

can some one provide some suggestion pleas ?
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this one

ActionForward forward = mapping.findForward("SUCCESS"); // SUCCESS is the strong defined in the struts configuration xml file.

if (forward == null)
{
return null;
}
String name = forward.getName();
String path = forward.getPath();
String parameter = "valuePassed"
boolean redirect = forward.getRedirect();
boolean contextRelative = forward.getContextRelative();

path += "?param1=" + parameter ;

return new ActionForward(name, path, redirect, contextRelative);
}
 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you . it is even my very bad problem which i had from before and i solve it very badly
goign back to some url while i tried to include it into another jsp file.
but now i just forward to that url

thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic