[ 
https://issues.apache.org/jira/browse/OFBIZ-10438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16524609#comment-16524609
 ] 

Shi Jinghai commented on OFBIZ-10438:
-------------------------------------

Hi Mathieu,

Your new patches are in rev. 1834465.

I tested them and all 3 cases listed above are OK.

And method="" and method="all" are OK. I insist to support method="" as 
according to the xsd, it's allowed and should be parsed as method="all".  

I'm happy you returned to doGet/doPost, I guess you read this tomcat document 
(the service method tortured me for a while)

https://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpServlet.html

 
{code:java}
...
There's almost no reason to override the service method. service handles 
standard HTTP requests by dispatching them to the handler methods for each HTTP 
request type (the doXXX methods listed above).
...{code}
I have to say, you're very sensitive and smart. My last beg, could you remove 
the java.util.Optional(since JDK 1.8) to make the patches can be backported to 
OFBiz 14.07?

Kind Regards,

 

> Add method attribute to request-map to controll a uri can be called GET or 
> POST only
> ------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-10438
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10438
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Shi Jinghai
>            Assignee: Shi Jinghai
>            Priority: Minor
>         Attachments: 
> OFBIZ-10438_0001-Improved-Add-ControlServlet-service-method.patch, 
> OFBIZ-10438_0002-Improved-Add-optional-method-attribute-in-request-ma.patch, 
> OFBIZ-10438_0003-Improved-Factorize-default-request-search-in-Request.patch, 
> OFBIZ-10438_0004-Improved-Add-RequestHandler-resolveURI-method.patch, 
> OFBIZ-10438_0005-Improved-Parse-controller-config-in-one-place.patch, 
> OFBIZ-10438_0006-Improved-Split-resolveURI-in-two-methods.patch
>
>
> As discussed in OFBIZ-4274, OFBiz runs doGet method in ControlServlet no 
> matter what request it is.
> I like Mathieu's comment on adding a method attribute to the request-map 
> element, it's almost the same as we implemented in our openapi:
>  
> {code:java}
> <request-map uri="examples" method="get">
>    <security https="true" auth="true"/>
>    <event type="java" path="ExamplesHandlers" invoke="getExamples"/>
>    <response name="success" type="view" value="..."/>
>    <response name="error" type="view" value="..."/>
> </request-map>
> {code}
>  The difference is that we DON'T support method list expression:
> {code:java}
> <request-map uri="examples" method="get,post">...</request-map>
> {code}
>   
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to