wood burning stoves 2.0
The moose likes JSF and the fly likes Query regarding xhtml page run in JSF1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Query regarding xhtml page run in JSF1.2" Watch "Query regarding xhtml page run in JSF1.2" New topic

Query regarding xhtml page run in JSF1.2

ujwwala tem
Ranch Hand

Joined: Feb 10, 2010
Posts: 87

I created a simple jsf application ,I am trying to run .xhtml file without bean,
<code>My xtml file is

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets">

<title>Insert title here</title>
<f:view contentType="text/html">
<hutputText value="Hello World"></hutputText>


and I want to know what can be the navigation rule for this for the same page and I am trying to run it but its asking do you want to open or save the file,

Please reply
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

There is no navigation rule for that page because you have no form or associated action that would trigger and direct navigation.

If you get a "open or save file" dialog, it usually means that you didn't set up your WEB-INF/web.xml file to direct JSF requests to the FacesServlet OR that you are requesting the View by its Resource path (xxx.xhtml) when you should be requesting the view by its URL (xxx.jsf)

Your code tags didn't work. We handle them by a non-HTML processor and their delimiters are square bracket characters, not the angle brackets that HTML uses.

An IDE is no substitute for an Intelligent Developer.
ujwwala tem
Ranch Hand

Joined: Feb 10, 2010
Posts: 87
Thanks for the reply but still its not working,

When I am doing as http://localhost:8080/jsf2/faces/index.xhtml

Now the error is as:Caused by:
java.lang.NullPointerException - context
java.lang.NullPointerException: context
at javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:862)
at javax.faces.component.UIComponentBase.getRendersChildren(UIComponentBase.java:350)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:248)

My Index.xhtml is <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"

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


<hutputLabel for="input" value="Enter your name: " />
<h:inputText id="input" value="#{helloMessageBean.name}" required="true" />
<br />
<br />
<h:commandButton value="Go" action="#{welcomeBean.sayHello}" />
<h:messages />



The project works fine with .jsp but not working with .xhml,

Also I wanted to know basically how to create .xhtml pages in eclipse juno, I copied from google sample page and given .xhtml page but there is not showing properties ctrl_space in tags its saying no default propsal,

Please Reply,

I agree. Here's the link: http://aspose.com/file-tools
subject: Query regarding xhtml page run in JSF1.2
It's not a secret anymore!