jsps and tomcat

R

Ryan

I have a jsp that is running. it converts to a servlet and compiles when i
run call the screen with my IE browser. I opened the servlet that was
generated and placed in the 'work' directory.

i cannot compile the servlet. why? It was just compiled by tomcat. I was
able to compile it a little while ago.

I would like to be able to test compile the generated servlet, since it
tells me more information when i have bugs.

do i need to place certain things in my classpath to compile the servlet
with 'javac'?
 
K

kaeli

I have a jsp that is running. it converts to a servlet and compiles when i
run call the screen with my IE browser. I opened the servlet that was
generated and placed in the 'work' directory.

i cannot compile the servlet. why? It was just compiled by tomcat. I was
able to compile it a little while ago.

I would like to be able to test compile the generated servlet, since it
tells me more information when i have bugs.

do i need to place certain things in my classpath to compile the servlet
with 'javac'?

Yes.
Whatever Tomcat has in its classpath should do fine.
Or you can dissect the error messages you get and place each required thing
in your classpath. But just copying/pasting Tomcat's is quicker.

--
 
K

kaeli

how do i know what tomcat has in its classpath?

I don't use Tomcat, so I looked it up.
(.bat is windows, .sh is Unix)

From an FAQ...
# Change the Tomcat CLASSPATH environment variable, or "-classpath" command-
line option, to contain your JAR or ZIP. This is set in the Tomcat startup
script, tomcat.bat/tomcat.sh. Read that file for details on how to edit it.

So, go look there and see what your classpath is.
Generally, it seems to be $TOMCAT_HOME/lib plus your web app's WEB-INF
directory.
(%TOMCAT_HOME%\lib on windows)

I use Netscape Enterprise Server and it has a web GUI, so I just use that to
set/get my classpath for the web server.

From my experience, the normal command-line javac won't include the essential
servlets.jar needed to compile servlets. You have to find that and stick it
in your classpath. Also, any custom classes made by you and put in WEB-
INF/classes will need to be in your classpath. And any DB drivers you use.

If you need more help, it would be useful to know if you're using windows or
unix/linux.

--
--
~kaeli~
Profanity: the single language in which all programmers are
expert.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,250
Latest member
Charlesreero

Latest Threads

Top