Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transfer data to web page with Freemarker

 
Fred Victa
Ranch Hand
Posts: 189
1
  • Mark post as helpful
  • send pies
  • 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>
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a question ?
 
Fred Victa
Ranch Hand
Posts: 189
1
  • Mark post as helpful
  • send pies
  • 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: 189
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I get the data in one freemarker template to be recognized by another template?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • 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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic