• Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Tag help - simple question

 
Patrick Joseph
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to learn JSP and am working on Custom Tags. I'm creating a tag class and these lines:

import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;

are giving me an errors since I don't have the javax.servlet src code installed.

My question is: How do I get these classes?

I have JSDK 1.5 and I don't have the servlet classes in the src directory. Thanks in advance...
[ July 08, 2005: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using Tomcat, the required libs are in CATALINA_HOME/common/lib
You can also download j2ee.jar from java.sun.com.
 
Patrick Joseph
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the common/lib directory, I see a "servlet.jar" file.

Do I just need to copy this over to where my SDK directories are installed?

I have Tomcat installed in my home machine in a seperate directory.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's best not to copy it. Rather, add it to your compile classpath where it lies.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Patrick asked:

When you say add it to the CLASSPATH, is that the same as adding it to the PATH variable (environment variable)?


No. The PATH env variable determines the folders that will be searched to find command-line commands.

One of the ways that you can define the classpath is with the CLASSPATH env variable.

If you are going to be serious about web development, I'd recommend adopting Ant as a build tool.
 
Patrick Joseph
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:

One of the ways that you can define the classpath is with the CLASSPATH env variable.


Thanks Bear...

I did a little research and was able to successfully compile the tag class now.
[ July 09, 2005: Message edited by: Patrick Joseph ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!