File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes exact diff.  or when to use :custom tags and useBeans. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "exact diff.  or when to use :custom tags and useBeans." Watch "exact diff.  or when to use :custom tags and useBeans." New topic
Author

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

Jay Nisha
Greenhorn

Joined: Jun 30, 2009
Posts: 24

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
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.
 
Threads others viewed
saving preselected drop down value
How to get JSP packed in WEB-INF/lib/*.jar file ?
Problem with some JSPs moving to tomcat 4.1.12
TLDs & custom Tags
useBeans
MyEclipse, The Clear Choice