Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page directive imports have no effect on jsp:useBean?

 
JohnWilliam Fitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I am writing to confirm something that I THINK I understand, but can't find specifically stated in my study guide or the spec:

Packages imported with the page directive like this...

<%@ page import="presidents.*" %>

...have no effect on the jsp:useBean standard action. For example, if LyndonBJohnson is a class in the package presidents, I still cannot omit the package name in the class attibute of the jsp:useBean standard action.

Specifically, the following will not under ANY circumstances compile...

<jsp:useBean id="uebung" class="LyndonBJohnson" />

...the package must ALWAYS be included in the class attribute, right?

Or wrong?

Thanks,
John
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by JohnWilliam Fitz:
right?
Or wrong?


correct
 
Praveen Kumar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should mention fully qualified name at class attribute of the useBean tag.

page directives will execute at translation time where as standard actions will execute at runtime.


Here i have doubt. We can import the java beans at page directives itself right and if needed we can create instances in scriplets right.

why we need useBean tag ?.

please let me know.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Praveen Kumar:
we can create instances in scriplets right.


you should avoid the scriptlet,it is deprecated.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic