Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSF
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
JSF
action is not going to facesconfig.xml from login page
Babu kalagara
Greenhorn
Posts: 14
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi All,
I have a login page with text box and command buttton. After clicking the button it is not navigating to the page which I wanted.I would appreciate if you have any answers fore this problem
code in jsp looks like this: <HTML> <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <f:view> <HEAD> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <META name="GENERATOR" content="IBM WebSphere Studio"> <META http-equiv="Content-Style-Type" content="text/css"> <LINK href="theme/Master.css" rel="stylesheet" type="text/css"> <TITLE>index.jsp</TITLE> </HEAD> <BODY> <P> Name: <h:inputText id="name" value="#{user.name}" /> <h:commandButton value="login" action="login" /> </P> </BODY> </f:view> </HTML>
<faces-config> <lifecycle> <phase-listener>com.ibm.faces.webapp.ValueResourcePhaseListener</phase-listener> </lifecycle> <managed-bean> <managed-bean-name>user</managed-bean-name> <managed-bean-class>com.corejsf.UserBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <navigation-rule> <from-view-id>/index.jsp</from-view-id> <navigation-case> <from-outcome>login</from-outcome> <to-view-id>/welcome.jsp</to-view-id> </navigation-case> </navigation-rule> </faces-config>
<web-app id="WebApp"> <display-name>Jsf</display-name> <listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> </servlet> <servlet> <servlet-name>JS Resource Servlet</servlet-name> <servlet-class>com.ibm.faces.webapp.JSResourceServlet</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> <servlet-mapping> <servlet-name>JS Resource Servlet</servlet-name> <url-pattern>/.ibmjsfres/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app>
public class UserBean { private String name; public String getName(){ return name; } public void setName (String newValue){ name= newValue; } }
Thank you,
Babu
Eugene Abarquez
Ranch Hand
Posts: 211
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I suggest you use method binding. Like so:
In your bean add thius method:
public
String
clickSearch(){
}
There's so much to learn in this industry, and not everybody has the necessary interest.
Eugene Abarquez
Ranch Hand
Posts: 211
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I suggest you use method binding. Like so:
In your bean add this method:
public String clickSearch(){ return "login"; }
Then modify your faces-config.xml to bind the method you just added:
<navigation-rule> <from-view-id>/index.jsp</from-view-id> <navigation-case> <from-action>#{user.clickSearch}</from-action> <from-outcome>login</from-outcome> <to-view-id>/welcome.jsp</to-view-id> </navigation-case> </navigation-rule>
In your
jsp
page, change the commandButton:
<h:commandButton value="login" action="#{search.clickSearch}" />
There's so much to learn in this industry, and not everybody has the necessary interest.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
java.lang.IllegalStateException: using sendRedirect()
JSF Navigation Issue
JSF Spring integration
Problems with running JSF in Eclipse 3.1
JSF Implementation Problems: executePhase(RENDER_RESPONSE
More...