• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Transfer data to web page with Freemarker

 
Ranch Hand
Posts: 226
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the situation I have. I have a web application that uses Java and Freemarker templates to create various Web pages at a certain Web site.

This is a snippet from Freemarker template A:

<td class="darkText" ><@spring.message code="assignmentEntry.createdAssignment.lable.insured"/>:</td>
<#if car.insuredName??>
<td class="noteText">${lotSeller.insuredName}</td>
<#else>
<td class="noteText"><@spring.message code="assignmentEntry.summary.lable.na"/></td>
</#if>
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have a question ?
 
Fred Victa
Ranch Hand
Posts: 226
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a class that uses the above template. I also have another template and another class that uses that template. How would I get the data from the above template transferred to another template or class so that the other template or class can use it?
 
Fred Victa
Ranch Hand
Posts: 226
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I get the data in one freemarker template to be recognized by another template?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Templates are part of the View layer, so data doesn't flow out of them to other places. You need to arrange for the data somehow to be available in both classes. Maybe via the user's session, or as a request attribute (assuming both templates are used during the same request).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic