Posts

Showing posts with the label JSP

Failed to load or instantiate TagLibraryValidator

Problem Usecase: Downloaded the Apache Tag libraries and copied them in the web-inf /lib/jstl-libs/ folder. Included the taglib directory in jsp page, compiled and deployed in Tomcat 6. During runtime got the following exception. Exception Details [Truncated]: org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:281) org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:670) org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:249) org.apache.jasper.compiler.TagLibraryInfoImpl. (TagLibraryInfoImpl.java:164) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:386) org.apache.jasper.compi...

Jakarta Commons HttpClient API Example

The Jakarta Commons HttpClient component provides API's for accessing HTTP Resources. We can download HttpClient from Apache and use it. The general process for using HttpClient consists of a number of steps: Create an instance of HttpClient . Create an instance of one of the methods (GetMethod in this case). The URL to connect to is passed in to the the method constructor. Tell HttpClient to execute the method. Read the response. Release the connection. Deal with the response. The following example shows, how we can use HttpClient for Submiting a form data to a URL. import java.io.IOException; import java.util.MissingResourceException; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.JspException; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.PostMethod; public class FundaHttpClient { public static boolean httpPost(HttpServletRequest request) { //UR...

JSP Tag Library , TLD Example

A tag library allows a developer to group together tags with related functionality. A tag library uses a tag library descriptor (tld) file that describes the tag extensions and relates them to their Java classes. JSP's offer a unique feature of "Tag Libraries". Simply put, these are custom defined JSP tags. They are basically meant for componentizing presentation level logic. They are very similar to beans except the fact that Beans are used to separate Business logic. Every tag is mapped to a particular class file which is executed whenever the tag is encountered in an JSP file. The general syntax : Follows the general syntax for including a particular tag library from a jsp. Follows a example tld, PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"> 1.0 1.1 Nefunda Nefunda Contact feature Tag contactEmailForm com.nefunda.tag.ContactFormsTag JSP Th...