-
1. Re: page.xml redirect with parameter
mconroy Jul 15, 2010 4:44 PM (in response to mconroy)Can't be done. I'm guessing that the params are for forwarding purposes only...
http://www.javapractices.com/topic/TopicAction.do?Id=181
Redirect
* a redirect is a two step process, where the web application instructs the browser to fetch a second URL, which differs from the original
* a browser reload of the second URL will not repeat the original request, but will rather fetch the second URL
* redirect is marginally slower than a forward, since it requires two browser requests, not one
* objects placed in the original request scope are not available to the second request -
2. Re: page.xml redirect with parameter
serkan.s.eskici.online.nl Jul 15, 2010 5:48 PM (in response to mconroy)Are you calling #{project.open} from your JSF page within a link or a button ?
Then pass the parameter within those components.
Example:
<s:link action="#{project.open}" ...> <f:param name="proj" value="#{project.number}"/> </s:link>
-
3. Re: page.xml redirect with parameter
mconroy Jul 15, 2010 10:40 PM (in response to mconroy)Note: I am a Seam newbie...
Thanks for the response Serkan!
Unfortunately I was trying to do something far more quirky than that. I was attempting to do a web redirect to another context and post the data. This is probably my failed attempt, but the project will be a authentication front end for several applications. The new application will collect authentication info and then forward some type of security token on. I thought about using a get request, but I would like to avoid having encrypted credentials in the url.
I found an interesting way of doing this by creating a custom servlet to intercept the web request and insert the parameters in the request attributes, but that eventually fails due to class loader security restrictions in the receiving context. I am attempting to figure that problem out now.
Here is the servlet code if anyone is interested. If anyone has a better idea feel free to throw it out here.
package org.safmt.bigbro; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jboss.seam.contexts.Contexts; import org.safmt.bigbro.model.AuthUser; public final class AuthForwardServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) { HttpServletRequest req = (HttpServletRequest) request; req.setAttribute("user", Contexts.getConversationContext().get("auser"))); try { req.getSession().getServletContext().getContext("/SecureMail") .getRequestDispatcher("/Login.do").forward(req, response); } catch (ServletException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }