Another approach is to pass the query string options using the
"parameter" property of the action mapping, and then looking for them in
your action. So, passing a parameter like "task=select" could also be
represented as: 

            <action 
                parameter="select"
                path="/lot/Search"
                type="org.wxxi.gavel.lot.http.Access"
                name="lotForm"
                scope="request"
                validate="false"
                input="/do/lot/Done">
                <forward 
                    name="continue"  
                    path="/WEB-INF/pages/lot/Result.jsp"/> 
            </action>

and in the Action

        // -- Acquire other parameters
        String task mapping.getParameter();
            if (task==null) task = request.getParameter("task");

Of course, if you need to pass several parameters, the query string
approach (using &amp; for &) will let the servlet parse them out for
you.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/

Jacob Thomas wrote:
> 
> Hi Jon,
>         I was trying this out earlier using the Struts beta 1 release and
> found that query strings with multiple parameters caused the XML parser to
> give errors when it encountered either the '&' or '?' character.
> 
> <forward  name="command"
> path="/context/page.jsp?param1=value1&param2=value2&...."/>
> 
> Based on your and Craig's feedback, I take it that this is now supported.
> --
> Thanks
> Jacob

Reply via email to