Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Simple Tag

 
Nithya Venkatraman
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

This is my tag handler class:
package myclasses;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.*;
import java.io.*;

public class SimpleTag1 extends SimpleTagSupport{
public void doTag() throws IOException{
getJspContext().getOut().print("Hi This is a Simple Tag example");
}
}


When I try to compile the .java class I am getting the foll: errors:
SimpleTag1.java:6: cannot resolve symbol
symbol : class SimpleTagSupport
location: class myclasses.SimpleTag1
public class SimpleTag1 extends SimpleTagSupport{
^
SimpleTag1.java:8: cannot resolve symbol
symbol : method getJspContext ()
location: class myclasses.SimpleTag1
getJspContext().getOut().print("Hi This is a Simple Tag example"
);
^
2 errors

Why am I getting this error?
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Include servlet-api.jar AND jsp-api.jar in your classpath.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic