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>
</html:select>
...

Don't forget adding the set and get method for submit_flag to the
exampleForm.java

exampleAction.java code segment:
...
public ActionForward perform(ActionMapping actionMapping, ActionForm
actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
httpServletResponse) {
        MessageResources messages = getResources();
        Locale locale = getLocale(httpServletRequest);
        String flag =
httpServletRequest.getParameter("submit_flag")==null?"":httpServletRequest.g
etParameter("submit_flag");
        if(flag.equals("")){
            ( (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 exampleAction.do)
instead of example.jsp for the webpage view.

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






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to