Beans as parameters ?
843836Sep 24 2004 — edited Sep 24 2004Hi 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 !