I have a Struts 1 application which works with Velocity as a template language. I shall replace Velocity with Freemarker, and am looking for something similar to 'toolbox.xml'-File from VelocityViewServlet. (there you can map names to Java Classes and, using these names it is possible to access methods and variables of various Java class in the Velocity template). Does someone know, what is possible with Freemarker instead? So far I have found only information about the form beans...would be glad if someone can help....
Has Freemarker something similar to toolbox.xml-file of Velocity?
379 Views Asked by user1132208 At
1
There are 1 best solutions below
Related Questions in STRUTS
- How to disable drop down list in JSP?
- Internal Server error while calling an Java method from JSP
- Spring Security Struts 1.3 integration without extending GrandAuthority and UserDetails
- Persistent authentication filter logging in; not propagating to JSP
- Can Struts 2.3 be used with Struts 1.3?
- Ehcache - Not fetching value from Cache
- Fwd: Issues porting application from tomcat 5.0.28 to tomcat 7.0.57
- Struts 1.2 : Unable to load a jsp as Action class isn't called
- Choosing between Pure HTTPS or HTTP/ HTTPS for a web application
- The background JSP window disappears when a new JSP dialog is displayed
- Passing values in query string in jsp and struts
- getting request variable in DAO
- Struts 2.3: Change scope for Action Beans
- Bootstrap datepicker not showing correctly
- HTML to XHTML conversion without HTML tag
Related Questions in JAVABEANS
- Score book using javabean; how do I get overall average?
- ArrayOutOfBoundsException on Bean creation while using Java 8 constructs
- How to iterate through all properties of a Java bean
- Login in Extjs using java spring Bean
- Looping Arraylist of Arrays java
- Instantiation of bean failed : Specified class is an interface
- The value for the useBean class attribute action.TestBean is invalid. How to correct it?
- Spring factory method
- Need to compare file Id for file uploading in java bean(old file and new file)
- using Primefaces poll to open dialog
- Debug while bean creation
- JSF panelGroup not getting rendered after ajax call
- Javabean Introspector - what is in my List?
- Create separate java bean for an ArrayList property
- Cannot create bean when start the application
Related Questions in VELOCITY
- Calculate new position post rotation
- Java template Framework which has placeholder syntax as {{firstName}}
- Use main args with SpingBoot & velocity
- Must I always have to restart the Tomcat server to clear out Velocity Template cache?
- Link to page not working liferay 6.2 web content template
- How do I access request parameters in kademi templates?
- Unity - Matching Speed While Transistioning From Traveling on a Single Axis to Rotation Around a Circle
- How to get accurate speed from accelerometer on iOS?
- Send email with template (Mandrill JSON)
- Should the scrum master and product owner exclusively manage stories and velocity
- Velocity rendering ; problems with foreach returning true
- Contanate two strings in velocity
- How to access values inside javascript from .vm file
- How do I get Spanish characters to display properly using a Velocity template?
- Spin box/camera around with velocity in SceneKit
Related Questions in FREEMARKER
- send a message using freemarker
- Freemarker Template - User Session context
- FreeMarker support for AngularJS and embedding FTL in JSP
- How can I pass an object value name to a function in Jquery
- Java template Framework which has placeholder syntax as {{firstName}}
- Custom Android Studio code template
- Hot deploying HTML templates generates question marks in the place of chinese characters - only on CentOS
- How can I stop a loop after a certain amount of records are returned?
- What is the springMacroRequestContext called in bind macro of spring.ftl?
- freemarker map with non string keys
- Lifefay freemarker ADT: methods unavailable?
- Controller using Spark framework is nesting html in <pre>
- Not able to include ftl in jsp
- Freemarker Template Not found Exception
- Assigning a setting variable into a local variable in ftl
Related Questions in TOOLBOX
- Detect Matlab startup from toolbox
- Is it reliable & consistent to use Scala ToolBox for Creating Akka FSMs Dynamically?
- The call is ambiguous between the following methods: Identical.NameSpace.InitializeComponent() and Identical.NameSpace.InitializeComponent()
- Activity Monitoring Toolbox missing from WSO2 BAM Server 2.4.0
- iptPointerManager error when using roipoly (MATLAB)
- Where does Visual Studio save code blocks that are dragged on the Toolbox
- How do I make components from other dlls accessible in the VS 2005 Toolbox?
- WPF toolbox installer for a type defined in a different assembly
- How to create a textbox (from toolbox) in asp.net mvc2 web application?
- Visual Studio 2010 auto hide toolbox tab
- Tabs on Silver.UI not updating
- Visual Studio custom control / UserControl not refreshing in ToolBox
- Hide the activity from the toolbox
- Visual Studio toolbox custom controls only visible once
- Visual Studio 2010 Toolbox controls disabled
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
For the utility functions and macros that are View-related (not Model-related), the standard practice is to implement them in FreeMarker and put them into one or more templates and #import (or #include) them. It's also possible to pull in
TemplateDirectiveModel-s andTemplateMethodModelEx-es (these are similar to macros and function, but they are implemented in Java) into the template that you will #import/#inlcude as<#assign foo = 'com.example.Foo'?new()>.As of calling plain static Java methods, you may use the
ObjectWrapper'sgetStaticModels()(assuming it's aBeansWrappersubclass) and then get the required methods asTemplateMethodModelEx-es withstaticModels.get("com.example.MyStatics"). Now that you have them, you can put them into the data-model (Velocity context) in the Controller, or pick methods from them in an #import-ed template, etc. Of course, you can also put POJO objects into the data-model so you can call their non-static methods.The third method, which is not much different from putting things into the data-model is using "shared variables", which are variables (possibly including
TemplateMethodModelEx-es andTemplateDirectiveModel-s) defined on theConfigurationlevel.