spring mvc 整合freemarker模板

2022-06-18 17:30:14 字數 1004 閱讀 3332

主要使用到的jar 檔案:spring mvc +freemarker.jar

第一步:spring mvc 整合 freemarker 

[html]view plain

copy

bean>  

bean>  

map>  

property>  

3600prop>  

zh_cnprop>  

yyyy-mm-dd hh:mm:ssprop>  

yyyy-mm-ddprop>  

#.##prop>  

props>  

property>  

bean>  

【重點:在jsp和freemarker的配置項中都有乙個order property,上面例子是把freemarker的order設定為0,jsp為1。意思是找view時,先找ftl檔案,再找jsp檔案做為檢視。】

第二步:controller**

[html]view plain

copy

package com.wlsq.controller;  

import org.springframework.stereotype.controller;  

import org.springframework.web.bind.annotation.requestmethod;  

import org.springframework.web.servlet.modelandview;  

@controller  

public class freemarkertest   

}  第三步:testfreemarker/index.ftl

[html]view plain

copy

$title>  

head>  

$b>

html>  

SpringMVC整合hibernate的問題

我想實現多個查詢 類似於這樣的,三個文字框,填寫哪個按照哪個條件查詢,都不填就全查詢。這個的實現。repository public class userdaoimpl implements userdao 根據乙個起止日期查詢之後所有記錄 public listgetuserlistbydatet...

springMvc整合集群

springmvc整合集群 springmvc整合集群,集群的位址要都寫到,寫的形式不盡相同 mq集群連線 spring整合mq集群 那麼在集群下spring整合的時候需要修改位址方式 class org.springframework.jms.connection.cachingconnectio...

springmvc整合xhEditor編輯器的使用

一.簡介 xheditor是乙個基於 jquery 開發的簡單迷你並且高效的視覺化 xhtml 編輯器。二.用法 2.jsp中的配置 首先引入xheditor外掛程式包下面的xheditor 1.2.1.min.js以及iframe.css以及ui.css 然後編輯器的配置 textarea中只要指...