You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Raible, Matt" <Ma...@cable.comcast.com> on 2003/07/17 17:31:25 UTC

html-el: page attribute doesn't accept run-time expressions

In struts-html.tld, the page attribute allows run-time expressions:

<attribute>
<name>page</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>

However, in struts-html-el, the page attribute does not allow run-time
expressions:

<attribute>
<name>page</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue> <--
</attribute>

Is this a bug?  

The reason I ask is because the following code works fine in Tomcat 4.1.24:

    <%-- Get Javascript List --%>
    <tiles:useAttribute id="scriptList" name="scripts" 
        classname="java.util.List" ignore="true"/>
    
    <c:forEach var="js" items="${scriptList}">
        <script type="text/javascript"
            src="<html-el:rewrite page="${js}"/>"></script>
    </c:forEach>

But in Tomcat 5.0.4, maybe things are stricter or something, but I get the
following error:

org.apache.jasper.JasperException: /layouts/baseLayout.jsp(22,17) According
to TLD or attribute dire
ctive in tag file, attribute page does not accept any expressions

If I change it to the following, everything works fine:

    <c:forEach var="js" items="${scriptList}">
        <script type="text/javascript"
            src="<%=request.getContextPath()%>${js}"/>"></script>
    </c:forEach>

Thanks,

Matt


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html-el: page attribute doesn't accept run-time expressions

Posted by Kris Schneider <kr...@dotech.com>.
Hm, although JSP 2.0 may actually use it for EL-based tags as well. I'm not that
familiar with the details of 2.0, so that might actually be the problem. You
should be able to verify that by trying to use an EL expression in any of the
Struts-EL tags. Which means you'd also need to make sure you're using JSTL 1.1
since those tags will run into the same problem.

Quoting Kris Schneider <kr...@dotech.com>:

> Does this work:
> 
> <c:forEach var="js" items="${scriptList}">
>   <script type="text/javascript"
>           src="<c:url value="${js}"/>">
>   </script>
> </c:forEach>
> 
> None of the EL tags should have <rtexprvalue> set to true, right? That's for
> JSP
> expressions, not EL expressions.
> 
> Quoting "Raible, Matt" <Ma...@cable.comcast.com>:
> 
> > In struts-html.tld, the page attribute allows run-time expressions:
> > 
> > <attribute>
> > <name>page</name>
> > <required>false</required>
> > <rtexprvalue>false</rtexprvalue>
> > </attribute>
> > 
> > However, in struts-html-el, the page attribute does not allow run-time
> > expressions:
> > 
> > <attribute>
> > <name>page</name>
> > <required>false</required>
> > <rtexprvalue>false</rtexprvalue> <--
> > </attribute>
> > 
> > Is this a bug?  
> > 
> > The reason I ask is because the following code works fine in Tomcat
> 4.1.24:
> > 
> >     <%-- Get Javascript List --%>
> >     <tiles:useAttribute id="scriptList" name="scripts" 
> >         classname="java.util.List" ignore="true"/>
> >     
> >     <c:forEach var="js" items="${scriptList}">
> >         <script type="text/javascript"
> >             src="<html-el:rewrite page="${js}"/>"></script>
> >     </c:forEach>
> > 
> > But in Tomcat 5.0.4, maybe things are stricter or something, but I get
> the
> > following error:
> > 
> > org.apache.jasper.JasperException: /layouts/baseLayout.jsp(22,17)
> According
> > to TLD or attribute dire
> > ctive in tag file, attribute page does not accept any expressions
> > 
> > If I change it to the following, everything works fine:
> > 
> >     <c:forEach var="js" items="${scriptList}">
> >         <script type="text/javascript"
> >             src="<%=request.getContextPath()%>${js}"/>"></script>
> >     </c:forEach>
> > 
> > Thanks,
> > 
> > Matt
> 
> -- 
> Kris Schneider <ma...@dotech.com>
> D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: html-el: page attribute doesn't accept run-time expressions

Posted by Kris Schneider <kr...@dotech.com>.
Does this work:

<c:forEach var="js" items="${scriptList}">
  <script type="text/javascript"
          src="<c:url value="${js}"/>">
  </script>
</c:forEach>

None of the EL tags should have <rtexprvalue> set to true, right? That's for JSP
expressions, not EL expressions.

Quoting "Raible, Matt" <Ma...@cable.comcast.com>:

> In struts-html.tld, the page attribute allows run-time expressions:
> 
> <attribute>
> <name>page</name>
> <required>false</required>
> <rtexprvalue>false</rtexprvalue>
> </attribute>
> 
> However, in struts-html-el, the page attribute does not allow run-time
> expressions:
> 
> <attribute>
> <name>page</name>
> <required>false</required>
> <rtexprvalue>false</rtexprvalue> <--
> </attribute>
> 
> Is this a bug?  
> 
> The reason I ask is because the following code works fine in Tomcat 4.1.24:
> 
>     <%-- Get Javascript List --%>
>     <tiles:useAttribute id="scriptList" name="scripts" 
>         classname="java.util.List" ignore="true"/>
>     
>     <c:forEach var="js" items="${scriptList}">
>         <script type="text/javascript"
>             src="<html-el:rewrite page="${js}"/>"></script>
>     </c:forEach>
> 
> But in Tomcat 5.0.4, maybe things are stricter or something, but I get the
> following error:
> 
> org.apache.jasper.JasperException: /layouts/baseLayout.jsp(22,17) According
> to TLD or attribute dire
> ctive in tag file, attribute page does not accept any expressions
> 
> If I change it to the following, everything works fine:
> 
>     <c:forEach var="js" items="${scriptList}">
>         <script type="text/javascript"
>             src="<%=request.getContextPath()%>${js}"/>"></script>
>     </c:forEach>
> 
> Thanks,
> 
> Matt

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org