Home arrow Java arrow Page Navigation using Sun Java Studio Creator 2
JAVA

Page Navigation using Sun Java Studio Creator 2


Site navigation should not be an afterthought, but it can be difficult and tedious to set up correctly. Sun Java Studio Creator 2 helps take the pain out of this important part of site building. Keep reading to learn how.

Author Info:
By: Jayaram Krishnaswamy
Rating: 3 stars3 stars3 stars3 stars3 stars / 4
December 20, 2006
TABLE OF CONTENTS:
  1. · Page Navigation using Sun Java Studio Creator 2
  2. · Navigating to Chicago.jsp by clicking a link on the NewYork.jsp
  3. · Build and run the project
  4. · Navigating between three pages: example 2

print this article
SEARCH DEVARTICLES

Page Navigation using Sun Java Studio Creator 2
(Page 1 of 4 )

Page navigation is an important aspect of web development which cannot be overemphasized. It can make or break a web site. Once the navigation structure is defined, a scheme for going from one page to another is required. This is achieved by implementing a linking mechanism. Depending on the size of the site, the links have to be carefully set up and optimized to reach any part of the site with the smallest number of clicks possible while providing a clear route back to the home page. This is especially important for the common visitor who surfs to your side guided by a search engine which casts him on any page that was searched. Links between the pages are therefore of greatest importance.

Sun Java Studio Creator 2 makes it extremely easy to build the navigation by creating a design interface that creates the navigation model, an XML-based resource configuration file. This tutorial takes you through the steps involved in creating a navigation scheme that will link three Java server pages using the Page Navigation UI, an integral part of a Sun Java Studio Creator web project.

Mechanics of creating a navigation scheme: example 1

This example with only two pages illustrates very clearly how the scheme works. You will appreciate the fact that no code is needed for the success of this scheme. We create a Java Server faces web application project from File -->New Project and choose the Web option in the categories pane and the JSF Web Application in the projects pane. Here a project named Navigation was created. This adds the folder with several other folders and files to the project as shown in the next picture.

In this folder you can easily identify the Page Navigation icon which leads to the UI that actually contains the defining rule for the way in which navigation has to take place between the pages in this project. The defining rule is in the XML format, but Creator 2 provides a visual designer to carry out the navigation set up.

Add two Java server pages to the project by right clicking the Web Pages node and clicking on the page drop-down menu item as shown.

In this way two pages, NewYork.jsp and Chicago.jsp, were added to the project. After adding the pages to the project, click on the Page Navigation icon in the Navigation project. This opens the Page Navigation window as shown. When you add JSP they get added to this window as well. You can move these page objects in the designer by holding down the shift key and dragging the page by the mouse (by default they line up side by side horizontally). If there are any controls that can evoke events for navigation, such as a hyperlink or a button, they should be visible on the pages in this view. Currently the pages are empty.


blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- 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 ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials