i have added methods to get the primitive integers as strings in dto. that solved my problem. thanks Christoph.
*Thanks and Regards,* Muralidhar Yaragalla. *http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>* On Thu, Aug 27, 2015 at 2:56 PM, Christoph Nenning < christoph.nenn...@lex-com.net> wrote: > What are the types of antibioticId and organismTypeId ? > Are they primitive integers/longs? > I would add methods to DTOs to get them as Strings. > > > I suggest to store the list in a pageScope variable, to make the > expression better readable. > There should be no dot before the bracket. You wrote "oaMap.[", it should > be "oaMap[" > > > > <s:set var="_oaList" value="oaMap[antibioticId]" /> > <s:if test="_oaList.contains(organismTypeId)">.... > > > > > > Regards, > Christoph > > > > > > > Yaragalla Muralidhar <yaragallamur...@gmail.com> schrieb am 27.08.2015 > 11:17:06: > > > From: Yaragalla Muralidhar <yaragallamur...@gmail.com> > > To: Struts Users Mailing List <user@struts.apache.org>, > > Date: 27.08.2015 11:17 > > Subject: How to access a map in jsp > > > > Hi, > > the following is the code in action class > > > > //_________________________________________________ > > private List<AntibioticDto> antibiotics; > > private List<OrganismType> organismTypes; > > private Map<String, List<String>> oaMap; > > @Override > > public String execute() throws Exception { > > try{ > > antibiotics=dtService.getAllAntibioticsList(); > > organismTypes=dtService.getAllOrganisumTypes(); > > oaMap=dtService.getAllSelectedOrganismTypeAntibiotics(); > > }catch(Exception e){ > > log.error(e.getMessage(), e); > > return "error"; > > } > > return SUCCESS; > > } > > //_________________________________________________________ > > > > The following is the code in jsp > > > > <s:iterator value="antibiotics" status="status"> > > <tr><td><s:property value="antibioticName"/></td> > > <s:iterator value="organismTypes"> > > <td style="width:100px"><input type="checkbox" <s:if > test="%{oaMap.[((new > > Integer(antibioticId).toString()))].contains((new > > Integer(organismTypeId).toString()))}">checked</s:if> value='<s:property > > value="antibioticId"/>' style="line-height: 35px;" /></td> > > </s:iterator> > > </tr> > > </s:iterator> > > > > //______________________________________________________________ > > > > i am trying to get the arrylist from the map and trying to check whether > it > > contains a particular string but this is not working? is this the right > way > > to do this? If not how to do this? > > > > *Thanks and Regards,* > > Muralidhar Yaragalla. > > > > *http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>* > > This Email was scanned by Sophos Anti Virus >