• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classic tag extends TagSupport

 
muthu moorthy
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Any one help me to sort it out. Thank you.

I am getting error while compiling the following classic1.java

i am using the following command to compile

D:\SCWCD\workout\beerV1>javac -classpath c:/tomcat5/common/lib/servlet-api.jar;classes;. -d classes src/foo/classic1.java

__________________________________________________________________________
package foo;

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

public class classic1 extends TagSupport {
public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();
try {
out.println("classic 1 method tag output");
} catch(IOException ex) {
throw new JspException("IOException- " + ex.toString());
}
return SKIP_BODY;
}
}
_________________________________________________________________________
The Error i am getting :

src/foo/classic1.java:3: package javax.servlet.jsp does not exist
import javax.servlet.jsp.*;
^
src/foo/classic1.java:4: package javax.servlet.jsp.tagext does not exist
import javax.servlet.jsp.tagext.*;
^
src/foo/classic1.java:7: cannot resolve symbol
symbol : class TagSupport
location: class foo.classic1
public class classic1 extends TagSupport {
^
src/foo/classic1.java:8: cannot resolve symbol
symbol : class JspException
location: class foo.classic1
public int doStartTag() throws JspException {
^
src/foo/classic1.java:9: cannot resolve symbol
symbol : class JspWriter
location: class foo.classic1
JspWriter out = pageContext.getOut();
^
src/foo/classic1.java:9: cannot resolve symbol
symbol : variable pageContext
location: class foo.classic1
JspWriter out = pageContext.getOut();
^
src/foo/classic1.java:13: cannot resolve symbol
symbol : class JspException
location: class foo.classic1
throw new JspException("IOException- " + ex.toString());

^
src/foo/classic1.java:15: cannot resolve symbol
symbol : variable SKIP_BODY
location: class foo.classic1
return SKIP_BODY;
^
8 errors
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Change the part in bold to jsp-api.jar
 
muthu moorthy
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Sayak.

But, I just wonder how the HF Book does not explain on this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic