- 浏览: 79565 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (98)
- Linux (6)
- vsftpd vsftp ftp (2)
- perl flock (1)
- ajax (1)
- highcharts (1)
- http://www.bejson.com/knownjson/webInterface/ (1)
- mysql (1)
- iOS研究框架之SDwebimage原理 (1)
- oepn ssl (1)
- mysql插入时间戳列 (1)
- mysql pool (1)
- gsoap (1)
- VS (1)
- angular http jsonp (1)
- NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL (1)
- http://www.cnblogs.com/madyina/p/5970814.html (1)
- 批量生成各尺寸的iOS图标 (1)
- Ionic2 Rest 认证 (1)
- 反编译工具 IDA (1)
- formbuilder (1)
- asp.net com 80040154 Class not registered (1)
- angular2-highcharts用法详解 (1)
- 儿童教育资源 (1)
- Accordion List with Ionic (1)
- 清华附小权威老师推荐详细书单 (0)
- android (1)
- Hexadecimal -> file (binary) (1)
- open ssl (1)
- swift apple (1)
- 常见网址 (0)
- Charles4.2.5 (1)
- swift link (1)
- 域名 空间申请 (0)
- 常见网址 免费主机 (1)
- 最详细的美国旅游签证办理流程 (1)
- 公司办理美国签证流程 (0)
- link (1)
- 楼市 (0)
- inatall uml (1)
- 信用卡 (0)
- net use 共享 删除 (1)
- perl ftp (1)
- cron (1)
- 2018 self evauation (0)
- upload by ftp linux script (1)
- 青少年学习 (1)
- Shell脚本交互之:自动输入密码 (1)
- 通过ffmpeg实现视频流截图 (1)
- Discuz论坛迁移--数据库配置文件 (1)
- ELK(ElasticSearch (1)
- Logstash (1)
- Kibana)搭建实时日志分析平台 (1)
- 阿里面试题目目录 (1)
- network-attached storage (NAS) (1)
- jar (1)
- PostgreSQL操作-psql基本命令 (0)
- PostGreSQL (1)
- 百度网盘资源搜索 (1)
- git command (1)
- log4perl MinGW Dev C++ (1)
- perl 自定义模块 (1)
- 使用virt-manager安装和管理虚拟机 (1)
- ActivePerl5.14 (1)
- servicenter (1)
- 民国货币 (0)
- 物价变迁 (0)
- 历年养老金涨幅 (1)
- 1987年北京物价 (1)
- 金融业总资产 (1)
- 中国通史 (0)
- How to change @INC to find Perl modules in non-standard locations (1)
- ruby on rails (1)
- win10 ruby (1)
- Sybase isql常用命令 (1)
- php开发环境搭建 (1)
- check_Radius_Account.php (1)
- SymmetricDS (1)
- Kotlin Eclipse 环境搭建 (1)
- 基于SpringBoot搭建应用开发框架 基于SpringBoot-Dubbo的微服务快速开发框架 (1)
- 架构师技术图谱,助你早日成为架构师 (1)
- Java并发编程:volatile关键字解析 (1)
- MySQL 表锁和行锁机制 (1)
- IntelliJ IDEA 2018激活码 永久破解 (0)
- 基于 Javassist 和 Javaagent 实现动态切面 (1)
- JAVA必背面试题和项目面试通关要点(带答案) (1)
- Hadoop分布式集群的搭建 (1)
- navicat112_premium (0)
- snmp trap (1)
- net snmp linux (1)
- net snmp trap (1)
- install wmi in linux (1)
- vidyard (0)
- compare file content (1)
- XINETD TCP echo service (1)
- 从页面获取form表单提交的数据 (1)
- thymeleaf 分页 级联 (1)
- Apache log4j2 远程命令执行漏洞复现及修复方案 (1)
- win7 瘦身 (0)
最新评论
Thymeleaf 分页功能
https://www.iteye.com/blog/gjp014-2387037
Thymeleaf select 使用 和多select 级联选择
https://www.iteye.com/blog/gjp014-2395655
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.w3.org/1999/xhtml" layout:decorator="thymeleaf/templates/layout.html">
<head>
<script type="text/javascript" th:src="@{/js/sgo/endpoint.js}"></script>
<title>Endpoint Form</title>
</head>
<body>
<div layout:fragment="content">
<form action="#" id="endpoint-form" th:object="${endpointForm}" method="post"
th:action="@{/{deviceAction} (deviceAction=${endpointForm.id == null ? 'add-endpoint.mvc' :'endpoints/'+endpointForm.id+'/updateendpoint.mvc'})}" >
<input th:type="hidden" th:field="*{id}" th:if="${endpointForm.id != null}" />
<div th:if="${#fields.hasErrors('*')} or ${resultList != null}" class="alert alert-danger" role="alert">
<ul>
<li th:each="e : ${#fields.detailedErrors()}" th:class="${e.global}? globalerr : fielderr">
<span th:text="${e.global}? '*' : ${e.fieldName}">The field name</span> -
<span th:text="${e.message}">The error message</span>
</li>
<li th:each="r : ${resultList}" th:class="globalerr">
<span th:text="'*'">The field name</span> -
<span th:text="${r.getMessage()}">The error message</span>
</li>
</ul>
</div>
<div th:if="${success != null}" class="alert alert-success" role="alert" th:text="${success}" />
<div class="form-group" th:name="endPointName" th:errorclass="has-error">
<label class="control-label" th:for="endPointName">Endpoint Name <span class="glyphicon glyphicon-asterisk"></span></label>
<input type="text" th:field="*{endPointName}" class="form-control required" id="endPointName"/>
</div>
<div class="row-fluid col-md-12">
<div class="form-group col-md-2" th:name="EPSTypeID" th:errorclass="has-error">
<label class="control-label" th:for="EPSTypeID">Endpoint Type Id <span class="glyphicon glyphicon-asterisk"></span></label>
<select size ="5" th:field="*{EPSTypeID}" class="form-control" id="EPSTypeID">
<option th:each="epsTypes : ${epsTypes}"
th:value="${epsTypes.id}"
th:text="${epsTypes.name}">Endpoint Type Id</option>
</select>
</div>
<div class="form-group col-md-2" th:name="msoId" th:errorclass="has-error" >
<label class="control-label" th:for="msoId">MSO Id <span class="glyphicon glyphicon-asterisk"></span></label>
<select size ="5" th:field="*{msoId}" class="form-control" id="msoID">
<option th:each="mso : ${mso}"
th:value="${mso.id}"
th:text="${mso.name}">MSO Id</option>
</select>
</div>
</div>
<!--div class="row-fluid col-md-12">
<div class="form-group col-md-2" th:name="city" th:errorclass="has-error">
<label class="control-label" th:for="city">City <span class="glyphicon glyphicon-asterisk"></span></label>
<input type="text" th:field="*{city}" class="form-control required" />
</div>
<div class="form-group col-md-2" th:name="state" th:errorclass="has-error" >
<label class="control-label" th:for="state">State </label>
<input type="text" th:field="*{state}" class="form-control required" />
</div>
<div class="form-group col-md-2" th:name="province" th:errorclass="has-error" >
<label class="control-label" th:for="province">Province </label>
<input type="text" th:field="*{province}" class="form-control required" />
</div>
<div class="form-group col-md-2" th:name="country" th:errorclass="has-error" >
<label class="control-label" th:for="country">Country <span class="glyphicon glyphicon-asterisk"></span></label>
<input type="text" th:field="*{country}" class="form-control required" />
</div>
</div-->
<div class="row-fluid col-md-12">
<div class="form-group col-md-2" th:name="country" th:errorclass="has-error" >
<label class="control-label" th:for="country">Country <span class="glyphicon glyphicon-asterisk"></span></label>
<select size ="5" th:field="*{country}" class="form-control" name="startArea1" id="start_select1">
<!--option value="">Choose Country</option-->
<option th:each="country:${country}" th:value="${country.id}" th:text="${country.name}" ></option>
</select>
</div>
<div class="form-group col-md-2" th:name="state" th:errorclass="has-error" >
<label class="control-label" th:for="state">State </label>
<select size ="5" class="form-control" th:field="*{state}" name="startArea3" id="start_select3">
<!--option value="">Choose State</option-->
<option th:each="state : ${state}"
th:value="${state.id}"
th:text="${state.name}">State</option>
</select>
</div>
<div class="form-group col-md-2" th:name="province" th:errorclass="has-error" >
<label class="control-label" th:for="province">Province </label>
<!--select class="form-control" name="startArea2" id="start_select2">
<option value="">Choose Province</option>
</select-->
<select size ="5" class="form-control" th:field="*{province}" id="start_select2">
<option th:each="province : ${province}"
th:value="${province.id}"
th:text="${province.name}">Province</option>
</select>
</div>
<div class="form-group col-md-2" th:name="city" th:errorclass="has-error">
<label class="control-label" th:for="city">City <span class="glyphicon glyphicon-asterisk"></span></label>
<select size ="5" class="form-control" th:field="*{city}" name="startArea4" id="start_select4">
<!--option value="">Choose City</option-->
<option th:each="city : ${city}"
th:value="${city.id}"
th:text="${city.name}">City</option>
</select>
</div>
</div>
<div class="form-group" th:name="timezoneName" th:errorclass="has-error">
<label class="control-label" th:for="TimezoneID">Timezone <span class="glyphicon glyphicon-asterisk"></span></label>
<input type="text" th:field="*{timezoneName}" class="form-control required" id="timezoneName"/>
</div>
<button type="submit" class="btn btn-sm btn-primary" id="endpoint-submit" th:text="${endpointForm.id == null ? 'Create' : 'Update'}">Create</button>
<a th:href="@{{deviceAction} (deviceAction=${endpointForm.id == null ? 'endpoints.mvc' :'/endpoints/'+endpointForm.id+'/devices.mvc'})}" title="Cancel" class="btn btn-sm btn-primary">Cancel</a>
</form>
</div>
</body>
</html>
$(document).ready(function() {
$('#endpoint-form')
.on('change','#start_select1', function() {
//.on('change','#country', function() {
let countryid = $("#start_select1").val();
$.getJSON( "/" + contextRoot + "/provinces-json.mvc?id="+countryid, function( data ) {
let items = [];
$.each( data, function( key, value ) {
console.log(value);
items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
});
$('#start_select2').html(items.join(""));
});
$.getJSON( "/" + contextRoot + "/states-json.mvc?id="+countryid, function( data ) {
let items = [];
$.each( data, function( key, value ) {
console.log(value);
items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
});
$('#start_select3').html(items.join(""));
});
$('#start_select4').html("");
document.getElementById("timezoneName").value ="";
})
.on('change','#start_select2', function() {
//.on('change','#province', function() {
let provinceID = $(this).val();
let stateID = 0;
let countryid = $('#start_select1').val();
$.getJSON( "/" + contextRoot + "/cities-json.mvc?id="+countryid+"&provinceID="+provinceID+"&stateID="+stateID, function( data ) {
let items = [];
$.each( data, function( key, value ) {
console.log(value);
items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
});
$('#start_select4').html(items.join(""));
});
})
.on('change','#start_select3', function() {
//.on('change','#state', function() {
let stateID = $(this).val();
let provinceID = 0;
let countryid = $('#start_select1').val();
$.getJSON( "/" + contextRoot + "/cities-json.mvc?id="+countryid+"&provinceID="+provinceID+"&stateID="+stateID, function( data ) {
let items = [];
$.each( data, function( key, value ) {
console.log(value);
items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
});
$('#start_select4').html(items.join(""));
});
})
.on('change','#start_select4', function() {
//.on('change','#city', function() {
let cityID = $(this).val();
$.getJSON( "/" + contextRoot + "/timezone-json.mvc?cityID="+cityID, function( data ) {
if(data !=null){
console.log(data.name);
//$('#timezoneName').html(data.name);
document.getElementById("timezoneName").value = data.name;
}
//let items = [];
//$.each( data, function( key, value ) {
//console.log(value);
//items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
// });
//$('#timezoneName').html(items.join(""));
});
})
.on("click","#endpoint-submit",function(e) {
e.preventDefault();
confirmAdd(dataToParams($('#endpoint-form').data(),$(this).data()));
});
});
@RequestMapping(value = "/provinces-json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public List<Province> getProvinceInJSON(@RequestParam(value="id", required = false) Long countryID,
@PageableDefault(sort = "model.model", direction = Sort.Direction.ASC) Pageable pageable,
Model model, HttpServletRequest request, HttpSession session) {
List<Province> province;
logger.info("get province,countryID:"+ countryID);
if (countryID != null) {
province = provinceRepository.searchByCountryIdAndFetchProvince(countryID);
}else{
province = null;
}
return province;
}
@RequestMapping(value = "/states-json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public List<State> getStateInJSON(@RequestParam(value="id", required = false) Long countryID,
@PageableDefault(sort = "model.model", direction = Sort.Direction.ASC) Pageable pageable,
Model model, HttpServletRequest request, HttpSession session) {
List<State> state;
logger.info("get state,countryID:"+ countryID);
if (countryID != null) {
state = stateRepository.searchByCountryIdAndFetchState(countryID);
}else{
state = null;
}
return state;
}
@RequestMapping(value = "/cities-json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public List<City> getCityInJSON(@RequestParam(value="id", required = false) Long countryID,
@RequestParam(value="provinceID", required = false) Long provinceID,
@RequestParam(value="stateID", required = false) Long stateID,
@PageableDefault(sort = "model.model", direction = Sort.Direction.ASC) Pageable pageable,
Model model, HttpServletRequest request, HttpSession session) {
List<City> city;
logger.info("get city,countryID:"+ countryID);
logger.info("get city,provinceID:"+ provinceID);
logger.info("get city,stateID:"+ stateID);
if (provinceID > 0 ) {
city = cityRepository.searchByProvinceIdAndFetchCity(provinceID);
}else{
city = cityRepository.searchByStateIdAndFetchCity(stateID);
}
return city;
}
@RequestMapping(value = "/timezone-json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public Timezone getTimezoneInJSON(
@RequestParam(value="cityID", required = false) Long cityID,
@PageableDefault(sort = "model.model", direction = Sort.Direction.ASC) Pageable pageable,
Model model, HttpServletRequest request, HttpSession session) {
logger.info("get timezone,cityID:"+ cityID);
if (cityID > 0 ) {
Timezone timezone = timezoneRepository.searchByCityIdAndFetchTimezone(cityID);
logger.info("timezone:"+ timezone.getName());
return timezone;
}else{
return null;
}
}
https://www.iteye.com/blog/gjp014-2387037
Thymeleaf select 使用 和多select 级联选择
https://www.iteye.com/blog/gjp014-2395655
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.w3.org/1999/xhtml" layout:decorator="thymeleaf/templates/layout.html">
<head>
<script type="text/javascript" th:src="@{/js/sgo/endpoint.js}"></script>
<title>Endpoint Form</title>
</head>
<body>
<div layout:fragment="content">
<form action="#" id="endpoint-form" th:object="${endpointForm}" method="post"
th:action="@{/{deviceAction} (deviceAction=${endpointForm.id == null ? 'add-endpoint.mvc' :'endpoints/'+endpointForm.id+'/updateendpoint.mvc'})}" >
<input th:type="hidden" th:field="*{id}" th:if="${endpointForm.id != null}" />
<div th:if="${#fields.hasErrors('*')} or ${resultList != null}" class="alert alert-danger" role="alert">
<ul>
<li th:each="e : ${#fields.detailedErrors()}" th:class="${e.global}? globalerr : fielderr">
<span th:text="${e.global}? '*' : ${e.fieldName}">The field name</span> -
<span th:text="${e.message}">The error message</span>
</li>
<li th:each="r : ${resultList}" th:class="globalerr">
<span th:text="'*'">The field name</span> -
<span th:text="${r.getMessage()}">The error message</span>
</li>
</ul>
</div>
<div th:if="${success != null}" class="alert alert-success" role="alert" th:text="${success}" />
<div class="form-group" th:name="endPointName" th:errorclass="has-error">
<label class="control-label" th:for="endPointName">Endpoint Name <span class="glyphicon glyphicon-asterisk"></span></label>
<input type="text" th:field="*{endPointName}" class="form-control required" id="endPointName"/>
</div>
<div class="row-fluid col-md-12">
<div class="form-group col-md-2" th:name="EPSTypeID" th:errorclass="has-error">
<label class="control-label" th:for="EPSTypeID">Endpoint Type Id <span class="glyphicon glyphicon-asterisk"></span></label>
<select size ="5" th:field="*{EPSTypeID}" class="form-control" id="EPSTypeID">
<option th:each="epsTypes : ${epsTypes}"
th:value="${epsTypes.id}"
th:text="${epsTypes.name}">Endpoint Type Id</option>
</select>
</div>
<div class="form-group col-md-2" th:name="msoId" th:errorclass="has-error" >
<label class="control-label" th:for="msoId">MSO Id <span class="glyphicon glyphicon-asterisk"></span></label>
<select size ="5" th:field="*{msoId}" class="form-control" id="msoID">
<option th:each="mso : ${mso}"
th:value="${mso.id}"
th:text="${mso.name}">MSO Id</option>
</select>
</div>
</div>
<!--div class="row-fluid col-md-12">
<div class="form-group col-md-2" th:name="city" th:errorclass="has-error">
<label class="control-label" th:for="city">City <span class="glyphicon glyphicon-asterisk"></span></label>
<input type="text" th:field="*{city}" class="form-control required" />
</div>
<div class="form-group col-md-2" th:name="state" th:errorclass="has-error" >
<label class="control-label" th:for="state">State </label>
<input type="text" th:field="*{state}" class="form-control required" />
</div>
<div class="form-group col-md-2" th:name="province" th:errorclass="has-error" >
<label class="control-label" th:for="province">Province </label>
<input type="text" th:field="*{province}" class="form-control required" />
</div>
<div class="form-group col-md-2" th:name="country" th:errorclass="has-error" >
<label class="control-label" th:for="country">Country <span class="glyphicon glyphicon-asterisk"></span></label>
<input type="text" th:field="*{country}" class="form-control required" />
</div>
</div-->
<div class="row-fluid col-md-12">
<div class="form-group col-md-2" th:name="country" th:errorclass="has-error" >
<label class="control-label" th:for="country">Country <span class="glyphicon glyphicon-asterisk"></span></label>
<select size ="5" th:field="*{country}" class="form-control" name="startArea1" id="start_select1">
<!--option value="">Choose Country</option-->
<option th:each="country:${country}" th:value="${country.id}" th:text="${country.name}" ></option>
</select>
</div>
<div class="form-group col-md-2" th:name="state" th:errorclass="has-error" >
<label class="control-label" th:for="state">State </label>
<select size ="5" class="form-control" th:field="*{state}" name="startArea3" id="start_select3">
<!--option value="">Choose State</option-->
<option th:each="state : ${state}"
th:value="${state.id}"
th:text="${state.name}">State</option>
</select>
</div>
<div class="form-group col-md-2" th:name="province" th:errorclass="has-error" >
<label class="control-label" th:for="province">Province </label>
<!--select class="form-control" name="startArea2" id="start_select2">
<option value="">Choose Province</option>
</select-->
<select size ="5" class="form-control" th:field="*{province}" id="start_select2">
<option th:each="province : ${province}"
th:value="${province.id}"
th:text="${province.name}">Province</option>
</select>
</div>
<div class="form-group col-md-2" th:name="city" th:errorclass="has-error">
<label class="control-label" th:for="city">City <span class="glyphicon glyphicon-asterisk"></span></label>
<select size ="5" class="form-control" th:field="*{city}" name="startArea4" id="start_select4">
<!--option value="">Choose City</option-->
<option th:each="city : ${city}"
th:value="${city.id}"
th:text="${city.name}">City</option>
</select>
</div>
</div>
<div class="form-group" th:name="timezoneName" th:errorclass="has-error">
<label class="control-label" th:for="TimezoneID">Timezone <span class="glyphicon glyphicon-asterisk"></span></label>
<input type="text" th:field="*{timezoneName}" class="form-control required" id="timezoneName"/>
</div>
<button type="submit" class="btn btn-sm btn-primary" id="endpoint-submit" th:text="${endpointForm.id == null ? 'Create' : 'Update'}">Create</button>
<a th:href="@{{deviceAction} (deviceAction=${endpointForm.id == null ? 'endpoints.mvc' :'/endpoints/'+endpointForm.id+'/devices.mvc'})}" title="Cancel" class="btn btn-sm btn-primary">Cancel</a>
</form>
</div>
</body>
</html>
$(document).ready(function() {
$('#endpoint-form')
.on('change','#start_select1', function() {
//.on('change','#country', function() {
let countryid = $("#start_select1").val();
$.getJSON( "/" + contextRoot + "/provinces-json.mvc?id="+countryid, function( data ) {
let items = [];
$.each( data, function( key, value ) {
console.log(value);
items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
});
$('#start_select2').html(items.join(""));
});
$.getJSON( "/" + contextRoot + "/states-json.mvc?id="+countryid, function( data ) {
let items = [];
$.each( data, function( key, value ) {
console.log(value);
items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
});
$('#start_select3').html(items.join(""));
});
$('#start_select4').html("");
document.getElementById("timezoneName").value ="";
})
.on('change','#start_select2', function() {
//.on('change','#province', function() {
let provinceID = $(this).val();
let stateID = 0;
let countryid = $('#start_select1').val();
$.getJSON( "/" + contextRoot + "/cities-json.mvc?id="+countryid+"&provinceID="+provinceID+"&stateID="+stateID, function( data ) {
let items = [];
$.each( data, function( key, value ) {
console.log(value);
items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
});
$('#start_select4').html(items.join(""));
});
})
.on('change','#start_select3', function() {
//.on('change','#state', function() {
let stateID = $(this).val();
let provinceID = 0;
let countryid = $('#start_select1').val();
$.getJSON( "/" + contextRoot + "/cities-json.mvc?id="+countryid+"&provinceID="+provinceID+"&stateID="+stateID, function( data ) {
let items = [];
$.each( data, function( key, value ) {
console.log(value);
items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
});
$('#start_select4').html(items.join(""));
});
})
.on('change','#start_select4', function() {
//.on('change','#city', function() {
let cityID = $(this).val();
$.getJSON( "/" + contextRoot + "/timezone-json.mvc?cityID="+cityID, function( data ) {
if(data !=null){
console.log(data.name);
//$('#timezoneName').html(data.name);
document.getElementById("timezoneName").value = data.name;
}
//let items = [];
//$.each( data, function( key, value ) {
//console.log(value);
//items.push( "<option value='" + value.id + "'>" + value.name + "</option>" );
// });
//$('#timezoneName').html(items.join(""));
});
})
.on("click","#endpoint-submit",function(e) {
e.preventDefault();
confirmAdd(dataToParams($('#endpoint-form').data(),$(this).data()));
});
});
@RequestMapping(value = "/provinces-json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public List<Province> getProvinceInJSON(@RequestParam(value="id", required = false) Long countryID,
@PageableDefault(sort = "model.model", direction = Sort.Direction.ASC) Pageable pageable,
Model model, HttpServletRequest request, HttpSession session) {
List<Province> province;
logger.info("get province,countryID:"+ countryID);
if (countryID != null) {
province = provinceRepository.searchByCountryIdAndFetchProvince(countryID);
}else{
province = null;
}
return province;
}
@RequestMapping(value = "/states-json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public List<State> getStateInJSON(@RequestParam(value="id", required = false) Long countryID,
@PageableDefault(sort = "model.model", direction = Sort.Direction.ASC) Pageable pageable,
Model model, HttpServletRequest request, HttpSession session) {
List<State> state;
logger.info("get state,countryID:"+ countryID);
if (countryID != null) {
state = stateRepository.searchByCountryIdAndFetchState(countryID);
}else{
state = null;
}
return state;
}
@RequestMapping(value = "/cities-json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public List<City> getCityInJSON(@RequestParam(value="id", required = false) Long countryID,
@RequestParam(value="provinceID", required = false) Long provinceID,
@RequestParam(value="stateID", required = false) Long stateID,
@PageableDefault(sort = "model.model", direction = Sort.Direction.ASC) Pageable pageable,
Model model, HttpServletRequest request, HttpSession session) {
List<City> city;
logger.info("get city,countryID:"+ countryID);
logger.info("get city,provinceID:"+ provinceID);
logger.info("get city,stateID:"+ stateID);
if (provinceID > 0 ) {
city = cityRepository.searchByProvinceIdAndFetchCity(provinceID);
}else{
city = cityRepository.searchByStateIdAndFetchCity(stateID);
}
return city;
}
@RequestMapping(value = "/timezone-json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public Timezone getTimezoneInJSON(
@RequestParam(value="cityID", required = false) Long cityID,
@PageableDefault(sort = "model.model", direction = Sort.Direction.ASC) Pageable pageable,
Model model, HttpServletRequest request, HttpSession session) {
logger.info("get timezone,cityID:"+ cityID);
if (cityID > 0 ) {
Timezone timezone = timezoneRepository.searchByCityIdAndFetchTimezone(cityID);
logger.info("timezone:"+ timezone.getName());
return timezone;
}else{
return null;
}
}
相关推荐
Thymeleaf的设计理念是使得静态模板在脱离服务器环境时也能正常工作,提供了一种易于阅读和维护的静态代码形式。其3.0.5版是该技术的一个稳定版本,具有诸多增强和改进。 Thymeleaf的主要特性包括: 1. **模板语言...
在给定的"thymeleaf-jar包"中,包含了一系列依赖的jar文件,这些都是Thymeleaf正常工作所必需的库: 1. `thymeleaf-3.0.12.RELEASE.jar`:这是Thymeleaf的核心库,包含了所有处理模板和表达式的类。版本号3.0.12...
Thymeleaf是一款强大的Java模板引擎,常用于Web应用程序,特别是Spring MVC框架中,替代了JSP作为视图层技术。这个"Thymeleaf中文文档合集-最新版"包含了一系列的学习资源,如PDF、PPT等,帮助开发者深入理解和掌握...
在Spring框架中,Thymeleaf通常作为视图解析器使用,为开发人员提供了便捷的方式来构建动态Web页面。Thymeleaf-3.0.11.RELEASE是该引擎的一个特定版本,它包含了优化和修复的特性,以提高性能和稳定性。 1. **...
赠送jar包:thymeleaf-3.0.3.RELEASE.jar; 赠送原API文档:thymeleaf-3.0.3.RELEASE-javadoc.jar; 赠送源代码:thymeleaf-3.0.3.RELEASE-sources.jar; 包含翻译后的API文档:thymeleaf-3.0.3.RELEASE-javadoc-...
赠送jar包:thymeleaf-3.0.12.RELEASE.jar; 赠送原API文档:thymeleaf-3.0.12.RELEASE-javadoc.jar; 赠送源代码:thymeleaf-3.0.12.RELEASE-sources.jar; 赠送Maven依赖信息文件:thymeleaf-3.0.12.RELEASE.pom;...
赠送jar包:thymeleaf-3.0.9.RELEASE.jar; 赠送原API文档:thymeleaf-3.0.9.RELEASE-javadoc.jar; 赠送源代码:thymeleaf-3.0.9.RELEASE-sources.jar; 赠送Maven依赖信息文件:thymeleaf-3.0.9.RELEASE.pom; ...
thymeleaf,我个人认为是个比较好的模板,性能也比一般的,比如freemaker的要高,而且把将美工和程序员能够结合起来,美工能够在浏览器中查看静态效果,程序员可以在应用服务器查看带数据的效果。 thymeleaf是一个...
SpringBoot 2.7.15 与 Thymeleaf 的整合是现代Java Web开发中的常见实践,这个项目提供了一个基础的实现,包括了登录功能以及员工管理的相关操作。Thymeleaf是一款强大的服务器端模板引擎,常用于Spring Boot应用中...
Thymeleaf是一个面向web和独立环境的现代服务器端Java模板引擎。 Thymeleaf的主要目标是将优雅的自然模板引入到您的开发工作流程中——可以在浏览器中正确显示的HTML,也可以作为静态原型工作,从而在开发团队中实现...
本案例将详细讲解如何将SpringBoot与Thymeleaf进行整合,构建一个完整的Web应用。 首先,我们需要在SpringBoot项目中引入Thymeleaf的依赖。在`pom.xml`文件中,添加如下Maven依赖: ```xml <groupId>org.spring...
SpringBoot整合Thymeleaf模板是一项常见的Web开发任务,它结合了SpringBoot的便捷性和Thymeleaf的动态模板引擎,使得开发人员可以快速构建功能丰富的Web应用。下面将详细介绍这个过程及其涉及的关键知识点。 首先,...
SpringBoot和Thymeleaf是两个非常流行的Java技术,它们在现代Web开发中扮演着重要角色。SpringBoot简化了Spring框架的配置,提供了快速启动和运行应用的方式,而Thymeleaf则是一种强大的模板引擎,它允许开发者在...
Thymeleaf 3.0.5 中文参考手册 Thymeleaf 是一个基于模板引擎的Java模板引擎,可以处理各种模板,例如HTML、XML、TXT等。Thymeleaf 的主要特点是它可以将模板解析为静态 HTML,然后将其传递给浏览器,从而提高页面...
赠送jar包:thymeleaf-spring5-3.0.10.RELEASE.jar; 赠送原API文档:thymeleaf-spring5-3.0.10.RELEASE-javadoc.jar; 赠送源代码:thymeleaf-spring5-3.0.10.RELEASE-sources.jar; 赠送Maven依赖信息文件:...
"Spring Boot + Thymeleaf 实现后端直接给 onclick 函数赋值的知识点" Spring Boot 是一个基于 Java 的框架,用于构建基于 Web 的应用程序,而 Thymeleaf 是一个基于 XML 的模板引擎,用于生成 HTML 内容。在 ...
Thymeleaf是一款强大的模板引擎,它在IT行业中被广泛应用于构建动态Web页面。作为Spring Boot官方推荐的解决方案,Thymeleaf以其独特的特性和易用性,使得开发者能够在前端和后端之间实现无缝协作。以下是对...
### Thymeleaf开发手册中文版知识点概览 #### 1. Thymeleaf简介 ##### 1.1 Thymeleaf是什么 Thymeleaf 是一个现代的、开源的 Java 模板引擎,适用于 Web 和非 Web 环境(如电子邮件、纯文本消息、PDF 文档等)。...
- `thymeleaf-spring5.jar`(或`thymeleaf-servlet.jar`,取决于Spring版本):这个库是Thymeleaf与Spring框架集成的关键。它允许Thymeleaf与Spring MVC无缝协作,提供模型数据注入、视图解析等功能。 4. **...
赠送jar包:thymeleaf-spring5-3.0.12.RELEASE.jar; 赠送原API文档:thymeleaf-spring5-3.0.12.RELEASE-javadoc.jar; 赠送源代码:thymeleaf-spring5-3.0.12.RELEASE-sources.jar; 赠送Maven依赖信息文件:...