Announcement Announcement Module
No announcement yet.
Writing a custom HTTP inbound gateway Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Writing a custom HTTP inbound gateway


    I have found that the HTTP Inbound Gateway does not have exactly what I need (i.e. I need to obtain some fields from the HttpServletRequest object as well as some headers), so I am looking to write a custom inbound gateway that sends a payload of a map of maps: parameter map, header map, and a map of HttpServletRequest fields. However, all the examples in the Manning book and the reference HTML seem to implement gateways as outbound only.

    Is there an example custom inbound gateway project?

    Let me back up: is there a way to get the HttpServletRequest object in the spring-provided HTTP Inbound Gateway?

    Thank you

  • #2
    Gateways of this type are simple beans so you can just subclass the existing gateway and declare it using a <bean/> definition.

    That said, requestParameters are available using the SpEL '#requestParams' variable in the <header/> child element 'expression' attribute ('#pathVariables' from ReST-style URLs are also available).

    If you really must get a reference to the servlet request itself, you can use the technique described here: