aspose file tools*
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
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: 90
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: 3689
    
  16
Do you have a question ?


Joanne
Fred Victa
Ranch Hand

Joined: May 01, 2008
Posts: 90
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: 90
How can I get the data in one freemarker template to be recognized by another template?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42292
    
  64
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 - my free Android networking tools app
 
 
subject: Transfer data to web page with Freemarker