You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rob <ro...@fastmail.fm> on 2002/03/05 21:34:29 UTC

struts tags in pages

I've seen several examples of this in the mail archives but for some reason
I'm unable to make it work.

I have a base page foo.jsp
<!-- foo.jsp -->

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<html:html locale="true">

<jsp:include page="bar.jsp" flush="true"/>

</html:html>

and an included page that contains a bunch of things amongst them a usage of
the struts iterator tag

<!-- bar.jsp -->
<logic:iterate id="path" name="path" type="dao.daobeans.BaseLink">
<a href="viewResource?id=<jsp:getProperty name="path"
property="id"/>">page</a>
</logic:iterate>

unfortunately it doesn't work I get complaints about an attribute having no
value.  (presumably the path
attribute)

I've also tried the <%@include .. static include without success.  I know
I'm not using the struts html:link
tag here (because I can't use <jsp:getProperty .. in it) but if I cut and
paste this code into the foo.jsp page
it works perfectly fine.

Any suggestions

Thanks

Rob


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: struts tags in pages

Posted by Ivan Siviero <iv...@concept.it>.
> <!-- bar.jsp -->
> <logic:iterate id="path" name="path" type="dao.daobeans.BaseLink">
> <a href="viewResource?id=<jsp:getProperty name="path"
> property="id"/>">page</a>
> </logic:iterate>
>

Just a simple question: the null attribute value is the attribute 'path' in
logic iterate tag or in the jsp gerProperty tag?
I know it's quite the same but i'd like to figure out if the compiler throws
an exception on logic:iterate or maybe on jsp:getProperty.
Which scope is the 'path' attribute of name property in logic:iterate in ?

I do not know if this should fix the problem but anyway try this:

<logic:iterate id="path" name="path" type="dao.daobeans.BaseLink">
  <html:link href="viewResource" paramName="path" paramId="id"
paramProperty="id">page</html:link>
</logic:iterate>

or if the path attribute of name property is in page scope try this:

<logic:iterate id="pathId" name="path" type="dao.daobeans.BaseLink">
  <html:link href="viewResource" paramName="pathId" paramId="id"
paramProperty="id">page</html:link>
</logic:iterate>

Ivan.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>