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

Question Bank ID : 31

 
mocca az
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct answer is
<jsp:useBean name="People" class="People"/>
I am looking in the jsp1.2 syntax card under <jsp:useBean> and i don't see name. There is beanName but not name.
Also, according to the syntax card id="" is requred in <jsp:useBean>?
I have also read somewhere that beanName (name) and class="" can't be together in the same <jsp:useBean> tag.
Can someone care to elaborate on this...
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was incorrect syntax and has been corrected.
Thank you!
Any others
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An interesting finding: Check out William Brogden's post at http://www.javaranch.com/ubb/Forum7/HTML/006099.html .
It implies that the value of the class attribute in a <jsp:useBean> call must include a package name, e.g. class="com.javaranch.People".
 
Tim Duncan
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Miftah Khan:
An interesting finding: Check out William Brogden's post at http://www.javaranch.com/ubb/Forum7/HTML/006099.html .
It implies that the value of the class attribute in a <jsp:useBean> call must include a package name, e.g. class="com.javaranch.People".


Actually this depends on your server. Some servers compile JSPs compile into the default package, and so don't need the import statement. Tomcat doesn't compile JSPs into the default package, so you need to put your classes in a package and specify it.
Even if your server compiles to the default package you should specify a package for your own classes, to retain portability.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic