[jboss-user] [Beginner's Corner] - Servlet call to EJB3 Session Bean

RS Prasad do-not-reply at jboss.com
Tue May 10 10:09:49 EDT 2011


RS Prasad [http://community.jboss.org/people/rsprasad] modified the document:

"Servlet call to EJB3 Session Bean"

To view the document, visit: http://community.jboss.org/docs/DOC-16788

--------------------------------------------------------------
Hi,

This article is about a *Servlet call to injected EJB3 Session Bean*.
The application in attachment works fine with JBoss-5.1.0.GA_JDK6/ JDK1.6.0_21

The application can be reached at  http://<IPAddress>:8080/servletejb3 http://<IPAddress>:8080/servletejb3
welcome file is a jsp file, which submits a form with user input to the servlet.
The Servlet calls the session bean which returns a value in uppercase 
which is reloaded into the textbox in the same JSP.

*Schema of web.xml:*

<web-app version="2.5"
xmlns=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

*Schema of ejb-jar.xml:*

<ejb-jar xmlns=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee" 
         xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee  http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
         version="3.0">

*Schema of application.xml:*

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee" 
             xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee  http://java.sun.com/xml/ns/javaee/application_5.xsd http://java.sun.com/xml/ns/javaee/application_5.xsd"
             version="5">

Extract the attachment and run ant deploy after modifying the script 
to point to your environment's jboss home.

As I came across somewhere: Fire up the JBoss and pull up the app.

Thanks


Saravana Prasad
--------------------------------------------------------------

Comment by going to Community
[http://community.jboss.org/docs/DOC-16788]

Create a new document in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2075]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110510/ab4e3be1/attachment-0001.html 


More information about the jboss-user mailing list