my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android 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: 86
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: 3432
    
  12
Do you have a question ?


Joanne
Fred Victa
Ranch Hand

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

Joined: Mar 22, 2005
Posts: 41134
    
  45
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
 
Don't get me started about those stupid light bulbs.
 
subject: Transfer data to web page with Freemarker
 
Similar Threads
Struts templates
Getting "not a multipart request" even though the image is being saved.
Tiles - need to put html, body tag ?
Help with Web page
layout and multibrowser hell