This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Succeeding with AI and have Veljko Krunic on-line!
See this thread for details.
Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Question Bank ID : 31

 
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...
 
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
 
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".
 
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.
 
You can't have everything. Where would you put it?
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic