on 07-12-2006 2:08 PM
Hi all,
I need to compile using command line the HelloWorldSimpleTag.java:
<i>package jsp2.examples.simpletag;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;
public class HelloWorldSimpleTag extends SimpleTagSupport {
public void doTag() throws JspException, IOException {
getJspContext().getOut().write( "Hello, world!" );
}
}</i>
I use the follow command in order to compile:
<i>javac "D:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\jsp-examples\WEB-INF\classes\jsp2\examples\<b>simpletag</b>\HelloWorldSimpleTag.java"</i>
In the <b>simpletag</b> folder I inserted the javax.servlet.jsp.jar library.
But I have compiling error on: <b>package javax.servlet.jsp.jar does not exist!!!!</b>
What I wrong??? Thanks.
Vito
Vito
<i><b>Are you sure of the Class name ???</b></i>
****************************************************
package jsp2.examples.simpletag;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.<b>SimpleTagSupport</b>;
import java.io.IOException;
public class HelloWorldSimpleTag extends <b>SimpleTagSupport</b> {
public void doTag() throws JspException, IOException {
getJspContext().getOut().write( "Hello, world!" );
}
}
*******************************************
See the follwoing API : <b><a href="http://java.sun.com/products/servlet/2.2/javadoc/">API</a></b>
Thanks
Jack
<b>
Allot points if my post helps !!!</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure it isn't supposed to be:
import javax.servlet.JspException;
import javax.servlet.tagext.SimpleTagSupport;
(I don't have access to the libs at the moment to double check the names.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are using <b>NWDS / Eclipse</b>:
Right click on project > Java Build path > Libraries tab > Add External Jars and choose the path where your javax.servlet.jsp.jar lies.
<b>Else</b>, in Windows Environment variable, Classpath variable value enter the path to javax.servlet.jsp.jar. For example: the Classpath would look like this:
<b>C:\Jar\javax.servlet.jsp.jar;.;</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try,
1. adding servlet-api.jar in the build path (It should be available under commons/lib directory).
2. adding jsp-api.jar in the build path
3. set system variables accordingly.
Regards,
Srinivasan T
<b>Helpful answers=>points</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.