• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

class in jsp useBean

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why does the import attribute of page directive does not work for <jsp:useBean>

I was importing a class using

<%@ page import = "beans.Person" %>

so I guessed i'd only have to do

<jsp:useBean id="person" class="Person" scope="request" />

but it gave me an error. I had to use the fully qualified name in the class property of <jsp:useBean> tag

<jsp:useBean id="person" class="beans.Person" scope="request" />

Why doesn't the page directive work here?
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That comes from jsp spec.
for <jsp:useBean>, class and type must be fully qualified path .

i.e class="package.class" | type="package.class"
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP v2.0 Spec Pg. 1-104, Table JSP.5-1
...
Class
The fully qualified name of the class that defines the implementation of the object.The class name is case sensitive.
...
 
reply
    Bookmark Topic Watch Topic
  • New Topic