• Post Reply Bookmark Topic Watch Topic
  • New Topic

exact diff. or when to use :custom tags and useBeans.

 
Jay Nisha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What is the exact difference between the custom tags and useBeans in jsp? when to use custom tags and when to use useBeans?
 
Max Rahder
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manisha Khatal wrote: What is the exact difference between the custom tags and useBeans in jsp? when to use custom tags and when to use useBeans?


That's a long story. What are you trying to do? My guess is that you'll never need to use <jsp:useBean.../>. That tag was created as part of the first release of JSPs. At that time, even though there was a framework for creating custom tags, there weren't any libraries out there yet. So Sun had to provide some basic functionality.

After JSTL, many of these <jsp:.../> tags became obsolete.

Normally, you're in a MVC framework, such as Struts, and the controller fetches or updates your model, then places objects in scope (using the request, session or application). Your view -- the JSP page -- then displays that information to the user. The easiest way to display those values is using JSTL, such as <h1>${myobject.name}</h1>. (This example runs "getName()" on an object placed in scope with the name "myobject".)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!