tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kenneth.baltz" <kenneth.ba...@inforonics.com>
Subject RE: Quick Bean Example
Date Tue, 04 Apr 2000 12:15:16 GMT

In a servlet:

 MyBean mb = new MyBean();

 req.setAttribute( "my_bean", mb );
 ServletContext sc = getServletContext();
 RequestDispatcher rd = sc.getRequestDispatcher( "some.jsp" );
 rd.forward( req, res );


Then, in some.jsp:

<%
  MyBean mb = (MyBean) request.getAttribute( "my_bean" );
%>


> -----Original Message-----
> From: Chris Bruce [mailto:chrisabruce@yahoo.com]
> Sent: Monday, April 03, 2000 9:36 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Quick Bean Example
> 
> 
> Can someone give me a quick example of how to pass a bean to 
> a jsp page
> from a servlet?  Any help or info would be appreciated.
> 
> 
> Thanks,
> 
> Chris Bruce
> 
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
> 
> --------------------------------------------------------------
> ------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
> 

Mime
View raw message