• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

JSTL + help needed

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are missing appropriate libraries in your classpath.
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thnx Priya it helps
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic