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
- Package[package ognl] of target class[class ognl.MethodFailedException] of target [ognl.MethodFailedException[java.lang.NoSuchFieldError:Factory]]
- cancel button without any action method throws and exception
- Struts 6.x migration issues with sitemesh
- How to call an action method from JSP and pass a parameter in Struts 2
- Upgrading from Struts 2.5 to Struts 6 issue
- How to set base-uri for the Struts 2 CSP Interceptor?
- Struts 2 to Struts 6 Migration
- Struts response raw string
- How can I get metrics in Prometheus for Java Struts application?
- Migration From Struts 2.3.37 to 2.5.33
- java.lang.NoSuchMethodError: org.apache.tiles.impl.BasicTilesContainer.setApplicationContext(Lorg/apache/tiles/request/ApplicationContext;)V
- org.apache.jasper.JasperException: An exception occurred processing [/jsp/include/actionError.jsp] when updated to struts 6.3.0.2
- Why the browser is displaying a blank webpage?
- Struts 2 and JDK 17 numbers in locale
- How to properly escape this JSP code to avoid Stored XSS valnerabilities?
Related Questions in JAVABEANS
- Dynamic bean registration Quarkus
- Spring BeanPostProcessor and inconsistently failing app startup
- Java Beans and the relation to GUIs
- How to solve this beans conflict?
- JSP and JavaBeans, why can't I use a bean method's return value?
- Is there a way to register bean without any @Produces and ect annotations Quarkus
- Why don't data of different clients mix with singleton beans
- Infinite loop during XML file serialization (java.beans)
- Consider defining a bean of type 'service.CloudVendorService' in your configuration error is showing
- Spring Bean Factory
- Why does method reference can be used instead of PropertyChangeListener?
- Obfuscation by Proguard of method targeted by java Property Descriptor
- Camel Karavan VS Code java.lang.ClassNotFoundException from Bean
- Error: creating bean with name 'entityManagerFactory' defined in class path resource
- JavaEE - Strategy Pattern - Error while injecting Lambda
Related Questions in VELOCITY
- Calculate Velocity from Accelerometer of Android Phone
- How to plot quiver vectors of same length and plot streamlines in Matlab?
- Chain of expression in Velocity
- Use velocity macro from a different template
- Cannot resolve variable PACKAGE_NAME with Intellij Ultimate Velocity editor/plugin
- Question about vectors (player velocity) and Spigot API
- VTL Scripting- Splitting a variable string into two variables
- How to work out instant velocities of cars?
- How to use FFT to calculate real time velocity using acceleration measurement data?
- How to make Enemy Sprite Flip?
- The exact syntax of Velocity Template in IDEA Copyright Profile
- Velocity Templating Language dealing with backslashes in input text
- Data Transformation DSL
- Freemarker if statements inside html elements
- Java - file.resource.loader.path not working in AWS EMR
Related Questions in FREEMARKER
- How to pass sensitive data from FreeMarker to JavaScript without exposing it in the browser
- in netsuite advanced pdf im looking to put an asterisk next to my date in my customer statement if the date has elapsed
- Boolean expression if false not working with ?? in freemarker
- How to separate XML tags in freemarker in body function
- Convert .docx to pdf using XDocReport
- Iterating Over Object Keys in Freemarker Templates with SuiteScript 2.1 Custom Data Source
- How to escape Freemarker output of captured assign?
- Struts 6.x migration issues with sitemesh
- I want to custom webauthn-register.ftl using React Keycloaktify, but in Keycloaktify not supported webauthn-register.ftl
- project in intellij not getting imports from other submodules after generating code via freemarker
- Struts 2 to Struts 6 Migration
- Why escape in Struts tags doesn't work after upgrade to Struts 6.3.0.2
- Netsuite Customer Statement (PDF/HTML) - trying to insert posted code to display lines from invoice - but getting errors
- Embed a nextjs - react component into another app using a script
- Unable to import a .ftl file inside my .ftl file - freemarker
Related Questions in TOOLBOX
- how to add Filter menu and Color menu tools to Toolbox in GIMP
- I can't view "Reporting" in Toolbox
- How to change the colour of a ground station when a satellite accesses it? (Matlab Aerospace Toolbox)
- Visual Studio update. Opened a solution in Windows Form VB and there are no controls in my toolbox
- Problems with VS19 ToolBox framework 4.5.2
- Curve Fitting Error MATLAB in checkbounds function
- Which control is the best in the toolbox for me?
- Visual Studio toolbox items disabled after updating to 17.7.2
- What is uavParam and uavParam.ic in "Waypoint Follower for Fixed-Wing UAV" example (UAV toolbox)?
- "Choose items" tool fails to load items and makes Visual Studio 17.7.1 restart
- Splitting toolbox feature dataZoom into components
- How to resolve SElinux denials in android 12 for tcontext with _app extension e.g. tcontext=priv_app
- MATLAB: NaN computed by model function, fitting cannot continue. Try using or tightening upper and lower bounds on coefficients
- AS400 IBM Toolbox for Java doesn't have classes to read Journal in the latest version of Jar JTOpen 400
- CCDr algorithm execution error - Causal Discovery Toolbox
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 # Hahtags
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.