struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alley sys <sysal...@hotmail.com>
Subject RE: ParameterAware Issue
Date Sun, 05 Oct 2008 07:23:28 GMT

hi,
thanks for your quick reply. i checked the code
it shows nothing.
 
code:
 Object o = getParameters().get("partyid");         if (o instanceof String) {           
 System.out.println("String = " + o);         } else if (o instanceof String[]) {        
    String[] a = (String[]) o;             for(int i = 0; i < a.length; i++) {        
        System.out.println("String partyid:"+a[i]);             }         }
 
output:
17:20:08,643 INFO  [STDOUT] String partyid:
but the value is there
partyid=[Ljava.lang.String;@38bbd7}
i don't know why it doesn't shows ?
> Date: Sat, 4 Oct 2008 17:53:05 +0200> From: lukasz.lenart@googlemail.com> To: user@struts.apache.org>
Subject: Re: ParameterAware Issue> > 2008/10/4 alley sys <sysalley@hotmail.com>:>
> thanks for your mail. yeah it shows 1 value is there having address> > but i need
the value not address> > I'm not sure if I understood you, but if it shows 1, you should
be> able to access it as a array, but if it's only one element, OGNL> shouldn't create
an array, maybe try something like this> > Object o = parameters.get("par");> if
(o instanceof String) {> System.out.println("String = " + o);> } else if (o instanceof
String[]) {> String[] a = (String[]) o;> for(int i = 0; i < a.length; i++) {>
System.out.println(a[i]);> }> }> > > Regards> -- > Lukasz> http://www.lenart.org.pl/>
> ---------------------------------------------------------------------> To unsubscribe,
e-mail: user-unsubscribe@struts.apache.org> For additional commands, e-mail: user-help@struts.apache.org>

_________________________________________________________________


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message