Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL + help needed

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to compile the follwing code

----------------code----------------------

package SCWCD.HFSJ.chap09;

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




public class AdvisorTagHandler extends SimpleTagSupport{
private String user;

public void doTag()throws JspException, IOException{
getJspContext().getOut().write("hello :"+user);
getJspContext().getOut().write("your advice is :"+getAdvice());
}

public void setUser(String user){
this.user=user;
}

String getAdvice(){
String[] advice = {"you","are","jerk","it","is","good","hard working"};
}

}

----------------code----------------------

While compiling i get the following error.

SCWCD/HFSJ/chap09/AdvisorTagHandler.java:4: cannot resolve symbol
symbol : class SimpleTagSupport
location: package tagext
import javax.servlet.jsp.tagext.SimpleTagSupport;
^
SCWCD/HFSJ/chap09/AdvisorTagHandler.java:9: cannot resolve symbol
symbol : class SimpleTagSupport
location: class SCWCD.HFSJ.chap09.AdvisorTagHandler
public class AdvisorTagHandler extends SimpleTagSupport{
^
2 errors



Am i doing some mistake / missing some jar. Pleae help
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are missing appropriate libraries in your classpath.
 
Priya Jothi
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Ensure the following jars are present in your classpath.If present,then it should compile fine.


<tomcat_home>\common\lib\jsp-api.jar;
<tomcat_home>\common\lib\servlet-api.jar;

hth..

Regards,
Priya.
 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnx Priya it helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic