• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Query regarding xhtml page run in JSF1.2

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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">
<h:outputText value="Hello World"></h:outputText>
</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
 
Saloon Keeper
Posts: 24207
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
<h:outputLabel 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
 
I am going to test your electrical conductivity with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic