struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "leonZ" <>
Subject Re: How can I set the defualt selection?
Date Wed, 09 Jul 2003 01:39:39 GMT
example.jsp code segment:
<input type="hidden" name="submit_flag" value="1">
<html:select property="type">
<html:option value="1">1</html:option>
<html:option value="2">2</html:option>
<html:option value="3">3</html:option>

Don't forget adding the set and get method for submit_flag to the code segment:
public ActionForward perform(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) {
        MessageResources messages = getResources();
        Locale locale = getLocale(httpServletRequest);
        String flag =
            ( (exampleForm) actionForm).setType("2");  /** set the defualt
selection **/
            return (new ActionForward(actionMapping.getInput()));   /**
here the example.jsp will be show  **/

and you have to visit the exampleAction(something like
instead of example.jsp for the webpage view.

that's my solution, I hope it will be helpful.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message