Using JSP in Hosted Environment - no redeploy

Hey,

I'm using Tomcat 5 in a hosted environment where I don't have that much control over the sever and it's configuration. The support guys are open to my input as they don't understand Java.

I'm 10% into writing an web application and started it using the Model 1 JSP only method. This became to cumbersome to maintain and I have since began putting most of the code into classes. The classes do not extend httpservlet.

I began working on a test page in the /root of the site and was able to work with my class files under the /WEB-INF/classes folder. However, when trying to access those same files from a jsp located say a folder in at /tools/test.jsp, I get a classpath type error saying that those types are undefined.

I have no web.xml file as I assumed you get the classes folder for free w/ no extra configuration

null

[871 byte] By [caneswina] at [2007-11-27 6:27:33]
# 1
hi,web application has a file structure tat u hav to maintain while coding and deploying ..u can get a sample file structure from net, work in tat structure . u wont get any problem in deploying ur web applicationregards-venkat
noveleraa at 2007-7-12 17:49:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I'm familiar with the webapp specification and am following it, well most of it. I'm just not using a web.xml file. I guess it may present a larger issue at hand. I'm used to the Struts framework for coding jsp but this is raw JSP with class file support. I would call the class files Servlets, but they do not extend HttpServlet. Maybe I'm misunderstanding the principle of a servlet, but I don't the class file to implement doGet and all the other methods, I just want it to assist the JSP in carrying out tasks. My classes are a little more than a utility and a little less than a servlet. Is this some sort of a design pattern?

Anyway, it seems like a simple configuration issue with the webapp or tomcat as to why my class files and imports work on the JSP when being called from the root of the site but not from any subfolder within the site.

caneswina at 2007-7-12 17:49:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

actually the web application must have a deployment discriptor i.e web.xml.if ur using servlet u hav to define tat in web.xml and which file to load first u hav to define here as basic need, if u are using only class method to perform some logic,

are you using package?, and are u importing it properly into ur jsp page,

ur class must be in web-inf/Classes folder and if there is any package .. u hav to import properly for example import myPkg.myClass;

-venkat

noveleraa at 2007-7-12 17:49:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Thanks for your help so far.

I'm sure that it's not an import issue because the file works from the root of the site but nowhere else. The files are in packages and the import uses the fully qualified class name.

I am not using servlets in the sense that the classes extend HttpServlet.

What would my web.xml file look like? So far there are about 9 classes that I'm using and there will be many more. It doesn't seem right that I would have to define 30 or more classes that serve as a library to the app.

caneswina at 2007-7-12 17:49:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...