The Exporter class is designed to make the data in my "Model" class available
for use in jsp.  It has a method "getDataMatrices()" and another
"getNameValuePairs()".  I'm using the S2 tags for the "NameValuePairs", and
it works fine.  I'm trying to use JSTL for the "DataMatrices", and it
doesn't work.

I've tried 2 methods of exposing the Exporter to the JSP:  (1) using a
method "getExporter()" in the Action, (2) having the Action implement
ServletRequestAware, and explicitly saving the Exporter into the Request. 
That is how I'd do in S1.

For either method, the S2 iterator tag works properly for the
"NameValuePairs" data.  However the JSTL tags display the "DataMatrices"
only If I put the Exporter into the HttpRequest.  The JSP page does not
change at all between the 2 methods.  Only the Action class changes.

Of course, I REALLY don't want to implement ServletRequestAware, because I
want to test my Actions easily.  Therefore I really need to make the
"getExporter()" method work with JSTL.

This page perfectly illustrates my point on the difficulty of the JSTL tags
working nicely with S2.  The page works perfectly if the object is
explicitly placed into the HttpRequest.  If the 'getExporter()' is the way
in which the Exporter is exposed, then it doesn't work for jstl.

- Ray Clough



Dave Newton-4 wrote:
> 
> --- Ray Clough <[EMAIL PROTECTED]> wrote:
>> My Action has a method "public Exporter
>> getExporter()".  If I use the struts2 
>> tags I can access the "exporter" with 
>> <s:iterator value="exporter.nameValuePairs" >, 
>> and it works fine.  If I use the jstl syntax 
>> <c:forEach items="${exporter.dataMatrices}"
>> var="matrix" >, nothing is found.  How do 
>> I get the jstl tag to work here? 
> 
> Without knowing what an Exporter is, I don't really
> know. 
> 
> You're using two different property names; did you
> mean to? 
> 
> Does Exporter follow JavaBean naming conventions for
> both of the properties you're accessing?
> 
> Use <s:iterator.../> but handle the inner loop with
> JSTL/JSP EL?
> 
> d.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JSTL-and-the-Value-Stack-tf3595148.html#a10050445
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to