public int doStartTag()throws JspException {
try
{
pageContext.getOut().print("Hello JSP tag World");
}
catch(IOException ioe)
{
throw new JspTagException("Error:IOException while writing to the user");
}
return SKIP_BODY;
}
}
-------------------------------------------------
I have been trying it since a week.
The problem is that as long as jsp-api.jar is under C:\Tomcat 6.0\webapps\myFirstCustomTag\WEB-INF\lib,
running index.jsp gives me following exception.
-----------------------------------------------------------------------------------------------------------------
exception
But when i remove the jsp-api.jar from C:\Tomcat 6.0\webapps\myFirstCustomTag\WEB-INF\lib,
the problem evaporates and the project runs normally. But WHY ? I cant understand .
You should never put jsp-api.jar or servlet-api.jar in WEB-INF/lib. It just fouls things up with hard-to-diagnose errors. These jar files are provided by the container and should never be put into your web apps.
And I'd also advice to use proper URIs for your taglibs. You can use anything you want, but not following conventions just makes things harder than they need to be.
Both web.xml and simpletags.tld use the URI '/WEB-INF/simpletags.tld', but your JSP references 'WEB-INF/simpletags.tld'. Are you sure your JSP container sees those as equivalent?
OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower