struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: Struts 2.0.11 from 2.0.9 EL Expression problem
Date Tue, 26 Aug 2008 01:13:46 GMT
(FYI, the OGNL conversion section says "todo" :) In this case it's not quite as straight-forward,
though, since the OP was *relying* on the ability to have the expression pre-evaluated before
it hit OGNL.

Dave

--- On Mon, 8/25/08, Gabriel Belingueres <belingueres@gmail.com> wrote:

> From: Gabriel Belingueres <belingueres@gmail.com>
> Subject: Re: Struts 2.0.11 from 2.0.9 EL Expression problem
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Date: Monday, August 25, 2008, 9:08 PM
> Please note that from S2 2.0.11.x it is illegal to call
> Struts tags
> using EL expressions in tag attributes [1], you only can
> use OGNL
> expressions. Upgrading should be a straightforward step
> [2].
> 
> [1]
> http://struts.apache.org/2.0.11.2/docs/release-notes-2011.html
> [2]
> http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-ConvertELexpressionstoOGNL
> 
> 2008/8/25 crappycrumpet <pandamouse@hotmail.com>:
> >
> > Yes the select code was meant to be a generic select
> where I can just bung it
> > in the struts.xml for different Action classes that
> has the values for
> > fieldName, list (vector of object), listKey, listValue
> so that I can just
> > make select dropdowns without making more coding. So
> when I make assorted
> > form pages which has a dog dropdown for example I can
> put in field name
> > required for that form dogId or altDogId and it would
> use the same action to
> > generate the dropdown.
> >
> > Here my DogAction as an example.
> > http://www.nabble.com/file/p19153375/DogAction.java
> DogAction.java
> >
> > Here's my dog object.
> > http://www.nabble.com/file/p19153375/Dog.java Dog.java
> >
> > And my action config in struts.xml:
> > <package name="pet"
> extends="petshop" namespace="/pet">
> >        <action name="dog_select"
> method="doGetList"
> >
> class="com.petshop.struts.actions.DogAction">
> >            Dog
> >            id
> >            name
> >            false
> >            <result
> type="tiles">widget.generic_select</result>
> >        </action>
> > </package>
> >
> > Then I can all it like this:
> >
> https://localhost/petshop/pet/dog_select.do?fieldName=dogId&defaultValue=0&defaultName=All&required=false&theme=filter&debug=console
> >
> > Here is my generic_select.jsp that used to work in
> struts 2.0.9:
> > <%@ taglib prefix="s"
> uri="/struts-tags" %>
> >
> > <s:if test="param.fieldName" >
> >    <s:if test="multiple" >
> >        <s:select
> name="${param.fieldName}"
> >              list='list'
> >              listKey='${listKey}'
> >              listValue='${listValue}'
> >              multiple='true'
> >             
> onchange="dojo.event.topic.publish('${param.fieldName}',
> > {dropdown:this})"
> >              size='8'
> >              required="${param.required}"
> >        />
> >    </s:if>
> >    <s:else>
> >        <s:select
> name="${param.fieldName}"
> >              list='list'
> >              listKey='${listKey}'
> >              listValue='${listValue}'
> >             
> headerKey="${param.defaultValue}"
> >             
> headerValue="${param.defaultName}"
> >             
> onchange="dojo.event.topic.publish('${param.fieldName}',
> > {dropdown:this})"
> >              required="${param.required}"
> >        />
> >    </s:else>
> > </s:if>
> > <s:else>
> >    <s:select name="${fieldName}"
> >          label="${label}"
> >          list='list'
> >          listKey='${listKey}'
> >          listValue='${listValue}'
> >          headerKey="${param.defaultValue}"
> >          headerValue="${param.defaultName}"
> >         
> onchange="dojo.event.topic.publish('${fieldName}',
> > {dropdown:this})"
> >          required="${param.required}"
> >          theme="${param.theme}"
> >        />
> > </s:else>
> >
> > And finally my tile.xml setting for generic select:
> > <definition name="widget.generic_select"
> > template="/tiles/generic_select.jsp"/>
> > --
> > View this message in context:
> http://www.nabble.com/Struts-2.0.11-from-2.0.9-EL-Expression-problem-tp19100876p19153375.html
> > Sent from the Struts - User mailing list archive at
> Nabble.com.
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org

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


Mime
View raw message