• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt using the useBean tag  RSS feed

 
Pradeep Kumar
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I coded the <jsp:useBean> tag with class attribute pointing to a class name which is placed directlu under the classes folder of my webapp in Tomcat5.0 container. I was getting an error stating that the class name could not be resolved to a type but the next time i put it under a package structure and it worked. Can someone explain.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please post the code.
Without seeing it, its difficult to say anything for sure.
 
Ramakanta Biswal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Sun Microsystems JDK1.4 and JDK 1.5 ship with OC4J.

So because of this, "The compiler now rejects import statements that import a type from the unnamed namespace." This was to address security concerns and ambiguities with previous JDK versions. Essentially, this means that you cannot invoke a class (a method of a class) that is not within a package. Any attempt to do so will result in a fatal error at compilation time.

This especially affects who invoke JavaBeans from their JSP pagesif the beans are outside of any package.

Although the JSP 2.0 specification now requires beans to be within packages, in order to satisfy the new compiler requirements.

Hope this will clear your doubt!!!
 
Pradeep Kumar
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the information.
 
Shahnawaz Shakil
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ramakant,
This was really informative. Thanks a lot
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!