Results 1 to 1 of 1
- 02-26-2011, 04:41 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
Problem to invoke webbeans from JSF page
Hi, i'm just getting started of using webbeans and i'm folowing the example from the book Apress Beginning JSF.2 APIs And JBoss Seam.
Is a basix exemple that just call a webbeans using the annotation @Named but for some reason my jsf page can't manage to access the webbeans.
I'd like to inform that i'm using jboss-5.0.1.GA, Ant 1.8.2 and webbeans-1.0.0.PREVIEW1, i have already installed the webbeans and also did the Ant update as recomended by the book to estabilich the connection between the jboss and webbeans as well as the configuration of the JBOSS.HOME in the beans.properties from the webbeans api.
On my stacktrace doesn't come up any error message but doesn't happen anything when i try to access the page. I did try to put a break point on the method getSubject on the class GreetingService but it doesn't stop
any sugestion would be great
This is my webbeans which i'm pretending to access:
package hello;
import javax.annotation.Named;
import javax.context.RequestScoped;
@Named("foo")
@RequestScoped
public class GreetingService {
public String getSubject() {
return "Gustavo Webbeans succeed!!!";
}
}
This is mu jsf page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Hello world!!!</title>
</head>
<body>
<f:view>
<h:form>
<hutputLabel value="Hello, lets give it a try"/>
<hutputLabel value="#{foo.subject}"/>
</h:form>
</f:view>
</body>
</html>
This is the configuration of my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlnssi="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_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Hello</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>FacesConfig</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FacesConfig</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>hello.GreetingService</listener-class>
</listener>
</web-app>
I'm not sure if really need to define this listener tag because when i take it off doesn't effect anything.
Many Thanks...
Similar Threads
-
Can an internet page invoke a local applet?
By Navigateur in forum Java AppletsReplies: 41Last Post: 09-04-2010, 03:38 AM -
Problem in JSP Page Designing
By vinothkumarrvk in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 03-10-2010, 06:16 AM -
Printing only one page problem
By AndreiDMS in forum Java 2DReplies: 0Last Post: 10-09-2009, 03:03 AM -
problem with calling jsp page
By R O C K Y in forum Advanced JavaReplies: 0Last Post: 04-02-2009, 09:07 PM -
How can i create an error page in jsp and invoke it ...?
By vrk in forum Java ServletReplies: 0Last Post: 02-16-2009, 08:05 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks