Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Beans as parameters ?

843836Sep 24 2004 — edited Sep 24 2004
Hi all.

I'm just learning JSPs (already fairly proficient with Java), and I have a question.

"Can I pass a bean instance as a parameter to another class ?"


I've already got a bean that takes html form input perfectly.

What i would like is to have another class that takes the bean as a parameter and does something based on the bean's state.

eg:
<jsp:useBean id="var" class="my.Bean" scope="session" />
<jsp:setProperty name="var" property="*" />
...
<%
SomeOtherClass o = new SomeOtherClass();
out.println( o.someMethod(var) );
%>

Where SomeOtherClass has a public String someMethod(my.Bean b) method.

Tomcat 5.0.28 gives me a java.lang.NoSuchMethodError exception (I know my class is on the path and should have the required method.)

Thanks for any help !
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 22 2004
Added on Sep 24 2004
5 comments
294 views