Using velocity as a page display layer is common, as a template form appears, may not be used more, at least now I have only used a few times, the following is also found in an article, for example, the use of velocity as a template, or very practical.
Typically, the file suffix of the velocity template is ". VM". Here we create a HELLOVELOCITY.VM template file,
ObjectiveFor the velocity and SPRINGMVC configuration please refer to the previous article, which is not covered here. The main purpose of velocity as a Java template engine is to allow anyone to reference objects defined in Java code using a simple and powerful template language. You can specify a template layout for this page in the velocity file, saving a lot
The velocity project is an application platform for distributed caching, providing support for developing scalability, available, high-performance applications, Vekicity provides a unified cache for applications using multiple computers, and a specific introduction to velocity is available in the vekicity Team blog:http://blogs.msdn.com/velocity/default.aspx,
There are two ways to integrate struts2 with velocity
1, mainly to struts2. Struts2 built-in support for velocity, as long as the Issue: When accessing VM files directly, the source code of the VM is output. How to prohibit direct access to *.VM type files.
Benefit: You can use similar struts tags. I always feel that this is a strange use.
2, with velocity as t
An example of Velocity application keywords : Java, JSP, Servlet, template, templates, Apache, Jakarta, VelocityReader Requirements : Understanding Java Servlet Basic ConceptsVelocity is a general-purpose, java-based template tool that comes from jakarta.apache.org.Velocity is a reference to the velocity--Java Web development technology . Here is an example of its application.This example refers to the stru
The project structure is as shown in the screenshot:
1, first, the introduction of velocity programming required jar package, build all kinds of files. Under the required JAR package:
2. Configure the Web. xml file
Hellohandler.java specific code is as follows:
public class Hellohandler extends velocityviewservlet{private static final long serialversionuid = 1L;
Private Velocityengine Velo; @Override public void Init () throws servletexce
There are several ways to determine if it is null:
1. #if (! $foo) determine that $foo is empty and that non-null is #if ($foo)
2. Use #ifnull () or #ifnotnull ()
#ifnull ($foo)
To use this feature, you must include the following in the Velocity.properties file:
userdirective = org.apache.velocity.tools.generic.directive.Ifnull
userdirective = Org.apache.velocity.tools.generic.directive.Ifnotnull
3. Use the null tool to determine
#if ($null. IsNull ($foo))
Note that this is especially useful,
Problem Description:
In the context of using the Velocity template engine, when using jquery, such as: $.fullcalendar.gcalfeed (' http://www.google.com/calendar/feeds/sfzc1% 40realintelligence.com/public/basic ')
where $ conflicts with velocity variables.
Solution:
Define a velocity variable: #set ($jquery = "$.") Then: ${jquery}fullcalendar.gcalfeed
For this issue please refer to:
http://www.oschina.net/question/100267_20922
Turn the content on the post and add your own solution.
Tsl0922 said: "
Beginner velocity, want to write a Velocitytool class implementation to embed dynamic pages in a relative path, the idea is roughly the same as in http://www.oschina.net/code/snippet_12_694, because the new version of the Init (Object ARG0) method has been Deprecated , swap with configure (MAP props) (s
The configuration of a rigid mobile robot is usually described in 6 variables: his three-dimensional Cartesian coordinate system, and the relative external coordinate system of three Euler angles (RPY roll, pitch, yaw), so in the plane environment generally with three variables can be described, called posture.So in general, the posture information of a robot is a two-dimensional planar coordinate (x, y) of a robot and its azimuth Θ\theta, which is represented by this vector:⎛⎝⎜xyθ⎞⎠⎟\begin{pmat
Web| Solutions | questions | Chinese
Webwork+velocity Chinese Problem Resolution: 1, Webwork.properties file, add:
webwork.i18n.encoding = GB2312
It is primarily used to set the encoding of the WebWork UI tag library If it is not set to pass
System.getproperty ("file.encoding") to obtain the default character encoding. 2, Velocity.properties file, add:
input.encoding=gb2312
output.encoding=gb2312
default.contenttype=text/html; charset=gb2312
It
In a few simple steps, implement the use of the velocity or freemarker template to construct the page in spring boot and return to the front end:
1. Introduce dependencies and create templates directory:
velocity:http://blog.csdn.net/clementad/article/details/51819647
freemarker:http://blog.csdn.net/clementad/article/details/51942629
2. Create template file:
Create two files, one corresponding to the normal page, file name:
Velocity:welc
Installation steps:1. Help->install New software in eclipse ... Point "add" plus velocityeclipse, value: http://veloeclipse.googlecode.com/svn/trunk/update/The interface then removes the hooks from the Group Items by Catagory , and then next begins ...2. After installation, it's ready to start.Other:By default, the JS code will be a silver color and look uncomfortable. Suggest a change,Colors are changed by: Windows--perferences---veloeclipse--and script code---colorInstalling the
There are a few steps that are modified in the spring Web [sevlet-name]-servlet.xml file to:Boldface fonts are key, others are configured according to your situation:Note:First of all, to ensure that the development environment of the file encoding unified, the jsp/html character encoding is declared as Utf-8.Spring Velocity Chinese garbled solution
In web development, there is often a need to determine whether a variable is empty (null) or an empty string (""), which affects the presentation logic of the page, and there is a corresponding method in velocity that can be judged. Of course, you can also convert the Java backend to a valid value before judging. The following is my own summary in the development, I hope to help you.
(1) determine null
#if ($name = null)
something code
#end
(2) to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.