Java
  Home arrow Java arrow Page 4 - Page Navigation using Sun Java Studio Crea...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Page Navigation using Sun Java Studio Creator 2
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2006-12-20

    Table of Contents:
  • Page Navigation using Sun Java Studio Creator 2
  • Navigating to Chicago.jsp by clicking a link on the NewYork.jsp
  • Build and run the project
  • Navigating between three pages: example 2

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Page Navigation using Sun Java Studio Creator 2 - Navigating between three pages: example 2


    (Page 4 of 4 )

    The process of navigating between more than two pages follows in exactly the same way as what was described for two pages. The next picture shows the design view of navigation between three pages, HomePage.jsp, Tutorials.jsp, WebSites.jsp. These pages are also in the same project. Each of the pages have two hyperlinks that connect to two other pages as shown.

    The <faces-config/> is just one file which includes all the navigation rules for the project. In this case it includes the rules for both the two page example as well as the three page example as shown. The code in blue is for navigating the pages in the three pages HomePage.jsp, Tutorials.jsp and Websites.jsp. The code in green is for the two pages NewYork.jsp and Chicago.jsp. There are no links between the two sets of pages.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config 
    PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config> <navigation-rule>
    <from-view-id>/HomePage.jsp</from-view-id>
    <navigation-case>
    <from-outcome>case1</from-outcome>
    <to-view-id>/Tutorials.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>case2</from-outcome>
    <to-view-id>/Websites.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/Tutorials.jsp</from-view-id>
    <navigation-case>
    <from-outcome>case1</from-outcome>
    <to-view-id>/HomePage.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>case2</from-outcome>
    <to-view-id>/Websites.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/Websites.jsp</from-view-id>
    <navigation-case>
    <from-outcome>case1</from-outcome>
    <to-view-id>/HomePage.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>case2</from-outcome>
    <to-view-id>/Tutorials.jsp</to-view-id>
    </navigation-case>
    </navigation-rule> <navigation-rule>
    <from-view-id>/NewYork.jsp</from-view-id>
    <navigation-case>
    <from-outcome>case1</from-outcome>
    <to-view-id>/Chicago.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/Chicago.jsp</from-view-id>
    <navigation-case>
    <from-outcome>case1</from-outcome>
    <to-view-id>/NewYork.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config> 

    Instead of beginning with the pages all ready to start with, you may begin adding pages from inside the Page Navigation designer interface by right clicking in an empty area to create a page. Also the designer is quite user friendly. You can highlight a link by clicking it in the designer and looking at its properties as shown. In a simple diagram like this it is obvious, but if there are a large number of links this will be a necessary feature.

    Summary

    Page navigation is really effortless with Sun Java Studio Creator 2. This article described page navigation for a web project with two examples. The designer is meant for only navigating to Java server pages and is not intended for HTML pages and page fragments. Navigation is truly codeless once it is correctly configured.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Compared to last version the GUI is much better. It is quite easy to set up the...
     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT