• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between useBean and importing java classes  RSS feed

 
kiru vembai
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to know the difference between importing a java classe thru Import Statement and using a UseBean tag..
Is there any point of Translation and Request processing time..
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for example:
<jsp:useBean id='someId' class='SomeClass'/>
will be translated to this code in servlet enviroment:

You can do the same in jsp using scriptlets but if you use a bean you can make use of beans instrospection for example:
you don't need to create a <jsp:setProperty to each property in the bean,
if you use <jsp:setProperty name='someId' property='*'/> you will set all the properties to the values indicated by the user in a form for example...
its easier than writing a someBean.setProperty(request.getParameter('x'))...

hope it helps!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!