how to get value which is set in bean on jsp

hi alli dont know how to get the value from java bean.I m setting the value in bean from the servlet and would like to print it on jsp using the get method but i m getting null value
[210 byte] By [devil_developera] at [2007-11-26 21:01:46]
# 1

hi,

In the servlet after setting the value in bean are you attaching the bean to any context like session,request etc? You need to attach the bean to session or request and then get the same in the jsp. In the jsp you can access this bean in two ways.. either by a scriptlet or use the <jsp:useBean> and <jsp:getProperty> tags.

When you use useBean see that you use the same instance name of bean you used in servlet be used here.. If you are using scriptlet you need to use getAttribute and the use appropriate getXXXX() method to get the data you need..

Hope this reply clears your doubt!

You can get the jsp tag reference from here.. this will be useful for you :)

http://java.sun.com/products/jsp/tags/11/tags11.html

-- Abdel Raoof Olakara

http://olakara.googlepages.com

Olakaraa at 2007-7-10 2:33:36 > top of Java-index,Desktop,Developing for the Desktop...
# 2
Try the following forum (about JSP technology) http://forum.java.sun.com/forum.jspa?forumID=45
UncleSAMa at 2007-7-10 2:33:37 > top of Java-index,Desktop,Developing for the Desktop...