• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query regarding xhtml page run in JSF1.2

 
ujwwala tem
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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">

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

</code>

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
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ujwwala tem
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">

<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>FirstJSF2</title>
</h:head>

<h:body>

<h:form>
<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 />
</h:form>

</h:body>
</html>

</code>

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,

Thanks,
Ujwwala
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic