The Artima Developer Community
Sponsored Link

Java Answers Forum
Can not access class files in JSP

5 replies on 1 page. Most recent reply: Sep 27, 2003 5:21 AM by Senthoorkumaran Punniamoorthy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 5 replies on 1 page
perry arora

Posts: 22
Nickname: perry
Registered: Sep, 2003

Can not access class files in JSP Posted: Sep 25, 2003 10:32 PM
Reply to this message Reply
Advertisement
hi friends need your help..


i am trying to run a web application whihc is alsousing struts.. but that is not a problem,,

the problem which i need suggestion is that in my jsp file which is the final view of my

application i am not able to use the classes which i have stores in

TOMCAT-HOME/webapps/MyApplication/WEB-INF/classes

and i think the classes which in this folder should be visible through out the application to

all other classes,servlets, and jsp.. even my Actionservlet and Action classes are using the

classes stored in this folder but when i am trying to cast a bean to a specific type its giving me

class not found exception,,

i also tried the following

(1) placed the class file in TOMCAT-HOME/classes folder so that the SHARED class loader can load it...

i know that TOMCAT assigns a jasperx class loader which loads the classes from the folder

TOMCAT/jasper folder and the classes which are placed here are specifically for the jsp files .

but i did checked the specification of the TOMCAT 4.0 which says that it is a child class loader

of the main class loader WEBAPPSX which loads all the classes from

TOMCAT-HOME/webapps/MYapplication/WEB_INF/classes .... and


i have tried acessing all the class files which i have placed in the

TOMCAT-HOME/webapps/MYapplication/WEB_INF/classes folder

but the jsp file can not access any of them...........


i think i am missing some thing or doing some thing wrong...


need u r help... i will really appreciate any suggestions....


Shekhar

Posts: 11
Nickname: shekhar4u
Registered: Aug, 2003

Re: Can not access class files in JSP Posted: Sep 26, 2003 4:23 AM
Reply to this message Reply
hi...
r u using page directective for importing the required classes in your program...
I think if ur not then give a try...by importing all those classes which u r using in jsp...

perry arora

Posts: 22
Nickname: perry
Registered: Sep, 2003

Re: Can not access class files in JSP Posted: Sep 26, 2003 6:05 AM
Reply to this message Reply
hey!

all my classes are lying in the

WEB-INF/classes folder as i mentioned , and i haven't packeged them specifically....

but i think since the class loader includes all those files i dont need to include them but i will try but i think the problem is some where else.....

plzz C if some can suggest me.

Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: Can not access class files in JSP Posted: Sep 26, 2003 10:56 PM
Reply to this message Reply
does your classes have package statements at the top?

And also in your JSPs how are your reffering to them? Please provide code sample as to how you are reffering them in your JSP?

perry arora

Posts: 22
Nickname: perry
Registered: Sep, 2003

Re: Can not access class files in JSP Posted: Sep 27, 2003 12:40 AM
Reply to this message Reply
hi friends ...

i did tried packaging the class in a package and use it ,, but thats also not working..

any suggestions ..i do get some views from people inferring that is it a problem with any

specific version of tomcat..


and also regarding where i am using the class files.. i hav etried them in he

<jsp:useBean> and also in the scrilets



i am waiting for replies.,

bye ~~

Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: Can not access class files in JSP Posted: Sep 27, 2003 5:21 AM
Reply to this message Reply
You haven't given me the code segments I asked for??? Also you have not answered the question about the Package statement??

Flat View: This topic has 5 replies on 1 page
Topic: Title Bar Previous Topic   Next Topic Topic: Invoking MicrosoftExcel from java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use