struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Brown <mr...@twdata.org>
Subject Re: HTTP method for action-mappings
Date Tue, 05 Jul 2005 18:03:51 GMT
Couldn't you create a custom DispatchAction that also takes into account the 
request method?

Don

Michael Jouravlev wrote:
> At 7:11 PM +0100 7/4/05, Miles, AJ \(Alistair\) wrote:
> 
>>Hi all,
>>
>>A struts-config.xml file is a great way to formally specify a REST
>>API.  However, with struts 1.2 you cannot configure separate action
>>mappings for GET vs POST requests to the same resource.  What about
>>adding a 'method' attribute to the 'action' element?
> 
> 
> I differentiate between POST and GET in the my Struts Dialogs library.
> I need to separate input submitted with POST, from rendering request
> which has GET type. So I have this simple method:
> 
> /**
>  * Returns true if request is considered "input" request. 
>  * By convention dialog input is sent via POST, result page 
>  * is loaded via GET.
>  * @param request The HTTP request we are processing
>  */
>  protected boolean isInput(HttpServletRequest request) {
>    return "POST".equalsIgnoreCase(request.getMethod());
>  }
> 
> Michael.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message