reta commented on issue #453: CXF-7860: Reprocess @FormParam parms so they 
contain the latest data
URL: https://github.com/apache/cxf/pull/453#issuecomment-427585364
 
 
   @andymc12 Thanks a lot for addressing this very edgy case. I was looking how 
the current implementation works and basically I was trying to understand if we 
could defer the evaluation of the HTTP parameters (like `@FormParam`) to a 
later phase. In general, I think it would be feasible but would significantly 
impact the existing design.
   
   However, I think I found a simple trick to make it work: reordering 
parameters initialization. Here is an interesting exercise:
   
   - `Response processForm(@FormParam("value") String value, Form form)` -> 
does not work
   - `Response processForm(Form form, @FormParam("value") String value)` -> 
works just fine
   
   So the idea in the nutshell is to a modify `JAXRSUtils::processParameters` 
to initialize parameters in a different order. In this case, the `Form` should 
be initialized before any `@FormParam`, it triggers the reader interceptors and 
the right values are propagated in `Form` and `@FromParam` arguments. It should 
also work in case of constructors or class members.
   
   What do you think? 
   Thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to