NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

faces-confg.xml

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
ceyezumma



Joined: 02 Feb 2009
Posts: 122

PostPosted: Sat Feb 28, 2009 6:20 am    Post subject: faces-confg.xml Reply with quote

If I created a var to hold a navigation rule is the var below stating to go to the faces-configt.xml by adding the /faces and it will go to the

<from-view-id>greeting.jsp </from-view-id>

private String navigate = "/jAstrologer/faces/greeting.jsp"

or not?
Thanks
Steve

Here is more on what is going on.

Quote:

Modifying Page Navigation

Now that you have successfully modified the form, you can make one final change that affects navigation within the application. Specifically, you can add a link in the success page to allow users to return to the form input page. To do so, you must add navigation control to success.jsp which takes the user back to greeting.jsp. This requires the outputLink tag. Because success.jsp is an output page, use a link and not a button to navigate between pages.

You could define the link directly in success.jsp, but in this case you can store the text of the link and the navigation URL in the backing bean.

1. Open UserBean and add the following fields and corresponding accessor methods:

private String navigate = "/jAstrologer/faces/greeting.jsp";
private String linkText = "Back to previous page";

2. Open success.jsp in the Source Editor and add the following code (in bold):

<p>Notes:<br>
<h:outputText value="#{UserBean.notes}" /></p>
<p><h:outputLink value="#{UserBean.navigate}" >
<h:outputText value="#{UserBean.linkText}"/>
</h:outputLink></p>

When you click on the "Back to previous page" link in success.jsp, you are redirected back to greeting.jsp and the form values you entered are automatically reset.
Back to top
Futaleufu_John
Posted via mailing list.





PostPosted: Mon Mar 02, 2009 2:14 pm    Post subject: faces-confg.xml Reply with quote

Neither. I'm assuming your navigation string is returned from a JSP backing
bean.

In the following example, I have a JSP page called From_Page.jsp. Its
backing bean is called From_Page.java. When From_Page is submitted, usually
in response to a button click, that button's action method is called. The
return value is a navigation string. If the navigation string contains
"greeting" then the application will navigate to the greeting JSP page. If
the navigation string is null, the same page will be displayed again,
perhaps with updated information.

<navigation-rule>
<from-view-id>/From_Page.jsp</from-view-id>
<navigation-case>
<from-outcome>greeting</from-outcome>
<to-view-id>/greeting.jsp</to-view-id>
</navigation-case>
</navigation-rule>

If you want to navigate to a different page when you don't return a
navigation string, then you can use redirect as shown in the following
example.

FacesContext facesContext = getFacesContext();
ExternalContext externalContext =
facesContext.getExternalContext();
externalContext.redirect("gretting.jsp");


ceyezumma wrote:
Quote:

If I created a var to hold a navigation rule is the var below stating to
go to the faces-configt.xml by adding the /faces and it will go to the



<from-view-id>greeting.jsp </from-view-id>



private String navigate = "/jAstrologer/faces/greeting.jsp"



or not?

Thanks

Steve








-----
Any ads or links to ads that appear in this post are not endorsed nor
recommended by this poster.
--
View this message in context: http://www.nabble.com/faces-confg.xml-tp22260830p22288856.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo