Accessing EJB methods from JSP
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jay_j
Posted On:   Tuesday, February 26, 2002 11:28 AM

Hello everyone, I am testing a helloworld bean. Accessing it through JSP. I can call the method from JSP just fine if it has no parameters. But if the method takes parameters i get an error like this..... Generated servlet error: C:j2sdkee1.3 epository adbugwebhello\_0002findex_jsp.java:105: Undefined variable: Phone out.print( hello.sayHello(Name, Phone) ); ^ 1 error //method call from JSP String Name = request.getParameter("Name"); String Phone= request.getParameter("Phone"); / <%= hello.sayHello(Name, Phone)>    More>>

Hello everyone, I am testing a helloworld bean. Accessing it through JSP. I can call the

method from JSP just fine if it has no parameters. But if the method takes parameters i get an

error like this.....



Generated servlet error:
C:j2sdkee1.3
epository adbugwebhello\_0002findex_jsp.java:105: Undefined variable: Phone

out.print( hello.sayHello(Name, Phone) );

^
1 error






//method call from JSP


String Name = request.getParameter("Name");

String Phone= request.getParameter("Phone");

/ <%= hello.sayHello(Name, Phone)>




//Remote Interface

public String sayHello(String Name, String Phone) throws RemoteException;



//EJB itself

public String sayHello(String Name, String Phone) {

return "Your name is " +Name + "Your Phone is " +Phone;
}





Would anyone help please.Thanks in advance..Jay    <<Less

Re: Accessing EJB methods from JSP

Posted By:   moen_chishti  
Posted On:   Wednesday, May 15, 2002 03:51 AM

u have accessed ejb through jsp now can u send me the code i also want to do that and i dont have fine any help thanx

Re: Accessing EJB methods from JSP

Posted By:   Rohit_Gupta  
Posted On:   Sunday, March 3, 2002 12:01 PM

In JSP Typically expressions<%=...%> are used to display simple values of variables or return values by invoking a bean's getter methods
<%= fooVariable %>
<%= fooBean.getName() %>



take "hello.sayHello(Name, Phone)" into a String variable and then try to print it thru jsp scriplet <%=%>.

Re: Accessing EJB methods from JSP

Posted By:   li_fachun  
Posted On:   Wednesday, February 27, 2002 06:40 PM

it seems that this is an jsp compiling error, you had better check your jsp code again.
About | Sitemap | Contact