This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes What is the use of jsp:useBean tag ?. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "What is the use of jsp:useBean tag ?." Watch "What is the use of jsp:useBean tag ?." New topic
Author

What is the use of jsp:useBean tag ?.

Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133
Could you please tell me what is the main purpose of <jsp:useBean> tag in the JSP page.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Here are some I can think of
  • Creating a new scoped attribute
  • Retrieving an existing scoped attribute
  • Setting request parameters values in a bean in one shot (jsp:setProperty with property="*")
  • Accessing bean properties (jsp:getProperty,jsp:setProperty)


  • [My Blog]
    All roads lead to JavaRanch
    Praveen Kumar
    Ranch Hand

    Joined: Nov 06, 2006
    Posts: 133
    Christophe Verre ,

    Thanks for reply.

    I think we can create/get/alter scope attributes of type java beans.
    We can get/set the properties of java beans at run time.
    where as page import directive gets the imported classes at
    translation time.
    Seetharaman Venkatasamy
    Ranch Hand

    Joined: Jan 28, 2008
    Posts: 5575

    also to discourage the scripting
    Christophe Verré
    Sheriff

    Joined: Nov 24, 2005
    Posts: 14688
        
      16

    also to discourage the scripting

    Yes, that's a good point. Forget about scripting in your JSP.
    Praveen Kumar
    Ranch Hand

    Joined: Nov 06, 2006
    Posts: 133
    Yes. This standard actions to get rid of the scripting the JSP pages.

    Thanks for replies.

    Please send if you any other reasons !!
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: What is the use of jsp:useBean tag ?.
     
    jQuery in Action, 3rd edition