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.
An IDE is no substitute for an Intelligent Developer.
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.