Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 4th, 2002, 05:00 PM
itsource itsource is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 181 itsource User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 7 m 31 sec
Reputation Power: 12
problem when use bean class with JSP

I keep been class in mybean package in

c:\tomcat\webapps\Root\Web-inf\classes\mybean\somebean.class

and save jsp file in
c:\tomcat\webapps\Root\jsp\sec1\test.jsp

and I type url in http://localhost:8080/jsp/sec1/test.jsp

This work correct. and all directory such as \Root\jsp, \Root\news, \Root\webboard must use \Root\Web-inf\classes\mybean to keep class file. I have 2 question

1. When I not use package, in file somebean.java I delete line 1 (package mybean) and compile again. and I edit file test.jsp change from
<jsp:useBean id="bean1" class="mybean.somebean" />
to
<jsp:useBean id="bean1" class="somebean" />

When I run this jsp file. It has error Class org.apache.jsp.someclass not found

I try to shutdown and restart Tomcat. but it has same error.

2. When I put class file in
c:\tomcat\webapps\Root\jsp\Web-inf\classes\mybean\somebeen.class
or
c:\tomcat\webapps\Root\jsp\sec1\Web-inf\classes\mybean\somebeen.class
Why it not found class bean?

Any help please?

Reply With Quote
  #2  
Old July 4th, 2002, 11:49 PM
jnicholas jnicholas is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 5 jnicholas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
This is the correct behavior. The package that a bean or other class is in is reflected in the folder hierarchy under the Web-inf/classes folder. If you don't want to use packages (though you should use them to group related classes and to protect the namespace of your application) you have to have your class in the classes folder.

Also note that the WEB-INF hierarchy is unrelated to the folder structure under the Root level of your webapp so you shouldn't have additional WEB-INF folders.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > problem when use bean class with JSP

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap