File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSTL + help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JSTL + help needed" Watch "JSTL + help needed" New topic
Author

JSTL + help needed

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 357
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


SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
You are missing appropriate libraries in your classpath.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Priya Jothi
Ranch Hand

Joined: Jul 13, 2004
Posts: 168
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

Joined: May 18, 2005
Posts: 357
thnx Priya it helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL + help needed