Re: How to access a map in jsp

2015-08-27 Thread Yaragalla Muralidhar
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 ListAntibioticDto antibiotics;
  private ListOrganismType organismTypes;
  private MapString, ListString 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
  trtds:property value=antibioticName//td
  s:iterator  value=organismTypes
  td style=width:100pxinput 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



Re: How to access a map in jsp

2015-08-27 Thread Christoph Nenning
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 ListAntibioticDto antibiotics;
 private ListOrganismType organismTypes;
 private MapString, ListString 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
 trtds:property value=antibioticName//td
 s:iterator  value=organismTypes
 td style=width:100pxinput 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