How can I navigate to the specified page?

h5. I'm a novice in JavaServer Faces.
today i meet a problem that i can not navigate to the specified page in my application.
the version of the jsf API is : jsf-1.1_02-b08
my web.xml is configed as following:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="[http://java.sun.com/xml/ns/j2ee]" xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance]"
xsi:schemaLocation="[http://java.sun.com/xml/ns/j2ee] [http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd]">
<display-name>JavaServerFaces</display-name>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>faces/Charpter1/HelloWorld.jsp</welcome-file>
</welcome-file-list>
</web-app>
my faces-config.xml is configed as following:
<?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>
<managed-bean>
<managed-bean-name>
helloBean
</managed-bean-name>
<managed-bean-class>org.jia.hello.HelloBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>Charpter1/HelloWorld.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>Charpter1/GoodBye.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
my HelloWorld.jsp is like this:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[http://www.w3.org/TR/html4/loose.dtd]">
<%@ taglib uri="[http://java.sun.com/jsf/core]" prefix="f"%>
<%@ taglib uri="[http://java.sun.com/jsf/html]" prefix="h"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JSF In Action - Hello, World!</title>
</head>
<body>
<h:form id="welcomeForm">
<h:outputText id="test" value="Welcome to JavaServer Faces!"
style="font-family: Arial, sans-serif; font-size:24; color:green" />
<p><h:message id="errors" for="helloInput" style="color:red" /></p>
<p><h:outputLabel for="helloInput">
<h:outputText id="helloInputLabel" value="Enter number of controls to display:" />
</h:outputLabel>
<h:inputText id="helloInput" value="#{helloBean.numControls}"
required="true">
<f:validateLongRange minimum="1" maximum="500" />
</h:inputText></p>
<p><h:panelGrid id="controlPanel"
binding="#{helloBean.controlPanel}" columns="20" border="1"
cellspacing="0" /></p>
<h:commandButton id="redisplayCommand" type="submit" value="Redisplay"
actionListener="#{helloBean.addControls}" />
<h:commandButton id="goodByeCommand" type="submit" value="GoodBye"
action="#{helloBean.goodBye}" immediate="true"/>
</h:form>
</body>
</html>
</f:view>
the content of the HelloBean.java is as following:
package org.jia.hello;
import java.util.List;
import javax.faces.application.Application;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
h5. public class HelloBean {
private int numControls;
private HtmlPanelGrid controlPanel;
h5. public int getNumControls() {
return numControls;
h5. public void setNumControls(int numControls) {
this.numControls = numControls;
h5. public HtmlPanelGrid getControlPanel() {
return controlPanel;
h5. public void setControlPanel(HtmlPanelGrid controlPanel) {
this.controlPanel = controlPanel;
h5. public void addControls(ActionEvent actionEvent) {
Application application = FacesContext.getCurrentInstance()
.getApplication();
List children = controlPanel.getChildren();
children.clear();
for (int i = 0; i < numControls; i++) {
HtmlOutputText output = (HtmlOutputText) application
.createComponent(HtmlOutputText.COMPONENT_TYPE);
output.setValue(" " + i + " ");
output.setStyle("color: blue");
children.add(output);
public String goodBye() {
return "success";
h5.
when I run the application, HelloWorld.jsp can be displayed correctly, but when i click the "GoodBye" button in the HelloWorld.jsp, the page can not skip from current page to GoodBye.jsp, I noted that, the URL in my browser is: [http://localhost:8080/JavaServerFaces/faces/Charpter1/HelloWorld.jsp;jsessionid=D7F83C0F448E5B5AAD5897BEB5667A67]
Then I try to replace the "GoodBye" button's action with "success" directly, but the problem is still occured.
I could not know how this problem is caused, could you help me?

BalusC wrote:
zhangzhexin wrote:
today i meet a problem that i can not navigate to the specified page in my application.This can have several causes: a validation or conversion error has occurred, or the navigation case doesn't match.please note that my "GoodBye" button use the property "immediate" and set "true" to it.
the version of the jsf API is : jsf-1.1_02-b08
This is over 3 years old. It would be smart to upgrade to the most recent version. Get it here: [http://javaserverfaces.dev.java.net].
I think the problem of navigation does not have a relationship with the current jsf API version I used.
[lot of unformatted code]Please use code tags to post your code. They will be nicely formatted and better readable. Press the CODE button to get them.I have used the code tag to format my code.
I could not know how this problem is caused, could you help me? Add <h:messages/> to the page to get notified of any missing validation or conversion errors. Verify using the JSF manual/tutorial if the navigation case is correct.In HelloWorld.jsp, I have used the <h:mesage/> and when I click the GoodBye button, the HelloWorld is refreshed only, there are not any error messages or validation messages displaied on the HelloWorld.jsp page.
I will repaste my code with code tag,
My web.xml is configed as following:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
     xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
     <display-name>JavaServerFaces</display-name>
     <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
     </servlet>
     <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>/faces/*</url-pattern>
     </servlet-mapping>
     <welcome-file-list>
          <welcome-file>faces/Charpter1/HelloWorld.jsp</welcome-file>
     </welcome-file-list>
</web-app>My faces-config.xml is configed as following:
<?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>
     <managed-bean>
          <managed-bean-name>
               helloBean
          </managed-bean-name>
          <managed-bean-class>org.jia.hello.HelloBean</managed-bean-class>
          <managed-bean-scope>session</managed-bean-scope>
     </managed-bean>
     <navigation-rule>
          <from-view-id>/HelloWorld.jsp</from-view-id>
          <navigation-case>
               <from-outcome>success</from-outcome>
               <to-view-id>Charpter1/GoodBye.jsp</to-view-id>
          </navigation-case>
     </navigation-rule>
</faces-config>and my HelloWorld.jsp is as following:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
     pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<script language="javascript">
     function init(){
          document.getElementById("welcomeForm:helloInput").value = "";
</script>
<f:view>
     <html>
     <head>
     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
     <title>JSF In Action - Hello, World!</title>
     </head>
     <body onload="javascirpt:init();">
     <h:form id="welcomeForm">
          <h:outputText id="test" value="Welcome to JavaServer Faces!"
               style="font-family: Arial, sans-serif; font-size:24; color:green" />
          <p><h:message id="errors" for="helloInput" style="color:red" /></p>
          <p><h:outputLabel for="helloInput">
               <h:outputText id="helloInputLabel" value="Enter number of controls to display:" />
          </h:outputLabel>
          <h:inputText id="helloInput" value="#{helloBean.numControls}"
               required="true">
               <f:validateLongRange minimum="1" maximum="500" />
          </h:inputText></p>
          <p><h:panelGrid id="controlPanel"
               binding="#{helloBean.controlPanel}" columns="20" border="1"
               cellspacing="0" /></p>
          <h:commandButton id="redisplayCommand" type="submit" value="Redisplay"
               actionListener="#{helloBean.addControls}" />
          <h:commandButton id="goodByeCommand" type="submit" value="GoodBye"
               action="success" immediate="true"/>
     </h:form>
     </body>
     </html>
</f:view>my managed bean's content is like this:
package org.jia.hello;
import java.util.List;
import javax.faces.application.Application;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
public class HelloBean {
     private int numControls;
     private HtmlPanelGrid controlPanel;
     public int getNumControls() {
          return numControls;
     public void setNumControls(int numControls) {
          this.numControls = numControls;
     public HtmlPanelGrid getControlPanel() {
          return controlPanel;
     public void setControlPanel(HtmlPanelGrid controlPanel) {
          this.controlPanel = controlPanel;
     public void addControls(ActionEvent actionEvent) {
          Application application = FacesContext.getCurrentInstance()
                    .getApplication();
          List children = controlPanel.getChildren();
          children.clear();
          for (int i = 0; i < numControls; i++) {
               HtmlOutputText output = (HtmlOutputText) application
                         .createComponent(HtmlOutputText.COMPONENT_TYPE);
               output.setValue(" " + i + " ");
               output.setStyle("color: blue");
               children.add(output);
}I use the Tomcat 5.5.27 as the web container.
I can't understand why the page can not be navigated to the GoodBye.jsp when I click GoodBye button on the HelloWorld.jsp.
I really need your help. thanks.

Similar Messages

  • How can i print all the tab pages not just the first page (tab)

    how can i print all the tab pages not just the first page (tab)

    You would need to do this programmatically. Here's one way:
    Attachments:
    Example_VI_BD6.png ‏3 KB

  • How can I navigate to a new page when after-submit process running proc

    I have a long running procedure and would like to provide the users with an animated gif to indicate progress that updates a description line to indicate the current step in the process.
    Currently I have a couple pages in this application in which a stored procedure in a package is called which performs a long-running process which updates progress in a table. These processes have a single parameter argument. In these cases I call the procedure via the Job Scheduler as part of my After-Submit process and the page navigation jumps to another page which shows a graphical representation of % complete based on the progress updates in the table and refreshes itself every 5 seconds until the job is complete. This works fine.
    I am now running into an issue where I have a more complex set of processes, with a number of parameters. To resolve this I used the same process as above, however, I first check to see if the process exists in the Job Scheduler, if not I create it. I then set all of the parameters and tell the job scheduler to execute the procedure. This should work similar to the process I am running on the other pages, however, in this page where I have multiple parameters and send an execute command rather than an execute immediate on job creation, the system runs the entire job prior to running the page branch, as a result the end user is stuck on a hanging page with no user feedback for two minutes after pressing submit.
    I am looking for how to call the procedure and have the branch execute so a progress screen can be viewed. I am not committed to the use of the job scheduler if there is a better way.
    Any help is greatly appreciated.

    The process involves
    (1) a detail table filled with phone usage data, approximately 175,000 records per month.
    (2) a table that stores what various combinations of codes in the detail table translate to for types of calls or data transmissions
    (3) a summary table for the months calls and billing
    (4) the E-Business Suite.
    (5) A GTT for temporary crossreference storage
    (6) A GTT for reporting data
    I have a parameter page where the user selects what data they are looking for and then submits it to generate the report.
    The generation of data is a four step process.
    (A) Retrieve the Code Combination ID's for the phone usage specified in the parameters from the summary billing table(1) into a GTT(5)
    (B) Query the department and Account Code Block Details from E-Business Suite(3) (using dblink) for the CCID's in step one and add to the GTT(5)
    (C) Run a query which uses the detail table(1), a function against the crossref table(2), and the crossreference GTT(5) to create the output in the report GTT(6)
    (D) An ApEx page process that counts the output and returns to a page without Export to Excel for over 65000 records or with Export for under.
    The parameter page is an ApEx page with some text fields, a couple date fields, and some checkboxes. An after submit process calls a packaged procedure which calls separate procedures for (A), (B), and (C), the page then branches to a page that shows an animated gif and current step of the process {this is what is not working right now}. Once the task completes this page branches as per (D) to a page that shows all the contents of the GTT report(6).
    The process works successfully with the exception that instead of going to a page to show the process the system simply hangs on the parameter page after the submit is pressed until the processing is done and then goes to the processing page just long enough to branch to the report page.
    I am beginning to think that I should alter the design to not use the GTT, but include the username as a field in the output table with a binary index on it for speed so that I can use the job scheduler to run a separate session and hence enable the processing page. The processing page is important as the query can take anywhere from 2 minutes to 2 hours to generate the report depending upon the parameters.

  • How can I replace just the corrupt page(s) in the domain file of iWeb using Time Machine?

    I back up with Time Machine and have an extensive elaborate website I created in iWeb '09 over a couple months and publish to a local folder and then upload to my server, but in the last few days I notice certain pages (that I haven't even worked on or touched) somehow become corrupted or "cross-contaminated" with elements and images from other pages.  Once I see they are corrupt I make sure not to publish them (if the current published versions are the correct, non-corrupt versions) or if they did get published I can use Time Machine to retrieve the .html file and page files folder for that specific page and replace it in my published folder/server so it shows correctly on the Web.  However, that does not replace the corrupted page(s) you see and work with when you launch iWeb and try to edit or continue working on that page.
    I am confused as to how I go to the package contents of the domain file and replace just that page with a previous version from time machine.  I don't want to replace the entire domain file because I have new changes I made to other pages even in the past hours.  How can I keep the good pages and just get earlier, non-corrupted versions of the corrupt page(s)? I know it's not as easy as with the published site folder where you can just replace the page's .html file and folder, but I don't want to have to re-create the corrupted page(s) from scratch or have to replace it with the last non-corrupted domain file and then have to redo all my recent changes to new pages I made before discovering the corrupt page(s).  Thanks for your help as now I can't make changes to the page(s) within iWeb itself.

    Thanks for the response, Wyodor.  I don't know what that is, but I'll have a look.  Is it an alternative to iWeb or a way to transfer pre-existing iWeb sites?  When you say merge domain files, is that like so multiple copies of the same site show up then you can pick and choose the non-corrupted pages and group them then delete the corrupted ones?  I am on Snow Leopard with no plans or need to upgrade anytime soon.
    And yes, I will read your links but just wanted to ask those questions.  Maybe they'll answer my questions, maybe not.
    I was able to discern that within the domain file is a domain folder with all the site folders, each with their own page ".gz" files which expand into ".xml" files.  I was trying to figure out if you could simply drag the corrupt pages out that way and replace them with backup copies that are still good.  I am having trouble discerning which pages are which as they all have random names like site-page-30F175E3-AE33-4F10-A490-1A096D9B185B.xml and although I expanded and opened each in Text Wrangler, I still couldn't discern which were which for sure, and trial and error proved cumbersome.  Also, I did notice some of the later corrupted domain files had one or two more pages than the site itself has, so not sure how they got added or duplicated or what.
    Again, I'll look at your links, but do you know about swapping out individual page .xml files this way within the domain file?

  • How can I re-download the new pages.  App Center won't let me.  Says it is installed.

    I have messed up Pages 5 and now all I have on my Mac is the old pages 4.?  When I go to the App Center it tells me that the new Pages is installed.  But I have corrupted it somehow and need to download it again.  How do I do that when the App Store tells me it is already installed?

    Dah veed,
    I tried this but when I go to the purschases page, Pages in greyed out and still says "installed."  Any other suggestons?
    I can't find anywhere where another copy of Pages is installed.

  • How can I recover from the new Pages

    Does anyone know how I can recover a Pages file which has become locked into the new Pages program? I never edited it with the new Pages, but now I'm told I must have the new Pages to open it. I even tried opening it with the new Pages and converting it to PDF with the plan to copy and paste it into Pages '09, but i lost control of line spacing, etc. (It is a 4-column file of data on one page (in the '09 version, that is). Appreciate any help.

    Jay,
    Surely you did edit the file with Pages 5.2, or you wouldn't be having this problem. It's an easy mistake to make since both versions have exactly the same filename and extension. They are just stored in different folders. 5.2 is in Applications and 4.3 is in Applications/iWork '09.
    Use TimeMachine to locate a clean backup file.
    Jerry

  • When printing anything off the internet it shrinks the full page into one forth of the full page. How can i print using the enitre page?

    Every time I use firefox I can't print full pages off the internet. I will find the page I want, for example, map quest. I push the print button and my printer prints the entire page in one forth of the space. The entire page I printed can be found in the upper left hand corner of the full page, just shrunk down to a fourth of its size. How can i get a full page printed from the internet?
    == This happened ==
    Every time Firefox opened

    See this:
    [http://kb.mozillazine.org/Problems_printing_web_pages#Prints_to_a_small_portion_of_the_page]

  • How can I print only the first page of multiple PDF files at once in my PC?

    That is, without having to open each file individually.
    Thanks!

    Create an Action with the following JS command:
    this.print({bUI: false, nStart: 0});
    This will cause the first page of all the files you process with this Action to be sent to your default printer.
    If you need to specify more complex parameters, you'll need to use a more complex code...

  • With 2 tabs open, how can I go to the home page for the tab I'm on, instead of both home pages opening in new windows

    I have two tabs, each one set to a homepage. when I am browsing on one of the tabs, and want to go back to the homepage on that tab. when I hit the homepage icon, the home page opens on this tab, and the other homepage opens in a new tab, een though it's one on the first tab already. In IE, there's a drop down box which allows you to select a home page to open. is that available?
    thanks

    You can create two separate bookmarks on the Bookmarks Toolbar if you want to open those pages individually.
    See [[Bookmarks]]

  • How can I to dissapear the second page when I select a radio buttom YES or NO.

    I want the second page to disappears when I select radio buttom YES or NO.
    If I select YES, the second page continues, but if I press NO, the second page should dissapears, including the footer of the Master Page.
    Please let me know on how to do this, thank you!
    Alexander

    Thank you MTremblay-Savard, I will try to figured out the exact syntax for this one.
    I really appreciated your help!

  • How can I get past the activate page on ipod touch?

    I am trying to fix a ipod touch for an lady I know. she purchased this ipod for her 9 year old daughter and she set it up with her dad apparently using his email account. The daughter forgot her passcode so she wanted me to restore it which I did. Now I'm stuck at the activation page. After trying everything online I could find I called apple spport and spent 2 hours on the phone with them. After all this I was able to finally get logged into the dads apple id account which shows the daighters name and his email account that was used. Problem is that the 9 year old apparently set up the find my iphone setting and/or changed the apple id at some point to her [email protected] so when I get to the activation page it wants the apple id that the 9 year old used and she has forgotten it. If I try her dads email and id it says it cant be used to activate the ipod. I try to reset her password but the birthdate isn't going through and I've tried her real bday, her bday that she used on her facebook account, and her parents bday as well as several years up and down from it but can't get through. Any ideas on what can be done?

    Click here and try recovering the account information. If needed, phone Apple’s Account Security team.
    (113773)

  • How can I avoid using the new Pages

    For now I have chosen to forgo using the latest versions of Pages & Numbers and prefer thier predecessors. However the newer versions are  opened by default when downloading/clicking on DOC & XLS as well as .PAGES & .NUMBERS files. I know how to use the "Open With" command but I'd rather  avoid those extra steps. Can I either re-name or hide/move the new versions of these programs so they won't launch inadvertantly. I suppose I could delete them altogether and reacquire them later on. (Eventually I'll come around to using them but not now.)
    Best advice?
    Thank you.

    Bury the new apps 2 folders down.
    Peter

  • How can I get past the iTunes page that offers a free download of iTunes 10+ ?

    My iMac G5 doesn't have the Intel Processors and it operates on OS X 10.4.  Both conditions make it impossible for me to upgrade to iTunes 10.  Every time I attempt to log into the iTunes Store, I am given a page that offers me the opportunity to upgrade to iTunes 10+ and I'm not able to get beyond the page and in to the Store.  My account is current and I'm not happy with this strategy to make my perfectly good iMac obsolete and force me to buy a new one in order to access the iTunes Store.  I need a way to get beyond the page that offers the iTunes 10+ free download, so I can purchase the music I want.  Please help me get around this Apple ploy.
    Uncle Jim Serna

    Many of us don't like it but innovative Apple staying ahead of the curve means those of us on the other side quickly get ignored.  After all, who is it who is spending money on all that hardware and software; the people staying with the newest all the time, or those of us who haven't bought a computer or operating system in 5 years? It's a for-profit company so you can hardly blame them, though it doesn't endear me to the policy of not supporting anything older than 4 years or so.
    More in response to your specific issues, with a G5 you can upgrade to OSX 10.5 (which doesn't require Intel except for iCloud and related) which will allow you to run newer iTunes.  It's a bit of hassle and some cost.
    Alternatively think about buying from some other online retailer such as Amazon and don't forget to write Apple saying what you're doing.
    Edit:
    A comment on Niel's suggestion, I don't think anything less than iTunes 10 gives you access to the iTunes store.

  • If I expand a web page using Control +, how can I make sure the next page I go to on that site will also be in expanded mode, and the 1st page will still be in expanded mode when I come back to it? This is automatic in Chrome browser.

    Right now the pages always revert to small size. It's a hassle having to expand them every time to make them readable for my vision-impaired eyes.

    Try the [https://addons.mozilla.org/en-US/firefox/addon/2592/ NoSquint] add-on, it gives greater control over the zoom options.

  • How can I get past the wifi page during setup on iPad 2? I've tried hitting the next button but my screen is cracked and I can't press it

    I've tried pressing the next button but my iPad is cracked in that spot.

    I'd "get past" that problem by getting a new iPad!

Maybe you are looking for

  • How to maintain font appearance when opening a PDF?

    I have a single PDF which I need to import in to illustrator. The fonts used in the PDF are not available but I don't need to edit the text so hopefully no worries – I just need to add a reference number and export out to PDF again. The problem is th

  • While turning on iCloud the screen is stuck on the "turning on" screen...whats wrong

    i need help!

  • Help! My Lacie won't mount!

    Help! Help anybody out there can help. I have recently bought a LaCie 1TB Rikibi External HD. It has been great so far and I have filled it with approx. 700GB. I have two partitions, one with 10GB (Windows) and one with appr. 990GB Then a couple of w

  • Curly quotes that don't come through from Word

    Every now and then I get a Word file with a few quotes that come through to CS3 as accented characters instead of quotes. Anyone know why this happens? Download this zip file: http://www.pegtype.com/quotesdontwork.zip unzip it, and Place the Word fil

  • Missing libraries

    Installed 8.1.5 EE on Redhat 6.1. When I attempt to make the demos in $ORACLE_HOME/rdbms/demo, I get an error that libskgxpd.a cannot be built. Its not in $ORACLE_HOMOE/rdbms/lib, where it should be. Anyone seen/solved this? Thanks!