| Author |
form address inverse
|
tuntun zaw
Greenhorn
Joined: Oct 23, 2007
Posts: 4
|
|
Address inverse My welcome file is welcome.faces redirected by index.html. When browser load welcome.faces, address bar show like �http://localhost/logo/welcome.faces�.When click the command buttom after filling text box, browser load success.faces. But address bar show �http://localhost/logo/welcome.faces�. When click command buttom in success.faces, browser load welcome.faces. But address bar show �http://localhost/logo/success.faces�. At this time, when click the command buttom in welcome.faces without no change in text box, address bar change from �http://localhost/logo/success.faces� to �http://localhost/logo/welcome.faces�.But form have no change.What is wrong? My web service directory is apache tomcat. Give me correct flow and why? My email address is tunzaw2008@gmail.com. Here is my code. web.xml. <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index.html</welcome-file> </welcome-file-list> welcome.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <html> <head> <title>Hello Welcome</title> </head> <body> <f:view> <h:form id="inputname"> <p> <h utputText value="Enter name:"/> </p> <h:inputText value="#{namebean.username}" required="true"> </h:inputText> <h:commandButton value="Submit" action="success"/> </h:form> </f:view> </body> </html> success.jsp <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <html> <head> <title>Successful</title> </head> <body> <f:view> <h:form id="Successful"> <p> <h utputText value="Hi "/> <h utputText value="#{namebean.username}"/> </p> <h:commandButton value="Submit" action="welcome"/> </h:form> </f:view> </body> </html> namebean.java package jsfclasses; public class namebean{ private String username; private String r; public void setUsername(String name){ this.username=name; } public String getUsername(){ return username; } } faces-config.xml <navigation-rule> <from-view-id>/welcome.jsp</from-view-id> <navigation-case> <from-outcome>success</from-outcome> <to-view-id>/success.jsp</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>/success.jsp</from-view-id> <navigation-case> <from-outcome>welcome</from-outcome> <to-view-id>/welcome.jsp</to-view-id> </navigation-case> </navigation-rule> <managed-bean> <managed-bean-name>namebean</managed-bean-name> <managed-bean-class>jsfclasses.namebean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean>
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
A lot of people don't like the fact that the displayed URL in a JSF application doesn't track the actual pages. All JSF cares about is that the displayed page contains enough hidden information to keep the conversation flowing. Actually, this is mostly a problem when you try and bookmark a page, since the context won't be there if you jump direct. People have been working on this.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: form address inverse
|
|
|