Home arrow Java arrow Page 2 - 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: 2 stars2 stars2 stars2 stars2 stars / 3
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

TOOLS YOU CAN USE

advertisement
Page Navigation using Sun Java Studio Creator 2 - Navigating to Chicago.jsp by clicking a link on the NewYork.jsp
(Page 2 of 4 )

From the Palette drag and drop a hyperlink control to the NewYork.jsp page. If you right click this hyperlink you will get a drop-down menu from which you can do a lot of things. You can edit the text, the JSP source, and so forth. For this example the text was edited to read "Go to Chicago."

Now go back to the Page Navigation designer and click on the NewYork.jsp page. The size of the page increases and shows the hyperlink you created in the previous paragraph as shown.

Now click on the hyperlink in NewYork.jsp in the designer of the Page Navigation (in the previous picture) and drag the line that follows the mouse towards the Chicago.jsp page as shown.

When you terminate the line on Chicago.jsp, the design view appears as shown. This ensures that when you click on the link in NewYork.jsp you will bring up the Chicago.jsp page in the browser.

This design information transforms to the XML navigation definition as shown in the Source View of Page Navigation as shown. The file is pretty intuitive about what it does.

<?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>/NewYork.jsp</from-view-id> <navigation-case> <from-outcome>case1</from-outcome> <to-view-id>/Chicago.jsp</to-view-id> </navigation-case> </navigation-rule> </faces-config>

The root element of this XML configuration file is <faces-config/> and there can be any number of <navigation-rule/> nodes. Each node consists of a <navigation-case/> defining the navigation. In this case, case1 defines going from NewYork.jsp and navigating to Chicago.jsp.


blog comments powered by Disqus
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...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



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