Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Couldn't compile the Tag Handler class!!

843838May 11 2007 — edited Jun 25 2007
Here is my code snippet

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspContext.*;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;
public class AdvisorTagHandler extends SimpleTagSupport
{
private String user;
public void doTag() throws JspException, IOException
{
getJspContext().getOut().write("Hello" + user + "<br>");
getJspContext().getOut().write("Your Advice is : " +getAdvice());
}
public void setUser(String user)
{
this.user=user;
}
String getAdvice()
{
String[] adviceStrings = {"That color is not working for you", "You should call back", "You might want to rethink that haircut."};
int random = (int)(Math.random() * adviceStrings.length);
return adviceStrings[random];
}

}

the error i got while compiling is


AdvisorTagHandler.java:3: package javax.servlet.jsp.JspContext does not exist
import javax.servlet.jsp.JspContext.*;
^
AdvisorTagHandler.java:4: cannot resolve symbol
symbol : class SimpleTagSupport
location: package tagext
import javax.servlet.jsp.tagext.SimpleTagSupport;
^
AdvisorTagHandler.java:6: cannot resolve symbol
symbol : class SimpleTagSupport
location: class com.learn.AdvisorTagHandler
public class AdvisorTagHandler extends SimpleTagSupport
^
AdvisorTagHandler.java:11: cannot resolve symbol
symbol : method getJspContext ()
location: class com.learn.AdvisorTagHandler
getJspContext().getOut().write("Hello" + user + "<br>");
^
AdvisorTagHandler.java:12: cannot resolve symbol
symbol : method getJspContext ()
location: class com.learn.AdvisorTagHandler
getJspContext().getOut().write("Your Advice is : " +getAdvice())
;
^
5 errors

Kindly somebody help me out to get the SimpleTagSupport class file..
I searched in jstl.jar and standard.jar this class is not there in these 2 jar files..
Where do i find this class file..

thanks in advance
Chithrakumar

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 23 2007
Added on May 11 2007
1 comment
108 views