Announcement Announcement Module
Collapse
No announcement yet.
Accessing session from Freemarker page Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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, 06:11 AM.

    Comment


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

      Hani

      Comment


      • #4
        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.

        Comment


        • #5
          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

          Comment

          Working...
          X