Bookmark Topic Watch Topic
  • New Topic

unable to run hello world application in my eclipse 10 using jsf 2.0  RSS feed

 
gargi joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
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>
 
gargi joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
hey anyone.................please help.....its urgent........................and thanks in advance


 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question in multiple forums. Since this is a JSF question, I have locked this message. Look for responses in the JSF forum.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!