论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
匿名
Problem importing JSTL in JSP
2011年9月1日 上午2:01
答复

匿名

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
2011年9月1日 上午2:19
答复

Mayur Patel

等级: Expert

帖子: 349

加入日期: 2010年11月17日

最近的帖子

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
2011年9月1日 上午2:22
答复

Zsolt Vilhelm

等级: New Member

帖子: 16

加入日期: 2011年8月30日

最近的帖子

Hello,

You should add the JSTL library to your project's Library. It will solve the porblem.
Do you use Eclipse or Netbeans?
匿名
RE: Problem importing JSTL in JSP
2011年9月1日 上午2:28
答复

匿名

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
2011年9月1日 上午2:44
答复

Zsolt Vilhelm

等级: New Member

帖子: 16

加入日期: 2011年8月30日

最近的帖子

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.
附件

附件: jstl.png (86.5k)
匿名
RE: Problem importing JSTL in JSP
2011年9月1日 上午3:13
答复

匿名

Thanks Zsolt, Very easy and clear explanation. Really appreciate itemoticon
Jelmer Kuperus
RE: Problem importing JSTL in JSP
2011年9月1日 上午3:22
答复

Jelmer Kuperus

等级: Liferay Legend

帖子: 1192

加入日期: 2010年3月10日

最近的帖子

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