I am trying out a custom tag example. I am running tomcat5 andd have the jsp-api.jar in my classpath. I know that is okay because I have been able to execute Simple tags. Anyway, here is the custom tag
package foo;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import java.io.IOException;
public class CustomTagTest3 extends TagSupport {
int movieCounter;
String[] movies = {"Amelie","Sandy beaches","Veer zara","SomethingElse"};
public int doStartTag() throws JspException {
movieCounter = 0;
return EVAL_BODY_INCLUDE;
}
public int doAfterBody() throws JspException {
if (movieCounter < movies.length) {
pageContext.setAttribute("movie",movies[movieCounter]);
movieCounter++;
return EVAL_BODY_AGAIN;
}
else {
return SKIP_BODY;
}
}
public int doEndTag() throws JspException {
return EVAL_PAGE;
}
}
I am getting the below compilation error.
C:\HEADFI~1\CustomTagTest3>javac foo\CustomTagTest3.java
foo\CustomTagTest3.java:26: cannot resolve symbol
symbol : variable EVAL_BODY_AGAIN
location: class foo.CustomTagTest3
return EVAL_BODY_AGAIN;
^
1 error
I know that EVAL_BODY_AGAIN is a valid return value for doAfterBody(). What am I missing ?