You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Song Chao <da...@gmail.com> on 2007/05/15 10:16:39 UTC
How to pass dynamic values to by EL?
Hi, all
I found that it doesn't work when I pass values by EL to <portlet param >,
such as
<portlet:actionURL var="action_add_url">
<portlet:param name="id" value="${item.id}" />
</portlet:actionURL>
How to solve this problem? Please show me some examples.
Thanks.
Bob Song
Re: How to pass dynamic values to by EL?
Posted by Song Chao <da...@gmail.com>.
Hi, Michael
I have tried many ways, such as:
1. replace jstl.jar and standard.jar (which is under version 1.0) and
relative tld files with the ones in j2-admin.
2. Copy total files of 1.1 version to my portlet application.
2. Copy total files of 1.0 version to my portlet application.
And in any way, such problems still remain:
1. when uri is http://java.sun.com/jsp/jstl/core, all tags doesn't work.
2. when uri is http://java.sun.com/jstl/core, it works with old problems:
display must with <c:out>, and the value can't be passed to <portlet:param>
I'm so puzzled. So if possible, could you send me a sample portlet with all
libs? Or please tell me where you have got the jstl libs. (Mine is got by
MyEclipse providing) I'm so eager to solve this problem.
My email is: dataman1981@gmail.com
Thanks a lot.
P.S. Scope couldn't be the problem, because in any other tag such as
<c:out>, it works, given that the uri is http://java.sun.com/jstl/core .
Bob
2007/5/15, Michael Binette <je...@adinquiry.com>:
>
> Song Chao,
>
> I have no problem with this. Here is an example of what I am using in
> my JSP:
>
> <portlet:actionURL var="changeComponentUrl">
> <portlet:param name="componentIndex"
> value="${componentListStatus.index}"/>
> <portlet:param name="componentId" value="${component.id}"/>
> </portlet:actionURL>
>
> My taglib definition is:
>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
>
> What scope is your item object in? That could be the problem?
>
> --
> Michael Binette
>
> Song Chao wrote:
> > Hi, all
> > I found that it doesn't work when I pass values by EL to <portlet
> > param >,
> > such as
> >
> > <portlet:actionURL var="action_add_url">
> > <portlet:param name="id" value="${item.id}" />
> > </portlet:actionURL>
> >
> >
> > How to solve this problem? Please show me some examples.
> >
> > Thanks.
> >
> > Bob Song
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
Re: How to pass dynamic values to by EL?
Posted by Song Chao <da...@gmail.com>.
Hi, Michael.
Thank you very much. Your help makes me be sure about that there are some
version problems with my JSTL.
It's strange, in my WEB-INF folder, there are two 'tld' files for core lib.
One is c-1.0.tld, and another is c.tld. The uri in the former is '
http://java.sun.com/jstl/core', and in the later one is the same as you. But
I have to refer to the former one, or it will not work. And when I want to
output a value, I have to use <c:out value="${...}">, but not refer to EL
directly.
It seems that the JSTL version I use is 1.0, but in MANIFEST.MF in jstl.jar,
it shows that it's 1.1 version. I'm trying to figure out the reason now.
Bob
--The content in MANIFEST.MF in jstl.jar--
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.1
Created-By: 1.4.2-38 ("Apple Computer, Inc.")
Specification-Title: JavaServer Pages Standard Tag Library (JSTL)
Specification-Version: 1.1
Implementation-Title: JavaServer Pages Standard Tag Library API Refere
nce Implementation
Implementation-Version: 1.1.2
Implementation-Vendor: Sun Microsystems, Inc.
Implementation-Vendor-Id: com.sun
Extension-Name: javax.servlet.jsp.jstl
2007/5/15, Michael Binette <je...@adinquiry.com>:
>
> Song Chao,
>
> I have no problem with this. Here is an example of what I am using in
> my JSP:
>
> <portlet:actionURL var="changeComponentUrl">
> <portlet:param name="componentIndex"
> value="${componentListStatus.index}"/>
> <portlet:param name="componentId" value="${component.id}"/>
> </portlet:actionURL>
>
> My taglib definition is:
>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
>
> What scope is your item object in? That could be the problem?
>
> --
> Michael Binette
>
> Song Chao wrote:
> > Hi, all
> > I found that it doesn't work when I pass values by EL to <portlet
> > param >,
> > such as
> >
> > <portlet:actionURL var="action_add_url">
> > <portlet:param name="id" value="${item.id}" />
> > </portlet:actionURL>
> >
> >
> > How to solve this problem? Please show me some examples.
> >
> > Thanks.
> >
> > Bob Song
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
Re: How to pass dynamic values to by EL?
Posted by Song Chao <da...@gmail.com>.
Oh, I see.
I'm so appreicate what you have provided.
Thank you!
2007/5/16, J.Enrique Ruiz-Valenciano <je...@gmail.com>:
>
> I think that you are confused, JSTL is not needed in order to use EL:
>
> http://java.sun.com/products/jsp/jstl/
> http://java.sun.com/products/jsp/syntax/2.0/syntaxref207.html#1010522
>
> On the other side, in the JSP 2.1 specification the JSTL has been
> aligned with EL.
>
> To use EL in your JSP pages, you must to use the JSP 2.0 specification:
>
> http://jcp.org/en/jsr/detail?id=152
>
> Example of a web.xml JSP 2.0 compliant:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
> version="2.4">
> <display-name>...</display-name>
> ...
> </web-app>
>
>
>
>
> > Song Chao,
> >
> > I have no problem with this. Here is an example of what I am using in
> > my JSP:
> >
> > <portlet:actionURL var="changeComponentUrl">
> > <portlet:param name="componentIndex"
> > value="${componentListStatus.index}"/>
> > <portlet:param name="componentId" value="${component.id}"/>
> > </portlet:actionURL>
> >
> > My taglib definition is:
> >
> > <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
> >
> > What scope is your item object in? That could be the problem?
> >
> > --
> > Michael Binette
> >
> > Song Chao wrote:
> >> Hi, all
> >> I found that it doesn't work when I pass values by EL to <portlet
> >> param >,
> >> such as
> >>
> >> <portlet:actionURL var="action_add_url">
> >> <portlet:param name="id" value="${item.id}" />
> >> </portlet:actionURL>
> >>
> >>
> >> How to solve this problem? Please show me some examples.
> >>
> >> Thanks.
> >>
> >> Bob Song
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
Re: How to pass dynamic values to by EL?
Posted by "J.Enrique Ruiz-Valenciano" <je...@gmail.com>.
I think that you are confused, JSTL is not needed in order to use EL:
http://java.sun.com/products/jsp/jstl/
http://java.sun.com/products/jsp/syntax/2.0/syntaxref207.html#1010522
On the other side, in the JSP 2.1 specification the JSTL has been
aligned with EL.
To use EL in your JSP pages, you must to use the JSP 2.0 specification:
http://jcp.org/en/jsr/detail?id=152
Example of a web.xml JSP 2.0 compliant:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>...</display-name>
...
</web-app>
> Song Chao,
>
> I have no problem with this. Here is an example of what I am using in
> my JSP:
>
> <portlet:actionURL var="changeComponentUrl">
> <portlet:param name="componentIndex"
> value="${componentListStatus.index}"/>
> <portlet:param name="componentId" value="${component.id}"/>
> </portlet:actionURL>
>
> My taglib definition is:
>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
>
> What scope is your item object in? That could be the problem?
>
> --
> Michael Binette
>
> Song Chao wrote:
>> Hi, all
>> I found that it doesn't work when I pass values by EL to <portlet
>> param >,
>> such as
>>
>> <portlet:actionURL var="action_add_url">
>> <portlet:param name="id" value="${item.id}" />
>> </portlet:actionURL>
>>
>>
>> How to solve this problem? Please show me some examples.
>>
>> Thanks.
>>
>> Bob Song
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: How to pass dynamic values to by EL?
Posted by Michael Binette <je...@adinquiry.com>.
Song Chao,
I have no problem with this. Here is an example of what I am using in
my JSP:
<portlet:actionURL var="changeComponentUrl">
<portlet:param name="componentIndex"
value="${componentListStatus.index}"/>
<portlet:param name="componentId" value="${component.id}"/>
</portlet:actionURL>
My taglib definition is:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
What scope is your item object in? That could be the problem?
--
Michael Binette
Song Chao wrote:
> Hi, all
> I found that it doesn't work when I pass values by EL to <portlet
> param >,
> such as
>
> <portlet:actionURL var="action_add_url">
> <portlet:param name="id" value="${item.id}" />
> </portlet:actionURL>
>
>
> How to solve this problem? Please show me some examples.
>
> Thanks.
>
> Bob Song
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org