Mike Quin [
http://community.jboss.org/people/sanfran0201] created the discussion
"setting up JBoss with SEAM"
To view the discussion, visit:
http://community.jboss.org/message/599941#599941
--------------------------------------------------------------
Hi,
I have a very simple SEAM example (shown below) that is not working.
I'm very new to JBoss and hibernate and SEAM and all that stuff. I have been reading
http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/
http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/
I don't want to run seam-gen on my jboss-5.1.0. I just need a simple and
straightforward instructions on how to setup jboss 5.1 with SEAM and to run this extremely
simple helloworld example. However if seam-gen is absolutely required (which sounds
irrational), then please confirm and I'll use it.
Any help is appreciated.
Thank you
Mike
I'm deploying org.jboss.seam-jboss-seam-2.1.0.SP1.jar inside my ear.
I have also attached the server.log file if that would help.
public class InjectionServlet extends HttpServlet {
* @In(value=InjectableComponent.NAME, create = true, required = true)*
* private InjectableComponent injectableComponent;*
public void service(HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Hello World Seam Servlet!</title>");
out.println("</head>");
out.println("<body>");
if (injectableComponent == null) {
out.println("Injection not working.");
} else {
out.println(injectableComponent.getTitle());
}
out.println("</body>");
out.println("</html>");
}
}
package com.example.bean;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
*@Name("injectableComponent")*
*(a)Scope(ScopeType.EVENT)*
public class InjectableComponent {
public static final String NAME = "injectableComponent";
public InjectableComponent() {
}
@Create
public void init() {
System.out.println("Good Morning.");
}
public String getTitle() {
return "Hello World.";
}
}
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.5"
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-app_2_5.xsd">
<!-- Seam -->
* <listener>*
*
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>*
* </listener>*
<servlet>
<servlet-name>InjectionServlet</servlet-name>
<servlet-class>com.example.ui.InjectionServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>InjectionServlet</servlet-name>
<url-pattern>/ioc</url-pattern>
</servlet-mapping>
</web-app>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE application PUBLIC
"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>EJB3</display-name>
<module>
<ejb>Simple-server.jar</ejb>
</module>
<module>
<web>
<web-uri>Simple-web.war</web-uri>
<context-root>/seam</context-root>
</web>
</module>
</application>
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/599941#599941]
Start a new discussion in Beginner's Corner at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]