JSF Static Navigation Example

EBPP, the acronyms of Electronic Bill Presentment and Payment is a smart way of bill collection and its billing through internet and also describing of transaction detail on the web. It is also a form of E-commerce and being more popular because of its tr


 

Ads

Tutorials   
JSF Tutorials: Easy steps to learn JSF Java Server Faces (JSF) Tutorials What is JSF Mojarra? JSF Life Cycle JSF Examples JSF Tutorial For Beginners Roseindia JSF Tutorial JSF core Tag Reference JSF internationalization example Tomahawk selectOneCountry tag RCFaces About Hibernate, Spring and JSF Integration Tutorial Creating Login Page In JSF using NetBeans JSF Hello World Declaring the Bean class in the faces-config.xml file Creating a Web Application with the JSF Framework Binding the Form Elements With the Bean Properties Adding Navigation in JSF Application Binding Component Instance to a Bean Property Tomahawk validateEqual tag Tomahawk validateEmail tag Tomahawk validateCreditCard tag Tomahawk selectOneListbox tag Tomahawk selectManyListbox tag Tomahawk selectManyCheckbox tag Tomahawk selectBooleanCheckbox tag Tomahawk saveState tag Tomahawk popup tag Tomahawk inputCalendar tag Tomahawk htmlTag tag Tomahawk graphicImage tag Tomahawk documentHead tag Tomahawk documentBody tag Tomahawk document tag Tomahawk column tag DataBase Connectivity with MySql in Visual Web JSF Application Using Net Beans IDE Retrieve Image in JSF From MySQL Table Using NetBeans IDE JSF Training Java Sever Faces 1.2 - JSF 1.2 Display Data from Database in JSF Application Business Objects of Business Logic tier Setup MySQL Database Working with Database through JDBC Working with JavaScript & CSS Referencing a Localized Message Referencing Resource Bundle from a Page Binding Component Value to an Implicit Object Phase Listener Value Change Event Listener Action Event Listener
Ads
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:view>
<html>
<head><title>Navigation Page</title></head>

<body>
<h1>This is the first page.</h1>
<h:form>
<h:commandButton value="Go to second page" 
action="secondpage" />
</h:form>
</body>
</html>
</f:view>

Code for the secondpage.jsp file:

<h4>This page is navigated by the firstpage.jsp that has 
been mentioned in the faces-config.xml file.
</h4>

Code for the faces-config.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.
//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com
/dtd/web-facesconfig_1_0.dtd">

<faces-config>
     <navigation-rule>
	<from-view-id>/firstpage.jsp</from-view-id>
	  <navigation-case>
	    <from-outcome>secondpage</from-outcome>
	      <to-view-id>/secondpage.jsp</to-view-id>
		</navigation-case>
	</navigation-rule>
</faces-config>

Code for the web.xml file:

<?xml version="1.0"?> 
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.
//DTD Web Application 2.3//EN" "http://java.sun.com
/dtd/web-app_2_3.dtd">

<web-app>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD
</param-name>
        <param-value>server</param-value>
    </context-param>    

    <!-- Faces Servlet -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet
</servlet-class>
        <load-on-startup> 1 </load-on-startup>
    </servlet>

	<!-- Faces Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
</web-app>

Download This Complete Example.

Advertisements

Share on Google+Share on Google+

JSF Static Navigation Example

Posted on: February 26, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: JSF Static Navigation Example  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads