[jboss-user] [EJB 3.0] - Re: kindly help in running this deployment
karan42in
do-not-reply at jboss.com
Fri May 4 08:18:39 EDT 2007
hi fhh..
i m using jboss IDE 1.6, jboss server 4.0.5 and its running...
HelloBean.java
package hello;
public interface HelloBean
{
public String hello ();
}
StatelessHelloBean.java
package hello;
import org.jboss.annotation.ejb.LocalBinding;
import javax.ejb.*;
@Stateless
public class StatelessHelloBean implements HelloBean {
public String hello () {
return "Hello World!";
}
}
hello.jsp
<%@ page import="hello.*, javax.naming.*, java.text.*"%>
<%!
private HelloBean hb = null;
public void jspInit () {
try {
InitialContext ctx = new InitialContext();
hb = (HelloBean) ctx.lookup(
"HelloWorld/StatelessHelloBean/local");
} catch (Exception e) {
e.printStackTrace ();
}
}
%>
<%
String result;
try {
result = hb.hello();
} catch (Exception e) {
result = e.getMessage();
}
%>
<%=result%>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043168#4043168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043168
More information about the jboss-user
mailing list