Please see my response to your first message.
Ljava.lang.String *is* an array of strings, and it
wasn't clear to me why you didn't declare your dyna
form field to be an array of strings (you had it as a
single string).
d.
--- Adrian Marrero <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Sorry about reposting this topic and forgetting to
> put a subject the first time.
>
> Here is my issue.
>
> Goal:
> I would like to be able to select multiple fields
> from the drop down
> box, retrieve them in my servlet, and use them
> elsewhere.
>
> I have tried using html:select multiple="true" and I
> continue to
> receive an output
> that I am not expecting and I do not know what I
> need to fix to get what I need.
>
> Problem:
> When I retrieve the String [] in my servlet and I
> view its
> information; what I have
> is a String [] of length = 1 and of type
> "Ljava.lang.String",
> regardless of how many
> selections I make in the drop down box.
>
>
> customProperties.jsp
>
--------------------------------------------------------
> <html:select name="customData"
> property="selectedAttributes"
> multiple="true" size="5">
> <html:options name="moduleProps"
> property="dropDown"
> labelName="moduleProps" labelProperty="dropDown"/>
> </html:select>
>
> CustomData.java (Bean in use)
> ---------------------------------------------
> private String [] selectedAttributes;
>
> public String [] getSelectedAttributes()
> { return this.selectedAttributes;}
>
> public void setSelectedAttributes(String []
> selectedAttributes)
> { this.selectedAttributes = selectedAttributes; }
>
> CustomizeAction.java (Servlet)
> ----------------------------------------------
> CustomData cd = (CustomData)form;
> String [] attr = cd.getSelectedAttributes();
> out.println("Selected attributes size: " +
> attr.length);
> out.println("Selected attributes data: " + attr[0]);
>
> output
> ----------------------------------------------
> Selected attributes size: 1
> Selected attributes data:
> [Ljava.lang.String;@18170f98
>
> Does anyone have an idea of what I can do to
> retrieve in the servlet
> the values that I selected from the drop down menu
> on the jsp page?
> Any suggestions would be really appreciated. Thank
> you in advance for
> you help.
>
> Adrian
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]