Re: Output and JSTL
"Sasvata (Shash) Chatterjee" <[email protected]>
| Newsgroups | gmane.comp.java.keel.devel |
|---|---|
| Message-ID | <[email protected]> |
Max,
> I have been able to get basic jstl support running by doing the
> following:
>
> 1. Adding dependencies to jstl.jar and standard.jar to the POM - as
> Pierre I think it was explained elsewhere.
> 2. Adding c.tld to the keel-build/webapps/struts-1.2.4/WEB-INF
> directory.
> 3. Including <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> in my jsp
> file.
>
You don't need to modify keel-build/clnt-struts, etc. to add TLDs. Add
it to your $PROJECT/src/webapp/WEB-INF, so you don't have to muck with
it every time you get a new Keel JAR/plugin.
However, when I get a chance, I'll add these dependencies and the TLD to
client-struts anyway, since a lot of people use JSTL with Struts.
> I can access the outputs using an array reference (or loop) as follows:
>
> <c:forEach var="output" items="${outputs}">
> <p><c:out value="${output.map['name']}" default=""/> = <c:out
> value="${output.map['content']}" default=""/> </p>
> </c:forEach>
>
> and individually using:
>
> <c:out value="${outputs[0].map['name']}" default=""/>
>
> *Problem1:*
>
> However I am having difficulty in accessing the outputs by name. From
> the OutputsInMaverickJSTL Wiki it says that named outputs can be
> accessed using something like:
>
> <c:out value="${model.myoutput.map['content']}" default=""/>
>
> This does not work and neither does:
>
> <c:out value="${myoutput.map['content']}" default=""/>
>
> I looked at the code in StrutsClientConnector where I think the
> response elements are added to the DynaBean, but I cannot see where
> the elements are added by name. Also as they are added as an array and
> not as a Map so the elements cannot be referenced using something like
> outputs['myoutput']. I seem to remember doing this in Expresso.
>
> Shash, is this the right way of doing it, or is this the stuff that
> you are going to be working on that you mention in your post?
>
This is the stuff I am going to work on. Although, since you can
actually access ".map[]", that means the dynabean stuff I was talking
about is working (as Mike posted later). I got the first step done of
assembling the config files. However, I am yet to build a running
Webwork2 or Maverick-based Keel app., as soon as I get there I'll look
at the JSTL navigation of properties.
> *Problem 2:
>
> *I'm also having difficulty in referencing an Output nested within an
> Output by name using the struts tags. Does someone have an example of
> this please.
>
> Max.
>
>
>> Pierre,
>>
>>> Hello,
>>>
>>> Does anybody use the JSTL core tags in JSP with Outputs (and the
>>> Output ResponseElements)?
>>>
>>> I didn't find the right way to deal with them in tests or loop (c:if
>>> & c:forEach) using EL, even with the help of OutputsInMaverickJSTL
>>> Wiki.
>>>
>>> Regards
>>>
>>> Pierre
>>>
>> As in my last post, this is currently broken since keel-client was
>> restructured a few months back. Basically, only the Struts (and
>> Cocoon, via XML) can deal with "dyna" beans, which Outputs are. As
>> soon as the Maven integration settles out a bit, and I have a
>> sensible workspace back again :-), I'll work on either resurrecting
>> the old support, or, better yet, trying to take advantage of the
>> standard java-bean support which ahs been added.
>>
>> Shash
>>
>> http://keelframework.org/documentation.shtml
>> Keelgroup mailing list
>> [email protected]
>> http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com
>>
>>
>>
>
> http://keelframework.org/documentation.shtml
> Keelgroup mailing list
> [email protected]
> http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com
http://keelframework.org/documentation.shtml
Keelgroup mailing list
[email protected]
http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com