-
1. Re: kindly help in running this deployment
fhh May 4, 2007 6:52 AM (in response to karan42in)Is your app server running under Java 5?
Regards
Felix -
2. Re: kindly help in running this deployment
karan42in May 4, 2007 8:18 AM (in response to karan42in)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%>