Actually, <c:url> is just what I was looking for. I've been writing a "workaround" (i.e. request.getContextPath()) for the module thingy, which I considered a bug, rather than a feature ;-)
Thanks, Matt -----Original Message----- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 12:42 PM To: Struts Users Mailing List Subject: RE: html-el: page attribute doesn't accept run-time expressions Yup, that should be just fine, except maybe if you're using modules. I think <html:rewrite> treats the value of the "page" attribute as module-relative so it does a little extra work to generate the actual URI. <c:url> just treats "value" as either absolute (starts with a scheme) or context-relative (starts with a "/"). Quoting "Raible, Matt" <[EMAIL PROTECTED]>: > Yes it does - thanks for the tip! So I'm guessing (since this works) that > I > can replace all my <html:rewrite page=""/> with <c:url value=""/>? I dig > that - much shorter. > > Matt > > -----Original Message----- > From: Kris Schneider [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 17, 2003 9:59 AM > To: Struts Users Mailing List > Subject: Re: html-el: page attribute doesn't accept run-time expressions > > > 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" <[EMAIL PROTECTED]>: > > > 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 <mailto:[EMAIL PROTECTED]> > D.O.Tech <http://www.dotech.com/> -- Kris Schneider <mailto:[EMAIL PROTECTED]> D.O.Tech <http://www.dotech.com/> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]