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:

<faces-config version="1.2" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
    <managed-bean>
        <description>set up search
		</description>
        <managed-bean-name>jukeboxController</managed-bean-name>
        <managed-bean-class>jukebox.JukeboxController</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
        <from-view-id>/jukebox.jsp</from-view-id>
        <navigation-case>
            <description>set up a stupid string acting like a query</description>
            <from-outcome>success</from-outcome>
            <to-view-id>/searchResults.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>
</faces-config>

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


Description:



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

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

<%-- 
    Document   : jukebox
    Created on : Sep 2, 2009, 9:03:07 PM
    Author     : depot
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>





<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Jukebox Page</title>
        </head>
        <body>
            
            <h1><h:outputText value="Welcome to the Jukebox!"/></h1>
            <h:form id="searchForm">
                <h:panelGrid columns="5" >
                    <h:outputLabel for="searchTypeSelection" value="Select a type of search" />
                    <h:selectOneMenu id="searchTypeSelection"  title="select one option" value="#{jukeboxController.searchType}">
                        <f:selectItem id="select"  itemLabel="Select one" itemValue="" />
                        <f:selectItem id="song"  itemLabel="Song" itemValue="song"/>
                         <f:selectItem id="artist"  itemLabel="Artist" itemValue="artist"/>
                    </h:selectOneMenu>
                    <h:outputLabel for="searchStringTxt" value="Type the artist or song name"/>
                    <h:inputText id="searchStringTxt" required="true"  immediate="false" value="#{jukeboxController.searchString}" size="25">

                    </h:inputText>
                    <h:commandButton id="submitSearch" value="Search" action="#{jukeboxController.buildQuery}" />
                    
                </h:panelGrid>
            </h:form>

        </body>
        <br>
        <hr>
        <HR>
         <jsp:include page="footer.jsp" flush="true" />
    </html>
</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:

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.