原创 java修改properties文件 丟失內容

網上看到問題,收集起來: 基於java.util.Properties類寫了一個修改屬性文件的方法。測試的時候發現,該方法可以修改文件指定key的value,但是除了修改的key和value外,其他的內容全部被清除了,請問爲何。。代碼如下

原创 grails的測試

Grails的測試是基於Groovy Test框架的,而Groovy Test主要基於JUnit的 test/integration:運行時需要Grails框架“參與”,如:數據庫的查詢、更新等 test/unit:無需Grails框架

原创 groovy中多行sql書寫

def results = my.Goods.findAll("""\ from Goods as g \ where g.title = ?""", ['title']) mu

原创 grails中導入外部包

1: 假設有一個名爲test的grails3.0.9項目。 在項目名下直接創建lib文件夾,將jar包放進去。 2: 在build.gradle的dependencies: compile fileTree(dir: 'test'

原创 SpringBoot學習一

1、使用IDEA創建springboot項目 2、初次使用,下載jar會很慢,使用阿里雲的鏡像:.m2/settings.xml: <mirror> <id>nexus-aliyun</id> <mirrorOf>*</

原创 grails中的頁面和action間的數據交互問題

1、form將數據提交不到action <g:form url="[resource:usersInstance ,action:'update']" method="PUT"> <g:hiddenField name="ver

原创 啓動VMware出現報錯:The VMware Authorization Service is not running

出現The VMware Authorization Service is not running.報錯的根本原因是開機沒有啓動“VMware Authorization Service”服務。 linux虛擬機沒有聯網,啓動下面兩個服務

原创 grails的domain的constraints和mapping

constraints: name nullable:true,maxSize:5 //字段允許爲空,如果插入數據,maxSize爲5 其餘查看官方文檔 mapping: txtContent sqlType: 'text' a

原创 gsp頁面

Note:test裏面${}後面不能出現空格 <g:if test="${issueCount >= 0} "> (x) <g:if test="${issueCount >= 0}"> (v)

原创 grails的一對一、一對多關係

一對一關係三種方式生成的表的映射: class Face{ static hasOne = [nose:Nose] } class Nose{ Face fase } face: id version nose

原创 grails寫接口

一、傳遞json數據: import groovy.json.JsonOutput import grails.converters.JSON 接收: 獲取前臺傳過來的json。 使用 def jsonObject = JSON.par

原创 grails項目中遇到的錯誤

1、Failed to compile war.groovy 程序昨天之前好好地,過了一夜,grails,直接進不去了。jdk版本等都沒有問題。 解決辦法: 手動刪除build文件夾 2、grails new th

原创 grails更改端口號

3.0.9版本: grails run-app --port=9000 server: port: 9000 context-path: '/xxx' #指定程序啓動後的名字。即: http://localhost:9

原创 grails的分頁查詢

第一步:代碼示例: def searchForm() { if(!params.max ) params.max=2 if(!params.offset) params.offset=0 def serachClo

原创 grails的clearErrors之後,注意事項

The Grails Framework - Groovy reference documentation author:book = 1:多, book添加約束:title blank:false def b = new or