Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6351247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:58:01+00:00 2026-05-24T21:58:01+00:00

I configured my web application like this link http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch17s04.html My context <bean id=freemarkerConfig class=org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer>

  • 0

I configured my web application like this link http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch17s04.html

My context

<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
    <property name="templateLoaderPath" value="/WEB-INF/freemarker/" />
    <property name="freemarkerSettings">
        <props>
            <prop key="tag_syntax">square_bracket</prop>
            <prop key="auto_import">spring.ftl as spring, echannels.ftl as echannels
            </prop>
            <prop key="template_update_delay">2147483647</prop>
        </props>
    </property>
</bean>

<bean id="htmlViewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
    <property name="contentType" value="text/html;charset=ISO-8859-1" />
    <property name="cache" value="${viewResolver.html.cache}" />
    <property name="prefix" value="html/" />
    <property name="suffix" value=".html" />
</bean>

I use spring-webflow to link all my page html.
In my page html, i can access to conversion scope variables by using ${name_variable}.
My question is: how could i access to FreeMarker variable “foo” in my html if i defined it in my context:

<bean id="freemarkerConfig"
    class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
    <property name="templateLoaderPath" value="/WEB-INF/freemarker/" />
    <property name="freemarkerVariables">
        <map>
            <entry key="foo" value="foo" />
        </map>
    </property>
</bean>

Example of my HTML

<html>
<head>
    <title>Welcome</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>

<body>
    <h1>Welcome ${issuerId}</h1>

    <form action="?execution=${flowExecutionKey}" method="post" name="defineFeeForm">
        <input type="submit" name="_eventId_next" value="Next" /> <br/>
    </form>
</body>

I can access to ${issuerId} because i have request.setConversationScope(“issuerId”, “1234”) but i want to access also to foo freemarker variable but when i use ${foo}, i got Expression foo is undefined.
Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:58:02+00:00Added an answer on May 24, 2026 at 9:58 pm

    Thanks to @ddekany , it’s worked, there’re nothing wrong in my configuration. I confused before. :). Yes, foo is visible simply as ${foo}.

    Another remark, if i want to add new variables during running of my application, i can use

    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("foo2", "foo2");
    freeMarkerConfigurer.getConfiguration().setAllSharedVariables(new SimpleHash(variables,  freeMarkerConfigurer.getConfiguration().getObjectWrapper()));
    

    and i can access with ${foo2}.

    Thanks again. It’s done now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Struts2 (2.1.8.1) web application. My web.xml looks like, <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
I have a web application that have standard form authentication declared, like this: <login-config>
On my web application, I had configured my web.config file to set customerrors to
I have an ASP.NET web application that is using forms authentication. Everything is configured
I have a web application that's based on Spring and the application contexts, applicationContext.xml
this is kind of tricky: I have an C# web application running always on
I am using this guide: http://www.asp.net/mvc/tutorials/mvc-music-store-part-7 Like instructed, I entered to ASP.NET Web Application
I am writing a web application using Spring MVC. I am using annotations for
i have a web.config file that looks like this: <?xml version=1.0?> <configuration> <system.web> <compilation
I have a SharePoint 2010 web application that I'd like to use a custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.