Results 1 to 4 of 4

Thread: spring-cmis & HttpServletRequest

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    2

    Default 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. #2
    Join Date
    Dec 2010
    Location
    Brno
    Posts
    15

    Default

    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?

  3. #3
    Join Date
    Dec 2010
    Posts
    2

    Default

    Hi shmoula

    Thank you very much for taking the time to suggest:

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

    cheers .. Jason

  4. #4
    Join Date
    Apr 2011
    Posts
    1

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •