Home arrow Java arrow Page 3 - 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 - Build and run the project
(Page 3 of 4 )

When I run the project after building, the browser display is as shown in the next picture. When I keep my mouse on the link, the status bar displays that this is a hyperlink to another page in this project.

When I click on the hyperlink the browser displays the following. The hyperlink binds to the NewYork.jsp page and the action attribute is assigned the value Case1 which is the same one defined in the XML navigation rule definition.

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" 
xmlns:h="http://java.sun.com/jsf/html" 
xmlns:jsp="http://java.sun.com/JSP/Page" 
xmlns:ui="http://www.sun.com/web/ui">
<jsp:directive.page contentType="text/html;charset=UTF-8" 
pageEncoding="UTF-8"/> <f:view> <ui:page binding="#{NewYork.page1}" id="page1"> <ui:html binding="#{NewYork.html1}" id="html1"> <ui:head binding="#{NewYork.head1}" id="head1"> <ui:link binding="#{NewYork.link1}" id="link1" url="/resources/stylesheet.css"/> </ui:head> <ui:body binding="#{NewYork.body1}" id="body1" style="-rave-layout: grid"> <ui:form binding="#{NewYork.form1}" id="form1"> <ui:hyperlink action="case1" binding="#{NewYork.
hyperlink1
}" id="hyperlink1" style="left: 50px; top: 60px;
position: absolute" text="Go to Chicago"/> <ui:staticText binding="#{NewYork.staticText1}"
id="staticText1" style="color: #cc0066; font-family: Verdana,Arial,
Helvetica,sans-serif; font-size: 18px; font-weight: bold; left: 50px;
top: 10px; position: absolute; width: 150px" text="New York  "/> </ui:form> </ui:body> </ui:html> </ui:page> </f:view> </jsp:root>

The next picture shows a button on the Chicago page being linked to the NewYork.jsp page as shown. In this case also it is case1, but it is now from Chicago.jsp to NewYork.jsp.

The binding in this case is as shown with rest of the code abbreviated.

<ui:form binding="#{Chicago.form1}" id="form1">
<ui:staticText binding="#{Chicago.staticText1}" id="staticText1"
style="color: #990000; font-family: Verdana,Arial,Helvetica,
sans-serif; font-size: 36px; font-style: oblique; left: 60px; top: 10px; position: absolute" text="Chicago "/> <ui:staticText binding="#{Chicago.staticText2}" id="staticText2" style="color: rgb(51, 0, 204); font-size: 36px; font-style:
oblique; font-weight: bolder; left: 170px; top: 50px; position: absolute" text="Chicago"/> <ui:button action="case1" binding="#{Chicago.button1}" id="button1" style="left: 89px; top: 120px; position:
absolute" text="Go to New York"/> </ui:form>


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 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials