which jar to use for JSTL - java

(server Tomcat7v)
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
First Name:<c:out value="${param.fname}"></c:out><br/>
Last Name:<c:out value="${param.lname}"></c:out>
in the previous JSP and I am getting
Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"
this error.
But when I try to find out the jars there were lots of version of that I am confused with which one should I use??

You need to put jstl jar in your classpath. See details at https://stackoverflow.com/tags/jstl/info

I were using Tomcat 7v which uses servlet 3.0 so I had to use jstl1.2.1 jars

Related

JSTL Taglib -error

i have the following pice of code:
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
If i want to run the programm i get the following error message:
HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
My JAR Files are in the WEB-INF/lib/ folder
--->javax.servlet.jsp.jstl-1.2.1-javadoc.jar (IMP)
--->javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar (API)
I use the WEB.xml Version 3.0
So please can someone help me?!
Thanks
It seems you have added the javadoc of the JSTL instead of the code. Try downloading this one and add it to your lib directory:
http://mvnrepository.com/artifact/javax.servlet/jstl/1.2

How to use JSTL on Eclipse project?

I want to use JSTL
I tried to import taglib using:
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
but it says cannot find tag library descriptor for
You can find link to download page in jstl FAQ. Choose the version you need and download necessary dependencies.

Spring adding Tags build error

I have got the following errors and i am unable to find an answer. Can someone help me here.
Description Resource Path Location Type
Can not find the tag library descriptor for "http://www.springframework.org/tags" contact.jsp /Spring3HibernateMaven/src/main/webapp/WEB-INF/jsp line 1 JSP Problem
Description Resource Path Location Type
Can not find the tag library descriptor for "http://www.springframework.org/tags/form" contact.jsp /Spring3HibernateMaven/src/main/webapp/WEB-INF/jsp line 2 JSP Problem
My JSP code is as follows;
<%# taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%# taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
In my Web.xml the code is as follows;
<jsp-config>
<taglib>
<taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
<taglib-location>spring-form.tld</taglib-location>
</taglib>
</jsp-config>
How do i solve this error ?
You shouldn't need to configure the taglib in web.xml. Just make sure the org.springframework.web.servlet-xxx.jar is on your classpath (web-inf/lib). It contains the TLD files.
I have the same problem although I have already spring-webmvc-3.1.0.RELEASE.jar on Maven repos.
When I download jar org.springframework.web.servlet-3.1.0.RELEASE.jar and include in lib. It works.
I don't know why because two jars were totally the same, they just have different names.

Liferay Taglib import not working in JSP

I'm having trouble importing the liferay taglibs in one of my JSP pages, no idea what I'm doing wrong. I did the exact same thing in previous projects, but now for some reason it's not working.
My code to import:
<%# taglib uri="http://liferay.com/tld.ui" prefix="liferay-ui" %>
The syntax error I'm getting:
The absolute uri: http://liferay.com/tld.ui cannot be resolved in either web.xml or the jar files deployed with this application
I tried to google this problem quite extensively, but to no avail. The horrible documentation (or lack thereof) for liferay is also not a big help at all.
Thanks in advance for any help!
The taglib URI gets resolved from the following places(in the order):
If the container is Java EE platform compliant, the tag libraries that are part of the Java EE platform. This currently includes JSTL and JSF Tag Library libraries.
Taglib Map in web.xml, the web.xml can include an explicit map of URI's and TLD's respource paths.
TLDs in JAR files in WEB-INF/lib and TLDs under WEB-INF
TLD's supported by Container
In you case, check the following cases:
1) If jar file realted to liferay exists in WEB-INF/lib containing a TLD in jar/META-INF which will be defined with http://liferay.com/tld.ui URI.
2) If there is not jar file and the liferay-ui.tld exists outside the jar file, add the URI mapping entrey in your web.xml like below:
<taglib>
<taglib-uri>http://liferay.com/tld/ui</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-ui.tld</taglib-location>
</taglib>
it is not
<%# taglib uri="http://liferay.com/tld.ui" prefix="liferay-ui" %>
it should be
<%# taglib prefix="liferay-ui" uri="http://liferay.com/tld/ui" %>
notice that "tld.ui" must be "tld/ui".
liferay-ui.tld comes from util-taglib.jar that liferay adds to your WEB-INF/lib during hot deploy.
No entries to your web.xml are needed.
You probably need to include taglib declaration in your web.xml.
<taglib>
<taglib-uri>http://liferay.com/tld/ui</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-ui.tld</taglib-location>
</taglib>

Does IBM Websphere 5.1.2 support jstl

Guys i have included jstl and standard.jar in lib directory under classpath. It says absolute uri http://java.sun.com/jstl is not found either in web.xml or in application. please let me know how to configure in websphere 5.1.2
The right taglib URI depends on the JSTL version. Assuming you're using JSTL 1.1 (which would be the best choice for WAS 5.1.2 which runs Servlet 2.3), you need to specify taglib URI's as per this document. So, JSTL core should be specified as follows:
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
(note the extra /jsp path; this is added in JSTL 1.1 as opposed to JSTL 1.0)

Categories

Resources