Use Bean
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Yufu_Huang
Posted On:   Saturday, April 20, 2002 10:45 AM

How to use Beans, which created in JSP page, in Servlets? Thanks.

Re: Use Bean

Posted By:   Bozidar_Dangubic  
Posted On:   Saturday, April 20, 2002 11:30 AM

JSP gets compiled into a servlet so overall you do it the same way. It all depends on the scope that you specify in the jsp:useBean. if the scope is session, the from the servlet you can access the bean via session.getAttribute("beanName"). if the scope is application, then you can access from context.getAttribute("beanName"). so it all depends on the scope but always remember that JSP gets compiled into a servlet so it is theoretically the same except that you do not have jsp:useBean in servlets.
About | Sitemap | Contact