Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

class in jsp useBean

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
...
 
No, tomorrow we rule the world! With this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic