Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the use of jsp:useBean tag ?.

 
Praveen Kumar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please tell me what is the main purpose of <jsp:useBean> tag in the JSP page.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)

  •  
    Praveen Kumar
    Ranch Hand
    Posts: 133
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 5575
    Eclipse IDE Java Windows XP
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    also to discourage the scripting
     
    Christophe Verré
    Sheriff
    Posts: 14691
    16
    Eclipse IDE Ubuntu VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    also to discourage the scripting

    Yes, that's a good point. Forget about scripting in your JSP.
     
    Praveen Kumar
    Ranch Hand
    Posts: 133
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes. This standard actions to get rid of the scripting the JSP pages.

    Thanks for replies.

    Please send if you any other reasons !!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic