tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael J. McCormac" <m...@xtinct.net>
Subject RE: Strange javabean problem
Date Fri, 22 Feb 2002 03:44:59 GMT
> Hi Folks,
> 
> I'm using Tomcat 4.01 with Jbuilder 6.  I've got a strange problem.  
> It seems that if I try to dump data from a Java bean using the
> <jsp:getProperty> tag I don't get the data.  However, if I reference 
> the value of the bean directly in a scriptlet it works fine.

greetings all,

i am having pretty much the same problem, but the implementation is a
little bit different.  i tried using an rmi process to retrieve the bean
directly from the JSP like so:

<jsp:useBean id='myBean' class='beans.MyClass' />
<%
	rmiInt rmiServer = (rmiInt)Naming.lookup( "//server/service" );
	myBean = (MyClass)rmiServer.getBean();
%>
<jsp:getProperty name='myBean' property='lastName' />  <- doesn't work!

one way i've managed to work around the problem was by creating and
loading the beans in a servlet first, throwing the beans in the session
object, then redirecting to the JSP file where i could pull them back
out of the session like this:

<jsp:useBean id='myBean' class='beans.MyClass' />
<% session.getAttribute( "mybean" ); %>
<jsp:getProperty name='myBean' property='lastName' /> <- works ok!!

but i don't like this solution...  it's inelegant ;)

thanks,
mike


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message