• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to compile Tag Handler

 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • 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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Mohd Fuzail
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • 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
  • 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 Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic