This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes classic tag extends TagSupport Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "classic tag extends TagSupport " Watch "classic tag extends TagSupport " New topic
Author

classic tag extends TagSupport

muthu moorthy
Ranch Hand

Joined: Dec 19, 2006
Posts: 87
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

Joined: Nov 28, 2006
Posts: 292


Change the part in bold to jsp-api.jar


Turn on, tune in, drop out.
muthu moorthy
Ranch Hand

Joined: Dec 19, 2006
Posts: 87
Thank you Sayak.

But, I just wonder how the HF Book does not explain on this.
 
Consider Paul's rocket mass heater.
 
subject: classic tag extends TagSupport
 
Similar Threads
Eclips error
Is returning invalid integer from doStartTag() is equivalent to returning EVAL_BODY_INCLUDE ?
How do I compile mt Tag Handler...?
Simple Tag & Classic Tag handler mock exam question - what's YOUR answer?
Problem with Custom Tags