• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to compile Tag Handler

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i am coding simple tags in Custom tags. but i am not able to compile tag handler. compiler throws error at line 1 - cannot resolve symbol SimpleTagSupport,line 4 - cannot resolve symbol SimpleTagSupport and line 8 - cannot resolve symbol getJspWriter.
here is the tag handler code.

import javax.servlet.jsp.tagext.SimpleTagSupport;
import javax.servlet.ServletException;
import java.io.IOException

public class RandomHandler extends SimpleTagSupport
{
public void doTag() throws ServletException,IOException
{
getJspWriter.out("inside doTag method");
}
}

classpath is set as follows :
set CLASSPATH=.;<java install directory>\bin;<java install directory>\lib;<java install directory>\lib\j2ee.jar;<tomcat install directory>\common\lib\servlet-api.jar;<tomcat install directory>\common\lib\jsp-api.jar;

shall i have to provide any jar files related to custom tags?

Thanks in Advance
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should compile as SimpleTagSupport is part of jsp-api.jar
Type SET at the prompt, and check that the path to this jar is correct.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try putting the path of different jar file in quotes like

set CLASSPATH=.;"<java install directory>\bin";"<java install directory>\lib";"<java install directory>\lib\j2ee.jar";"<tomcat install directory>\common\lib\servlet-api.jar";"<tomcat install directory>\common\lib\jsp-api.jar"
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CLASSPATH is set in system->environment variables. i think when the system is restarted, the changes should be reflected. but it is still not working guys.

any solution for this situation, please reply
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Open command prompt and type SET. You will see all environment variables.
Please send us the CLASSPATH.
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried to set classpath before compiling handler like this.
set CLASSPATH=.;<tomcat folder>/common/lib/jsp-api.jar
now the handler got compiled.

thanks guys
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic