Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Anonymous
Problem importing JSTL in JSP
September 1, 2011 2:01 AM
Answer

Anonymous

Hi there,

I'm having some difficulty importing the JSP custom tag library in my JSP page. When I write:

1<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


An error comes up saying: "the absolute uri:<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> cannot be resolved in either web.xml or the jar files deployed with this application"

Does anybody know why this would happen? PS - this is the first time I'm trying to use JSTL in one of my projects..
Mayur Patel
RE: Problem importing JSTL in JSP
September 1, 2011 2:19 AM
Answer

Mayur Patel

Rank: Regular Member

Posts: 241

Join Date: November 17, 2010

Recent Posts

Hi Dean,

you have to copy jstl.jar in your WEB-INF/lib folder and then deployed again your portlet
sure It will work emoticon

Thanks,
Mayur Patel
Zsolt Vilhelm
RE: Problem importing JSTL in JSP
September 1, 2011 2:22 AM
Answer

Zsolt Vilhelm

Rank: New Member

Posts: 16

Join Date: August 30, 2011

Recent Posts

Hello,

You should add the JSTL library to your project's Library. It will solve the porblem.
Do you use Eclipse or Netbeans?
Anonymous
RE: Problem importing JSTL in JSP
September 1, 2011 2:28 AM
Answer

Anonymous

I just searched my machine for any Jar files containing the word "jstl", found 2 with the name jstl-api.jar & jstl-impl.jar, created a folder under my WEB-INF called lib and just pasted it in there. Seems like the import statement works now since now error messages gets displayed.

I use Netbeans
Zsolt Vilhelm
RE: Problem importing JSTL in JSP
September 1, 2011 2:44 AM
Answer

Zsolt Vilhelm

Rank: New Member

Posts: 16

Join Date: August 30, 2011

Recent Posts

Ok. In Netbeans you should do this:
In your project, right click Librarires and click add Library. From the new window select JSTL 1.1
I attach a picture for you. You may need to download JSTL if you dont have it.
Attachment

Attachments: jstl.png (86.5k)
Anonymous
RE: Problem importing JSTL in JSP
September 1, 2011 3:13 AM
Answer

Anonymous

Thanks Zsolt, Very easy and clear explanation. Really appreciate itemoticon
Jelmer Kuperus
RE: Problem importing JSTL in JSP
September 1, 2011 3:22 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1187

Join Date: March 10, 2010

Recent Posts

Actually it's better / easier to add the following entry to your liferay-plugin-package.properties file

1portal-dependency-jars=\
2    jstl-api.jar,\
3    jstl-impl.jar


unless you want your portlet to be portable across portlet containers that is