MyEclipse Enterprise Workbench
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of JBoss AS 5 Development this week in the JBoss forum
or Spring Dynamic Modules in Action in the Spring forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JSP
 
RSS feed
 
New topic
Author

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

Lovely Manu
Greenhorn

Joined: Jun 30, 2009
Messages: 4


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
Messages: 167

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".)
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JSP
 
RSS feed
 
New topic
MyEclipse Enterprise Workbench