This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am new to JSF .... i have a problem ..... i have simple three pages index.jsp , input.jsp and greeting.jsp. I am forwarding to input.jsp from index.jsp. Because of <jsp:forward> url does not changes and controls goes to input.jsp.
Now problem is that when i click on the button in the input.jsp it does not work, If i access the input.jsp(input.faces) then it works fine.
If i dont want to disclose the input.jsp then how can i achieve this ?
While in JSF world we use rather the navigation concept. In faces-config.xml you can define the so called navigation rules that are responsible for application page flow. I.e. we have two jsps: index.jsp and about.jsp. Let's assume that inside index.jsp we have defined a <h:commandLink value="Go to about" action="about"/> component. Now in faces-config.xml we define
Thanks Marcin Majewski for your reply and giving me the so informative link about the navigation rules.
But my question is if i access a page while forwarding through another page then url is the first not the forwarded page. How this can be matched while url showing the index.faces?
In JSF, the URL isn't always pointing to the current page. That's because a URL is a resource locator. It is NOT a "file location".
In most systems, the URL does act like a "file locator" to some degree or other, but JSF uses an extensive postback mechanism so that doesn't work. You should consider the URL to be more of a "session handle" than an absolute indicate of which view resource is being displayed.
Customer surveys are for companies who didn't pay proper attention to begin with.
Ok. I assume that you're trying to define a default page that should appear after entering your application URL. There's a better solution than forwarding. You can define the following in your web.xml configuration file:
Hope it solves your problem with not calling the button action as well.