943,717 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 788
  • JSP RSS
Sep 8th, 2009
0

faces-config not working

Expand Post »

Topic
The topic of this question is: faces-config not working.


Hello and Thank you in advance for any assistance. ………………………………………………………………………………………………………………………………………………………………………………………………


System:



System info:netbeans6.7.1,jsf1.2


………………………………………………………………………………………………………………………………………………………………………………………………


Purpose:



The purpose of this post is: understand why the model.java and the controller.java are collecting data from my jukebox.jsp and the searchResults.jsp is capturing the results fine. But the commandButton is not redirecting the jukebox.jsp to the searchResults.jsp

………………………………………………………………………………………………………………………………………………………………………………………………


Functionality:



The functionality of this code is: I have a jukdbox.jsf that directly passes variables to the doSomething() of the controller.java and the controller returns “success”. Then the controller.java calls a method from the model object and it performs a routine using
The received param and returns the result.


………………………………………………………………………………………………………………………………………………………………………………………………


Question:



My question concerning this code is: The searchResult.jsp is able to get the results from the model.java so the controller should be returning a string “success” but the jukebox.jsf(input data from client) is not being redirected to the searchResults.jsf.

………………………………………………………………………………………………………………………………………………………………………………………………



errors:



The errors related to this code are:

………………………………………………………………………………………………………………………………………………………………………………………………


Description:faces-config



Code description:

JSP Syntax (Toggle Plain Text)
  1. <faces-config version="1.2"
  2. xmlns="http://java.sun.com/xml/ns/javaee"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
  5. <managed-bean>
  6. <description>set up search
  7. </description>
  8. <managed-bean-name>jukeboxController</managed-bean-name>
  9. <managed-bean-class>jukebox.JukeboxController</managed-bean-class>
  10. <managed-bean-scope>session</managed-bean-scope>
  11. </managed-bean>
  12. <navigation-rule>
  13. <from-view-id>/jukebox.jsp</from-view-id>
  14. <navigation-case>
  15. <description>set up a stupid string acting like a query</description>
  16. <from-outcome>success</from-outcome>
  17. <to-view-id>/searchResults.jsp</to-view-id>
  18. </navigation-case>
  19. </navigation-rule>
  20. </faces-config>

………………………………………………………………………………………………………………………………………………………………………………………………


Description:



Code Description: jukebox.jsp (the form to be submitted)

………………………………………………………………………………………………………………………………………………………………………………………………
JSP Syntax (Toggle Plain Text)
  1. <%--
  2. Document : jukebox
  3. Created on : Sep 2, 2009, 9:03:07 PM
  4. Author : depot
  5. --%>
  6.  
  7. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  8.  
  9. <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
  10. <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
  11.  
  12.  
  13.  
  14.  
  15.  
  16. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  17. "http://www.w3.org/TR/html4/loose.dtd">
  18.  
  19. <f:view>
  20. <html>
  21. <head>
  22. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  23. <title>Jukebox Page</title>
  24. </head>
  25. <body>
  26.  
  27. <h1><h:outputText value="Welcome to the Jukebox!"/></h1>
  28. <h:form id="searchForm">
  29. <h:panelGrid columns="5" >
  30. <h:outputLabel for="searchTypeSelection" value="Select a type of search" />
  31. <h:selectOneMenu id="searchTypeSelection" title="select one option" value="#{jukeboxController.searchType}">
  32. <f:selectItem id="select" itemLabel="Select one" itemValue="" />
  33. <f:selectItem id="song" itemLabel="Song" itemValue="song"/>
  34. <f:selectItem id="artist" itemLabel="Artist" itemValue="artist"/>
  35. </h:selectOneMenu>
  36. <h:outputLabel for="searchStringTxt" value="Type the artist or song name"/>
  37. <h:inputText id="searchStringTxt" required="true" immediate="false" value="#{jukeboxController.searchString}" size="25">
  38.  
  39. </h:inputText>
  40. <h:commandButton id="submitSearch" value="Search" action="#{jukeboxController.buildQuery}" />
  41.  
  42. </h:panelGrid>
  43. </h:form>
  44.  
  45. </body>
  46. <br>
  47. <hr>
  48. <HR>
  49. <jsp:include page="footer.jsp" flush="true" />
  50. </html>
  51. </f:view>
………………………………………………………………………………………………………………………………………………………………………………………………

Thanks again.
-ceyesuma

………………………………………………………………………………………………………………………………………………………………………………………………


Note:



Note: if needed please find attached the jukebox.zip program

………………………………………………………………………………………………………………………………………………………………………………………………
all my web pages are in the Web Pages folder provided when creating the project in netbeans.

………………………………………………………………………………………………………………………………………………………………………………………………


Description:



Code Description:

JSP Syntax (Toggle Plain Text)
  1.  
………………………………………………………………………………………………………………………………………………………………………………………………
Attached Files
File Type: zip jukebox.zip (39.5 KB, 10 views)
Similar Threads
Reputation Points: 7
Solved Threads: 2
Posting Pro
ceyesuma is offline Offline
524 posts
since Aug 2007
Sep 9th, 2009
0

Re: faces-config not working

I was reading the database tutorial and I noticed the use of a servlet and I realized that my JukeboxController is a managed bean. Is this why I am not getting the redirect to the results page?

any way the tutorial provides a really good example to work on.
Reputation Points: 7
Solved Threads: 2
Posting Pro
ceyesuma is offline Offline
524 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: IE 7 wont delete record however FF does
Next Thread in JSP Forum Timeline: java.lang.ClassNotFoundException: sun:jdbc:odbc:JdbcOdbcDriver





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC