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>
Next: Navigating between three pages: example 2 >>
More Java Articles
More By Jayaram Krishnaswamy