wood burning stoves
The moose likes JSF and the fly likes App doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "App doesn Watch "App doesn New topic

App doesn't work

Sunny Greenhorn

Joined: Feb 02, 2009
Posts: 6
Not sure why this doesn't work, a basic simple setup thought, trying to have it run on Tomcat6 with JSF 2.0 jars. Any clues please ???

web.xml (under WEB-INF folder)
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<servlet-name>Faces Servlet</servlet-name>
<servlet-name>Faces Servlet</servlet-name>

faces-config.xml (under WEB-INF folder)
<?xml version="1.0" encoding="UTF-8"?>

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"


index.xhtml (under WebContent folder)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml"

messages.properties (under src, my package)
title=Hello There!

No deployment errors and no issues with folder structures...
just URL doesn't respond:http://localhost:8080/T2/faces/index.xyz
http://localhost:8080/T2/faces/index.xhtml - gives the XHTML as is dump.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Welcome to the JavaRanch, Sanath!

There's a "Code" button on the Ranch message editor. You can also use it with XML. It keeps the message formatter from taking liberties with your formatted text.

You need to establish a mapping between "*.xhtml" and JSF in your web.xml file. Something like:

You also probably need to configure Facelets in web.xml as well.

Without that mapping information, the webapp container won't route your URL to the FacesServlet and the FacesServlet won't decode it properly.

An IDE is no substitute for an Intelligent Developer.
Sunny Greenhorn

Joined: Feb 02, 2009
Posts: 6
Thanks, still the same issue, when I run it, I just see #{msgs.title} in the source (as-is xhtml) and empty in browser window.
another issue it seems that if we give same .xhtml extension for URL mapping is eating away stack, not sure how, but I have other app (quiz program demo)
that works fine....so scary ! where am I doing wrong (I hope so :-) )
Sunny Greenhorn

Joined: Feb 02, 2009
Posts: 6
Directory structure is here

[Thumbnail for DIR_STRU.PNG]

Sunny Greenhorn

Joined: Feb 02, 2009
Posts: 6
response status is as shown...

[Thumbnail for outputs_scr.PNG]

Sunny Greenhorn

Joined: Feb 02, 2009
Posts: 6
This is quite similar to the QuizProgram demo that comes with mojarra-2.0.4-FCS, not able to figure out where is the issue.
any thoughts anyone!
Sunny Greenhorn

Joined: Feb 02, 2009
Posts: 6
Found the thorn atlast ! Issue with faces-config.xml file and the error is in here

where as this is supposed to be

This ofcourse makes huge difference...
if 1.2 is used, resource bundles and beans wont come up and when servlet url mapping and DEFAULT_SUFIX matches, it runs out of stack, like infinite loop.
with 2.0, these are resolved.

Thanks for all, Again, thanks for warm welcome Tim.
I agree. Here's the link: http://aspose.com/file-tools
subject: App doesn't work
jQuery in Action, 3rd edition