Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Reply
 
LinkBack Thread Tools Display Modes
Old 24-08-2010, 11:56 AM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2010
Posts: 14
Default JSF problem


Following facelet page is not rendering properly in the browser

Code:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html">
    <h:head>
        <title>Create a New Book</title>
    </h:head>
    <h:body>
        <h4>Create a new Book</h4>
        <br/>
        <h:form>
            <table>
                <tr>
                    <td><h:outputLabel value="ISBN: " ></h:outputLabel></td>
                    <td><h:inputText value="#{bookController.book.isbn}"></h:inputText></td>
                </tr>
                <tr>
                    <td><h:outputLabel value="Title " /></td>
                    <td><h:inputText value="#{bookController.book.title}"/></td>
                </tr>
                <tr>
                    <td><h:outputLabel value="Price: " /></td>
                    <td><h:inputText value="#{bookController.book.price}"/></td>
                </tr>
                <tr>
                    <td><h:outputLabel value="Descriptiom: " /></td>
                    <td><h:inputTextarea value="#{bookController.book.description}" cols="20" rows="5"/></td>
                </tr>

                <tr>
                    <td><h:outputLabel value="Number Of Pages: " /></td>
                    <td><h:inputText value="#{bookController.book.nbofpages}"/></td>
                </tr>

                <tr>
                    <td><h:outputLabel value="Illustrations: " /></td>
                    <td><h:selectBooleanCheckbox value="#{bookController.book.illustration}"/></td>
                </tr>
            </table>
            <h:commandButton action="#{bookController.doCreateBook}" value="Create a Book" />
        </h:form>
    </h:body>
</html>
It is only showing "Create new book" and nothing else.
What is the problem with the code?
silverlight4 is offline   Reply With Quote
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 24-08-2010, 12:39 PM   #2 (permalink)
Excessive happiness
 
furious_gamer's Avatar
 
Join Date: Jun 2008
Location: Bangalore
Posts: 2,974
Default Re: JSF problem

You must use
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

this to import the taglib. Otherwise how did the page does know what

is h:form?
__________________
My First Android phone : Samsung Galaxy SL i9003 - Rooted & Gingerbread XXKPQ
Updated : superteekz_V2 ROM for XXKPQ.

PS Request
furious_gamer is offline   Reply With Quote
Old 24-08-2010, 12:49 PM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2010
Posts: 14
Default Re: JSF problem

It is giving this error
XML Parsing Error: not well-formed
Code:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-^
It is an xhtml document
silverlight4 is offline   Reply With Quote
Old 24-08-2010, 01:57 PM   #4 (permalink)
Excessive happiness
 
furious_gamer's Avatar
 
Join Date: Jun 2008
Location: Bangalore
Posts: 2,974
Default Re: JSF problem

Quote:
Originally Posted by silverlight4 View Post
It is giving this error
XML Parsing Error: not well-formed
Code:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
-^
It is an xhtml document
What kinda mapping you did for your JSP pages?
__________________
My First Android phone : Samsung Galaxy SL i9003 - Rooted & Gingerbread XXKPQ
Updated : superteekz_V2 ROM for XXKPQ.

PS Request
furious_gamer is offline   Reply With Quote
Old 24-08-2010, 06:42 PM   #5 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2010
Posts: 14
Default Re: JSF problem

Thanks @rajkumar_pb
Its now solved.
There was a problem with the mapping in web.xml
silverlight4 is offline   Reply With Quote
Old 25-08-2010, 01:17 PM   #6 (permalink)
Excessive happiness
 
furious_gamer's Avatar
 
Join Date: Jun 2008
Location: Bangalore
Posts: 2,974
Default Re: JSF problem

^^

If you tell us what was the problem, it will help someone else.
__________________
My First Android phone : Samsung Galaxy SL i9003 - Rooted & Gingerbread XXKPQ
Updated : superteekz_V2 ROM for XXKPQ.

PS Request
furious_gamer is offline   Reply With Quote
Old 25-08-2010, 04:02 PM   #7 (permalink)
Right Off the Assembly Line
 
Join Date: Jul 2010
Posts: 14
Default Re: JSF problem

In web.xml mapping was for /faces/*
but i was directly hitting the facelet page using /newBook.xhtml instead of
/faces/newBook.xhtml
silverlight4 is offline   Reply With Quote
Old 26-08-2010, 10:48 AM   #8 (permalink)
Excessive happiness
 
furious_gamer's Avatar
 
Join Date: Jun 2008
Location: Bangalore
Posts: 2,974
Default Re: JSF problem

^^

thats really a careless mistake . Anyway thanks for sharing.
__________________
My First Android phone : Samsung Galaxy SL i9003 - Rooted & Gingerbread XXKPQ
Updated : superteekz_V2 ROM for XXKPQ.

PS Request
furious_gamer is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dell Studio 15 Display Inverter and DVD Writer Problem windchimes Hardware Q&A 2 24-05-2010 12:48 AM
Ubuntu 10.04 "Low Graphics Mode" problem after update krishnandu.sarkar Open Source 6 23-05-2010 05:35 AM
problem with 16GB Cruzer micro rohit330 Hardware Q&A 3 16-05-2010 08:59 PM
Problem in Copy/cut paste bhavik Software Q&A 2 15-05-2010 10:52 AM
Display problem - corruption, lines, video blinking g_goyal2000 Hardware Q&A 5 05-04-2010 05:40 AM

 
Latest Threads
- by Charan
- by Charan
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2