Announcement Announcement Module
Collapse
No announcement yet.
spring-cmis & HttpServletRequest Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring-cmis & HttpServletRequest

    Hi

    I wanted to access HttpServletRequest from CMISContentStreamWebScript, which I am modifying.

    When I try to do so, using getRequest() in ServletUtil,

    Code:
                Object tmp = attributes.getAttribute(VIEW_REQUEST_ATTRIBUTE_NAME, RequestAttributes.SCOPE_REQUEST);
    tmp is null, so the method returns null.

    Any suggestions as to how to make this work?

    thanks .. Jason

  • #2
    Hi Jason,
    I'm trying to get the HttpServletRequest, maybe it's the same in your case, try one of these:
    HttpServletRequest httpRequest = ((WebScriptServletRequest)req).getHttpServletReque st();
    or
    HttpServletRequest httpRequest = WebScriptServletRuntime.getHttpServletRequest(req) ;

    where req is WebScriptRequest parameter from execute method in AbstractWebScript.

    When you access that webscript directly, it's ok. BUT when you try to place that webscript inside page, it returns null (i think because req is in this case instance of LocalWebScriptRequest). So I'm asking a question too - how to get HttpServletRequest in webscript?

    Comment


    • #3
      Hi shmoula

      Thank you very much for taking the time to suggest:

      Originally posted by shmoula View Post
      HttpServletRequest httpRequest = WebScriptServletRuntime.getHttpServletRequest(req) ;
      That worked nicely for me :-)

      cheers .. Jason

      Comment


      • #4
        I can't get HttpServletRequest when webscript place inside page too. Any suggestions?
        Thanks!

        Comment

        Working...
        X