tags:

views:

382

answers:

1

Hi

I would like to pass Multiple parameters for single param in action tag.

Ex:

<action name="question" class="com.xxx.xxx.action"> <param name="hint">abc</param> <result name="success">Answers.jsp</result> </action>

I have getters and setters for hint (String) variable in my action.

Currently i can be able to get parameter value for hint variable as abc if i send one.

I would like to send multiple parameters for same variable(hint)

ex: <param name="hint">abc, xyz</param>

how can achieve the above.

Thanks in advance Raju

A: 

I don't think you can do that, apart from the obvious hacks For example, just write the above in you mapping and in your action convert the string to a array

  String[] getHintsArray() {
       return getParam("hint").split("\\s*,\\s*");
   } 
leonbloy
Thanks for the reply...I tried in similar way it worked but i thought is there any other way to do it in struts2 ?
raju