Sorry, I meant:

  <h:commandLink id="cmdLink" action="" value="View object">
     <f:param name="test" value="testValue"/>
     <f:param name="foo" value="fooValue"/>
  </h:commandLink>

Costa Basil <[EMAIL PROTECTED]> wrote:
page:

  <h:commandLink id="cmdLink" action="" value="Go To Page 2">
     <f:param name="test" value="testValue"/>
     <f:param name="foo" value="fooValue"/>
  </h:commandLink>

faces-config.xml:

    <navigation-case>
      <from-outcome>goViewObject</from-outcome>
      <to-view-id>viewObject.jsp?test=#{param.test}&amp;foo=#{param.foo}</to-view-id>
      <redirect />
    </navigation-case>

It will redirect you to:
viewObject.jsp?test=testValue&foo=fooValue

Please note I used the prefix url handling.

Matthias Wessendorf <[EMAIL PROTECTED]> wrote:
looks interesting, what happens, if you have to EL based params ?

like

viewObject.jsp?test=#{param.test}&foo=#{param.foo}

.Matthias

On Wed, 2006-02-15 at 16:32 -0500, Costa Basil wrote:
> One thing though, the implementation below blows up for normal view
> ids so I replaced it with the following code:
>
> String targetViewId = navigationCase.getToViewId();
> if (targetViewId.indexOf("#{") != -1)
> {
> ValueBinding vb =
> facesContext.getApplication().createValueBinding(navigationCase.getToViewId());
> if (vb != null)
> targetViewId = (String) vb.getValue(facesContext);
> }
> String redirectPath = viewHandler.getActionURL(facesContext,
> targetViewId);
>
> Costa Basil <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This is a solution to an issue that some people complained
> about and that is how to preserve request objects or other
> objects when you do a redirect.
>
> It is actually possible to specify JSF EL expressions in the
> to-view-id view. Example:
>
> In faces-config.xml I have:
>
>
> goViewObject
> viewObject.jsp?test=#{param.test}
>
>

>
>
> In a test page I created I have:
>
>
>
>

>
> When I click on the link myfaces will redirect me to:
> viewObject.jsp?test=xyz.
>
>
> In order to do this I had to make a slight change to the
> navigation handler
> (org.apache.myfaces.application.NavigationHandlerImpl)
> that comes with MyFaces:
>
> I added the following lines:
>
> ValueBinding vb =
> facesContext.getApplication().createValueBinding(navigationCase.getToViewId());
> String targetViewId = vb != null ?
> (String)vb.getValue(facesC ontext) :
> navigationCase.getToViewId();
> String redirectPath =
> viewHandler.getActionURL(facesContext, targetViewId);
>
> to replace line 128 in
> org.apache.myfaces.application.NavigationHandlerImpl (myfaces
> 1.1.1):
>
> line 128: String redirectPath =
> ; viewHandler.getActionURL(facesContext,
> navigationCase.getToViewId());
>
>
> This way you can specify a JSF EL _expression_ that would
> dynamically compute the viewId or a portion of the viewId. You
> could use this to save an object under a temporary key in the
> session scope, and then pass this key to the next page (you
> are redirecting to) which would use it to retrieve the object
> from the session scope (and remove it).
>
> I think the ability to specify JSF EL expressions in the
> to-view-id elements should be part of the standard.
>
> Any thoughts?
>
> The other alternative to this would be to perform the
> redirection "manually" in the action method (the parameters
> would have to be added manually).
>
>
> ______________________________________________________________
> Find your next car at Yahoo! Canada Autos
>
>
>
>
> ______________________________________________________________________
> Find your next car at Yahoo! Canada Autos

< br>

Find your next car at Yahoo! Canada Autos


Find your next car at Yahoo! Canada Autos

Reply via email to