Results 1 to 5 of 5

Thread: Accessing session from Freemarker page

  1. #1
    Join Date
    Aug 2004
    Posts
    29

    Default Accessing session from Freemarker page

    Does any one know how to do it?
    I want to check in my ftl file if session[user] exists?

  2. #2
    Join Date
    Dec 2004
    Location
    Alexandria, Egypt
    Posts
    1

    Default

    Hello Hani:
    I faced the same problem, and according to davison's reply
    http://forum.springframework.org/sho...ssion&start=15

    you just have to add
    <property name="exposeSessionAttributes"><value>true</value></property>

    to the Freemarker view resolver

    good luck

    Tamer
    Last edited by robyn; May 19th, 2006 at 05:11 AM.

  3. #3
    Join Date
    Aug 2004
    Posts
    29

    Default

    Thanks Tamer,
    This solved my problem, I had originally used an interceptor, but this is
    really what I was looking for.

    Hani

  4. #4

    Default

    Hi All,

    is there a way to expose the response too? Or is there a better approach to rewrite URLs with freemarker? I'd like to use somthing like:

    ${response.encodeURL("/path/to/document.ext")}

    Any ideas how to do this?

    -andi


    PS: I'm aware of the url internal, but it does not do what i need. the call must go to response.encodeURL() so that servlet filters can be applied.

  5. #5

    Default

    For the lurkers: Since there seems to be no official way to make response available, i opened a JIRA issue providing an example implementation (class inherits from FreeMarkerView.

    http://opensource.atlassian.com/proj...browse/SPR-929

    -andi

Similar Threads

  1. OpenSessionInView and portlet support
    By garpinc2 in forum Web Flow
    Replies: 31
    Last Post: Apr 9th, 2010, 11:12 AM
  2. Pageable data list with Hibernate
    By robmorgan in forum Data
    Replies: 23
    Last Post: Jul 24th, 2006, 06:12 PM
  3. Replies: 0
    Last Post: Apr 26th, 2005, 08:54 PM
  4. Replies: 1
    Last Post: Mar 12th, 2005, 04:33 AM
  5. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM

Posting Permissions

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