zoukankan      html  css  js  c++  java
  • velocity

    Ok, lets start off with some easy examples. These examples really do not even touch on the basics of correct design. However, they still make good examples because correct design is often harder than showing a simple example. We will show better examples further along in this essay.

    For the first example, we show that there are two different approaches of doing the same exact thing using both JSP and Velocity. This is an example of printing out a parameter with JSP:

    <html>
    <head><title>Hello</title></head>
    <body>
    <h1>
    <%
    if (request.getParameter("name") == null) {
       out.println("Hello World");
    }
    else {
      out.println("Hello, " + request.getParameter("name"));
    }
    %>
    </h1>
    </body></html>

    This is an example of doing the same thing with Velocity:

    <html>
    <head><title>Hello</title></head>
    <body>
    <h1>
    #if ($request.getParameter("name") == null)
       Hello World
    #else
       Hello, $request.getParameter("name")
    #end
    </h1>
    </body></html>
  • 相关阅读:
    axios 封装
    Git 常用命令行
    React Native 开发环境搭建
    React Native 组件分类
    日期插件rolldate.js的使用
    单图片上传
    使用css完成物流进度的样式
    搜索过滤 以及排序
    v-for的使用方法
    v-if 和v-show 用法
  • 原文地址:https://www.cnblogs.com/lexus/p/2580635.html
Copyright © 2011-2022 走看看