aspose file tools*
The moose likes JSF and the fly likes hello world application not running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "hello world application not running" Watch "hello world application not running" New topic
Author

hello world application not running

gargi joshi
Greenhorn

Joined: May 29, 2013
Posts: 3
anyone please help.....its urgent................
my files are as follows
hello.java

package hello;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean(name="hello")
@ViewScoped
public class Hello {
final String world="Helllo World !";
public String getworld() {
return world;
}
}

web.xml
<?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_3_0.xsd" version="3.0">
<display-name></display-name>
<welcome-file-list>
<welcome-file>helloBean.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>

</web-app>

helloBean.xml
<?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"
xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
<head>
<title>My Facelets Page</title>

</head>
<body>


#{hello.world}


</body>
</html>

faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>

<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">

</faces-config>
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

Welcome to the JavaRanch, Joshi!

We have a series of FAQs that can help you use the Ranch more effectively (https://www.coderanch.com/how-to/java/HowToAskQuestionsOnJavaRanch). One of them concerns the futility of asking "urgent" questions. We're not paid to be here 24x7 (or at all, for that matter) so it can take quite a while for someone to show up and answer. This one is also worth noting:

One thing that probably we don't have in a FAQ is that our "Code" button in the message editor is very useful for taking preformatted code (and XML) and displaying it in a more readable way.

You didn't provide any details, but I think probably your error is that you don't have the JSF "f:view" elements defined for your View Template.


Customer surveys are for companies who didn't pay proper attention to begin with.
Aakash Saxena
Greenhorn

Joined: Nov 11, 2012
Posts: 13
Just in case, your code still ain't running , try following in your front end file :

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hello world application not running
 
Similar Threads
unable to run hello world application in my eclipse 10 using jsf 2.0
Unable to insert values in database
HTTP Status 404 error in tomcat
405 error for GET method and I have a doGet()
org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: