You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Garner, Shawn" <sh...@pearson.com> on 2006/01/12 17:54:54 UTC

[OT JSF/Shale]

I want to use a link in one view page to go to another view without going
through a bean action.

Something like this?  I thought maybe I could just use the jsp:forward tag
and put the name of the jsp page.

view1.jsp

<f:view>

<h:commandLink forward="/view2.jsp" >

          <h:outputText value="#{bundle['image.submit.changes']}"/>

</h:commandLink>

</f:view>

 

 

or I would like to hard code the result of this view and maybe use this in
the configuration file

something like then do a from-outcome="success_submit" to
view-id="/view2.jsp"

 

<f:view>

<h:commandLink outcome="success_submit" >

          <h:outputText value="#{bundle['image.submit.changes']}"/>

</h:commandLink>

</f:view>

 

 

Shawn

 


**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

Re: [OT JSF/Shale]

Posted by Craig McClanahan <cr...@apache.org>.
On 1/12/06, Garner, Shawn <sh...@pearson.com> wrote:
>
> I want to use a link in one view page to go to another view without going
> through a bean action.


That's actually pretty easy ... the thing you enter for the "action"
attribute can be either a method binding to a bean action, or a literal
outcome string that is fed directly to the navigation system:

    <h:commandLink ... action="#{bean.action}"/>

or

    <h:commandLink ... action="foo"/>

In the latter case, JSF acts exactly like you had called a no-op action that
returned "foo" as the outcome.  This gets fed into the navigation rules in
the usual way.

Craig

PS:  This trick is also quite useful as you are originally constructing your
application ... you can create the page with literal actions for hard coded
navigation until you get around to actually writing the bean actions, at
which point you would change to using the appropriate binding expression.

Re: [OT JSF/Shale]

Posted by Laurie Harper <la...@holoweb.net>.
Garner, Shawn wrote:
> I want to use a link in one view page to go to another view without going
> through a bean action.
> 
> Something like this?  I thought maybe I could just use the jsp:forward tag
> and put the name of the jsp page.
> 
> view1.jsp
> 
> <f:view>
> 
> <h:commandLink forward="/view2.jsp" >
> 
>           <h:outputText value="#{bundle['image.submit.changes']}"/>
> 
> </h:commandLink>
> 
> </f:view>
> 
> or I would like to hard code the result of this view and maybe use this in
> the configuration file
> 
> something like then do a from-outcome="success_submit" to
> view-id="/view2.jsp"
>  
> 
> <f:view>
> 
> <h:commandLink outcome="success_submit" >
> 
>           <h:outputText value="#{bundle['image.submit.changes']}"/>
> 
> </h:commandLink>
> 
> </f:view>

So what's the problem you're seeing? Are these approaches not working 
for you?

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org