exact diff. or when to use :custom tags and useBeans.
Jay Nisha
Greenhorn
Joined: Jun 30, 2009
Posts: 24
posted
0
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
Joined: Nov 06, 2000
Posts: 177
posted
0
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".)
subject: exact diff. or when to use :custom tags and useBeans.