wood burning stoves 2.0*
The moose likes Other Application Frameworks and the fly likes Transfer data to web page with Freemarker Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Transfer data to web page with Freemarker" Watch "Transfer data to web page with Freemarker" New topic
Author

Transfer data to web page with Freemarker

Fred Victa
Ranch Hand

Joined: May 01, 2008
Posts: 78
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

Joined: Aug 05, 2005
Posts: 3169
    
  10
Do you have a question ?


Joanne
Fred Victa
Ranch Hand

Joined: May 01, 2008
Posts: 78
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

Joined: May 01, 2008
Posts: 78
How can I get the data in one freemarker template to be recognized by another template?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
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).


Ping & DNS - updated with new look and Ping home screen widget
 
 
subject: Transfer data to web page with Freemarker
 
Similar Threads
Help with Web page
layout and multibrowser hell
Struts templates
Tiles - need to put html, body tag ?
Getting "not a multipart request" even though the image is being saved.