WEB-INF is protected from outside access as it's used to store
configuration files. You need to place your jsp files somewhere else,
the root directory should work just fine.
Also, you need just one rule to go from page2 to page1, like
<navigation-rule>
<from-view-id>/page2.jsp<from-view-id>
<navigation-case>
<from-outcome>goPage1</from-outcome>
<to-view-id>/page1.jsp</to-view-id>
</navigation-case>
</navigation-rule>
assuming you have your jsp files in the root directory.
Remember that the content of <from-outcome> has to be the same as the
string in the "action" attribute of the commandLink tag (or, the return
value of the action method, if you provide one).
Mirek
Chrisi wrote:
Hello Mirek,
thanks for clarification!
I tried to use the h:commandLink and run into a second question. ;)
page2 is a jsp-file that is stored inside the WEB-INF directory.
When clicking on the generated link of the commandLink-component I get
the follwing
404-error: /testapp/WEB-INF/dir/page2.faces - The requested resource
is not available.
Does this mean, that hidden jsp-files inside WEB-INF couldn't be used
for a Faces-request?
My navigation rule looks like this:
<navigation-rule>
<from-view-id>/page1.jsp<from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/WEB-INF/dir/page2.jsp</to-view-id>
</navigation-case>
</navigation-rule>
I tried a second navigation-rule back from page2 to page1, but the
error-message remains?
Is a second navigation-rule necessary or is the "WEB-INF" the problem?
Thanks again!
Chrisi
On 5/10/06, *Mirek B.* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
wrote:
Hello Chrisi,
what you need is to use <h:commandLink> instead of simple link
on page2, write a navigation case from page1 to page2 and then either:
a) Write an action method for the backing bean of page2, which
sets the "controller.name <http://controller.name>" property, or
b) Use the Tomahawk <t:updateActionListener> extension, as in this:
<h:commandLink value="Go to page 2" action="goPage1">
<t:updateActionListener property="#{controller.name
<http://controller.name>}" value="Chrisi" />
</h:commandLink>
Regards
Mirek
Chrisi wrote:
> Hello,
>
> this is a beginner question:
>
> I have two java server faces pages.
>
> Nr.1 'page1.faces': Contains just a simple form with an
input-field
> like the following
> <h:inputText value="#{controller.name <http://controller.name>
<http://controller.name>}"/
>
> Nr.2 'page2.faces': Should contain a simple link to ' page1.faces'.
> When clicking on
> the link, a value like 'Chrisi' should be transfert to the text-field
> and page1.faces should
> be rendered.
>
> What is the JSF way to do this right?
> Sure, I can do something like this <a
href="page1.faces?name=Chrisi"> and
> let the page1.faces check the parameter 'name' using EL.
> But there should be a better way using the JSF lifecycle and the
> controller/modell concept, right?
>
> --
> Thanks and Greetings
> Chrisi