<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/ayikat/">
    <title>tectectak</title>
    <link>http://w.atwiki.jp/ayikat/</link>
    <atom:link href="https://w.atwiki.jp/ayikat/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>tectectak</description>

    <dc:language>ja</dc:language>
    <dc:date>2013-10-11T09:36:05+09:00</dc:date>
    <utime>1381451765</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/73.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/21.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/78.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/88.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/87.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/86.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/83.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/85.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/84.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/ayikat/pages/82.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/73.html">
    <title>Grails</title>
    <link>https://w.atwiki.jp/ayikat/pages/73.html</link>
    <description>
      ※gradle
http://www.ntts.co.jp/publish/column/tec/[[java]]_03/

 
site
http://www.slideshare.net/uehaj/jjug-ccc-groovy2x20130511
http://grails.jp/news/2013-17.html
http://grails.org/doc/1.0.x/
http://www.ibm.com/developerworks/jp/views/java/libraryview.jsp?search_by=Grails+%E3%82%92%E3%83%9E%E3%82%B9%E3%82%BF%E3%83%BC%E3%81%99%E3%82%8B&amp;S_TACT=105AGX90&amp;S_CMP=content
http://d.hatena.ne.jp/mottsnite/20130509/1368113688

modal dialog
http://zenofchicken.wordpress.com/2010/12/27/a-taglib-to-create-modal-dialogs-with-jqueryui-and-grails/
http://grails.org/plugin/simple-modal
&lt;simpleModal:includes /&gt;
&lt;simpleModal:[[javascript]] /&gt;

本
http://pragprog.com/book/sdgrvr/groovy-recipes


[[View]]

[[Test]]

[[Spock]]

[[CodeNarc]]

[[Calender]]

[[Memo]]




Domain &gt; constraints &gt; validator
 &gt;Custom
   name()
   motherName (validator: {val, obj -&gt;
      if(val.size() &lt; 1 &amp;&amp; obj.name.size() &lt; 1)
        return [&#039;validator.message&#039;]
      })



Service &gt; Criteria

  Service
    @Transactional(readOnly = true)
    def searchCriteria(params) {
        def m_itemCriteria = M_item.createCriteria()
        List results = m_itemCriteria.list() {
            if(params?.name) {
                eq(&quot;name&quot;, params.name)
            }
            maxResults(10)
            order(&quot;name&quot;, &quot;desc&quot;)
        }
    }

  Controller
    def find() {
        List results = m_itemService.searchCriteria(params)
        render(view:&#039;list&#039;, model:[m_itemInstanceList:results, m_itemInstanceTotal: results.size()])
    }

  ※Sample
	def testCriteria = test.createCriteria()
	List results = testCriteria .list(max:10, offset:0) {
	    eq(&quot;name&quot;, params.name)
	    and {
	        between(&quot;balance&quot;, 500, 1000)
	        eq(&quot;branch&quot;, &quot;London&quot;)
	    }
	    ilike(&quot;name&quot;,&quot;%${params.name}%&quot;)
	    between(&quot;balance&quot;, 500, 1000)
	    eq(&quot;branch&quot;, &quot;London&quot;)
	    or {
	        like(&quot;holderFirstName&quot;, &quot;Fred%&quot;)
	        like(&quot;holderFirstName&quot;, &quot;Barney%&quot;)
	    }
	    maxResults(10)
	    firstResult(50)
	    order(&quot;holderLastName&quot;, &quot;desc&quot;)
	}
	//println &quot;Accounts of ${results.totalCount}&quot;
	//println &quot;Rendering ${results.size()}&quot;
	render(view:&#039;list&#039;, model:[testInstanceList:results, testInstanceTotal: results.size()])


Enum

	Enum
	
	package gapp
	
	enum GenderEnum {
	
	    MALE(&#039;Male&#039;,&#039;msg.male.lavel&#039;),
	    FEMALE(&#039;Female&#039;,&#039;msg.female.lavel&#039;),
	    TRANCE(&#039;Trance&#039;,&#039;msg.trance.lavel&#039;)
	
	    private final String val
	    private final String msg
	    public GenderEnum(String val, String msg) {
	        this.val = val
	        this.msg = msg
	    }
	
	    String value() { return val }
	    String msg() { return msg }
	}

	Domain
	
	GenderEnum gender

	static mapping = {
		version false
	}

	View
	
	&lt;g:select name=&quot;action&quot; 
	    from=&quot;${com.domain.ActionEnum?.values()}&quot;
    	keys=&quot;${com.domain.ActionEnum.values()*.name()}&quot; required=&quot;&quot; 
    	value=&quot;${xyzInstance?.action?.name()}&quot;/&gt;
    	 
   	&lt;g:select optionKey=&#039;id&#039; name=&quot;action&quot; 
    	from=&quot;${com.domain.ActionEnum?.values()}&quot; 
    	required=&quot;&quot; 
    	value=&quot;${xyzInstance?.action}&quot;/&gt;


Domain

	//複合PK
	static mapping = { 
		id composite:[&#039;holdYear&#039;, &#039;member&#039;] 
	}
	
	//
	String toString(){
		return name
	}
	
	//db mapping
	static mapping = {
		table &#039;some_other_table_name&#039;
		columns {
			name column:&#039;airline_name&#039;
			url column:&#039;link&#039;
			frequentFlyer column:&#039;ff_id&#039;
		}
	}

	テーブルに格納されないドメイン・クラスのフィールドを設定するには、静的 transients 行を追加
	static transients = [&quot;tempField1&quot;, &quot;tempField2&quot;]

	Car car
	static embedded = {&#039;car&#039;}
	static mapping = {
		songs cascade: &#039;delete&#039;
		discriminator &#039;xxxxx&#039;
		discriminator value: &#039;42&#039;, type: &#039;integer&#039;
		tablePerHierarchy false
	}

  コンボ・ボックス主キー表示時の漏えい回避
  String toString(){
    return name
  }

    //id to String
    
    String id
    static mapping = {
        table &quot;m_item&quot;
        id column: &#039;jan_code&#039;, generator: &#039;assigned&#039;
    }
    
    M_item m_item
    static mapping = {
        m_item column: &#039;jan_code&#039;
    }


Pagenateページ番号非表示化
 &lt;style&gt;
  &lt;!--
  .pagination .step, .pagination .currentStep {
    display : none ;
  }
  --&gt;
 &lt;/style&gt;

java.util.List表示
 controller
 def list() {
	List&lt;NewClass&gt; results2 = new ArrayList&lt;NewClass&gt;()
	NewClass m_item2 = new NewClass()
	m_item2.setName(&quot;java1&quot;)
	results2.add(m_item2)
	NewClass m_item3 = new NewClass()
	m_item3.setName(&quot;java2&quot;)
	results2.add(m_item3)
	render(view:&#039;list&#039;m_itemInstanceList2:results2, m_itemInstanceTotal: results.size()])
 }
 gsp
 &lt;g:each in=&quot;${m_itemInstanceList2}&quot; status=&quot;j&quot; var=&quot;m_itemInstance2&quot;&gt;
	&lt;tr class=&quot;${(j % 2) == 0 ? &#039;even&#039; : &#039;odd&#039;}&quot;&gt;
		&lt;td&gt;${j+1}&lt;/td&gt;
		&lt;%--&lt;td&gt;&lt;c:out value=&quot;${m_itemInstance2.name}&quot;/&gt;&lt;/td&gt;--%&gt;
		&lt;td&gt;${m_itemInstance2.getName()}&lt;/td&gt;
	&lt;/tr&gt;
 &lt;/g:each&gt;



**CloudFoundary
***環境

Cloud Foundryプラグインのインストール
grails install-plugin cloud-foundry

grails-app/conf/Config.groovy修正

例）
grails.plugin.cloudfoundry.username	アカウント用のユーザ名/メールアドレス	なし(必須)
grails.plugin.cloudfoundry.password	アカウント用のパスワード	なし(必須)
grails.plugin.cloudfoundry.target	APIサーバ名	&#039;api.cloudfoundry.com&#039;
grails.plugin.cloudfoundry.appname	アプリケーション名	Grailsアプリケーションの名前
grails.plugin.cloudfoundry.showStackTrace	コンソールにスタックトレースを表示するかどうか	false
grails.plugin.cloudfoundry.testStartWithGet	GETリクエストで開始や再起動をテストするかどうか	true
grails.plugin.cloudfoundry.testStartGetUrl	上記プロパティがtrueの場合に使用するURL	アプリケーションのURL
grails.plugin.cloudfoundry.datasource.disableTimeoutAutoconfiguration	MySQLデータソースのコネクションタイムアウトチェックの自動設定を無効にするかどうか	true

grails.plugin.cloudfoundry.username=
grails.plugin.cloudfoundry.password=
grails.plugin.cloudfoundry.target=&#039;api.cloudfoundry.com&#039;
grails.plugin.cloudfoundry.appname=gapp
grails.plugin.cloudfoundry.showStackTrace=false
grails.plugin.cloudfoundry.testStartWithGet=true
grails.plugin.cloudfoundry.testStartGetUrl=gapp
grails.plugin.cloudfoundry.datasource.disableTimeoutAutoconfiguration=true


[[BuildConfig.groovy]]追記
mavenRepo &quot;http://maven.springframework.org/milestone/&quot;
compile &quot;cloudfoundry:1.2.3&quot;

grails refresh-dependencies
grails dependencies-report
w3m target/dependencies-report/index.html


***コマンド

アプリのデプロイ
grails prod cf-push

アプリのアップデート
grails prod cf-update

インスタンス数変更
grails cf-show-instances
grails cf-update-instances 2

メモリ割り当て変更
grails cf-stats
grails cf-update-memory 1G

ログの確認
grails cf-logs

アプリケーションの起動・停止・再起動
grails prod cf-start
grails prod cf-stop
grails prod cf-restart

リモートファイル確認
grails cf-list-files/
grails cf-get-file logs/stderr.log

アプリケーションの削除
grails cf-delete-app

全アプリケーションの削除
grails cf-delete-all-apps

データのインポート
cf-tunnel

　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-10-11T09:36:05+09:00</dc:date>
    <utime>1381451765</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/21.html">
    <title>java</title>
    <link>https://w.atwiki.jp/ayikat/pages/21.html</link>
    <description>
      ----

[[バージョン]]

メモ
-[[StringTemplate]]
-[[spring]]
-[[taglib]]
-[[JDK]]

サンプル
-[[keijiban3.php]]
-[[sample.jsp]]
　
メモ
http://www.sk-jp.com/book/javamail/contents/javamail_application.html
　
		for (Iterator iterator = testSet.iterator(); iterator.hasNext();) {
			iterator.next();
			count++;
		}
		System.out.println(&quot;iterator:&quot; + (System.currentTimeMillis()-start) + &quot; count:&quot; +count);
		
		start = System.currentTimeMillis();
		List&lt;String&gt; testList = new ArrayList&lt;String&gt;(testSet);
		count = 0;
		for (String string : testList) {
			count++;
		}
    if (s1.indexOf(s4) != -1) {
    // 部分一致
　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-07-26T01:35:05+09:00</dc:date>
    <utime>1374770105</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/78.html">
    <title>View</title>
    <link>https://w.atwiki.jp/ayikat/pages/78.html</link>
    <description>
      Selectの必須選択解除
-Domain
  owner(nullable: true)
-View
  noSelection=&quot;[&#039;null&#039;:&#039;---&#039;]&quot;

-select
 &lt;div class=&quot;fieldcontain ${hasErrors(bean: horseInstance, field: &#039;stable&#039;, &#039;error&#039;)} required&quot;&gt;
	&lt;label for=&quot;stable&quot;&gt;
		&lt;g:message code=&quot;horse.stable.label&quot; default=&quot;Stable&quot; /&gt;
		&lt;span class=&quot;required-indicator&quot;&gt;*&lt;/span&gt;
	&lt;/label&gt;
	&lt;g:select id=&quot;stable&quot; name=&quot;stable.id&quot; from=&quot;${gapp.Stable.list()}&quot; optionValue=&quot;stableName&quot; optionKey=&quot;id&quot; required=&quot;&quot; value=&quot;${horseInstance?.stable?.id}&quot; noSelection=&quot;[&#039;null&#039;:&#039;---&#039;]&quot; class=&quot;many-to-one&quot;/&gt;
 &lt;/div&gt;
※StableController
 def list(Integer max) {
    params.max = Math.min(max ?: 100, 100)
    [stableInstanceList: Stable.list(params), stableInstanceTotal: Stable.count()]
 }

　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-07-22T02:25:15+09:00</dc:date>
    <utime>1374427515</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/88.html">
    <title>DynamoDB</title>
    <link>https://w.atwiki.jp/ayikat/pages/88.html</link>
    <description>
      URL
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/JavaQueryScanORMModelExample.html
http://d.hatena.ne.jp/petach/20120312/1331533690
http://d.hatena.ne.jp/shin/20120125/p1

Sample
        DynamoDBQueryExpression&lt;Reply&gt; queryExpression = new DynamoDBQueryExpression&lt;Reply&gt;()
            .withHashKeyValues(replyKey)
            .withRangeKeyCondition(&quot;ReplyDateTime&quot;, rangeKeyCondition);
                
        List&lt;Reply&gt; betweenReplies = mapper.query(Reply.class, queryExpression);
        
        for (Reply reply : betweenReplies) {
            System.out.format(&quot;Id=%s, Message=%s, PostedBy=%s %n, PostedDateTime=%s %n&quot;, 
                    reply.getId(), reply.getMessage(), reply.getPostedBy(), reply.getReplyDateTime() );
        }

インスタンス生成
 BasicAWSCredentials ac = new BasicAWSCredentials(access_key, secret_keykey);
 AmazonDynamoDBClient client = new AmazonDynamoDBClient(ac);

データの取得(1件取得)
 //検索のキーを指定
 Key key = new Key(new AttributeValue().withN(&quot;5&quot;));
 //リクエストの生成
 GetItemRequest request = new GetItemRequest(&quot;testdb&quot;, key);
 //実行
 GetItemResult item = client.getItem(request);
 System.out.println(item);
 //結果
 {Item: {id={N: 5, }, 名前={S: しんさん5, }}, ConsumedCapacityUnits: 0.5, }

検索条件を入れる(複数件検索)
 //リクエストの生成
 ScanRequest request = new ScanRequest(&quot;testdb&quot;);
 //取得する項目指定
 request.withAttributesToGet(&quot;id&quot;, &quot;名前&quot;);
 //検索条件
 Map&lt;String, Condition&gt; filter = new HashMap&lt;String, Condition&gt;();
 filter.put(&quot;名前&quot;, 
        new Condition().
        withComparisonOperator(ComparisonOperator.BETWEEN).//検索方法
        withAttributeValueList(new AttributeValue().withS(&quot;更新3&quot;), new AttributeValue().withS(&quot;更新7&quot;)));
 request.withScanFilter(filter);
 //実行
 ScanResult result = client.scan(request);
 //確認
 for (Map&lt;String, AttributeValue&gt; row : result.getItems()) {
  System.out.printf(&quot;id:%s, 名前:%s%n&quot; ,
    row.get(&quot;id&quot;).getN()  , 
    row.get(&quot;名前&quot;).getS());
 }

検索条件を入れる2(複数件検索)
 private static void FindUnansweredThread(DynamoDBMapper mapper, String forumName, String threadSubject) throws Exception{
 DynamoDBScanExpression scanExpression = new DynamoDBScanExpression();
 //リクエストの生成
 //ScanRequest request = new ScanRequest(&quot;testdb&quot;);
 //取得する項目指定
 //request.withAttributesToGet(&quot;id&quot;, &quot;名前&quot;);
 //検索条件を作る
 Condition scanCondition = new Condition()
        .withComparisonOperator(ComparisonOperator.EQ.toString())
        .withAttributeValueList(new AttributeValue().withN(&quot;0&quot;));
 Condition scanCondition2 = new Condition().
        withComparisonOperator(ComparisonOperator.BETWEEN).
        withAttributeValueList(new AttributeValue().withS(&quot;更新3&quot;), new AttributeValue().withS(&quot;更新7&quot;)));
 long twoWeeksAgoMilli = (new Date()).getTime() - (15L*24L*60L*60L*1000L);
 Date twoWeeksAgo = new Date();
 twoWeeksAgo.setTime(twoWeeksAgoMilli);
 String twoWeeksAgoStr = dateFormatter.format(twoWeeksAgo);
 Condition scanCondition3 = new Condition()
        .withComparisonOperator(ComparisonOperator.GT.toString())
        .withAttributeValueList(new AttributeValue().withS(twoWeeksAgoStr.toString()));
 //検索対象とする属性をKey,検索条件をValueとしてMapに保存
 Map&lt;String, Condition&gt; scanFilter = new HashMap&lt;String, Condition&gt;();
 scanFilter.put(&quot;Key1&quot;, scanCondition);
 scanFilter.put(&quot;Key2&quot;, scanCondition2);
 scanFilter.put(&quot;Key3&quot;, scanCondition3);
 //request.withScanFilter(scanFilter);
 //実行
 //ScanResult result = client.scan(request);
 List&lt;Thread&gt; unansweredThreads = mapper.scan(Thread.class, scanExpression);
 //確認
 for (Thread thread : unansweredThreads) {
    System.out.format(&quot;Thread=%s, subject=%s,  LastPostedDateTime=%s %n&quot;,
    thread.getForumName(), thread.getSubject(), thread.getLastPostedDateTime() );
 }

　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-07-22T02:05:27+09:00</dc:date>
    <utime>1374426327</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/87.html">
    <title>taglib</title>
    <link>https://w.atwiki.jp/ayikat/pages/87.html</link>
    <description>
      web.xml
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
 &lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://[[java]].sun.com/xml/ns/j2ee&quot;
 xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot; version=&quot;2.4&quot;&gt;
  &lt;servlet&gt;
    &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.example.part1&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;hello&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/servlet/hello&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;jsp-config&gt;
    &lt;taglib&gt;
      &lt;taglib-uri&gt;http://www.javaroad.jp/tags/br&lt;/taglib-uri&gt;
      &lt;taglib-location&gt;/WEB-INF/br.tld&lt;/taglib-location&gt;
    &lt;/taglib&gt;
  &lt;/jsp-config&gt;
 &lt;/web-app&gt;

br.tld
 &lt;?xml version=&quot;1.0&quot; ?&gt;
 &lt;taglib xmlns=&quot;http://java.sun.com/xml/ns/j2ee&quot;
        xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
        xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee
            web-jsptaglibrary_2_0.xsd&quot;
        version=&quot;2.0&quot;&gt;
  &lt;tlib-version&gt;1.0&lt;/tlib-version&gt;
  &lt;jsp-version&gt;2.0&lt;/jsp-version&gt;
  &lt;short-name&gt;brTag&lt;/short-name&gt;
  &lt;tag&gt;
    &lt;name&gt;brTag&lt;/name&gt;
    &lt;tag-class&gt;com.example.part1.BrTag&lt;/tag-class&gt;
    &lt;body-content&gt;empty&lt;/body-content&gt;
    &lt;attribute&gt;
      &lt;name&gt;name&lt;/name&gt;
      &lt;required&gt;false&lt;/required&gt;
      &lt;rtexprvalue&gt;true&lt;/rtexprvalue&gt;
    &lt;/attribute&gt;
  &lt;/tag&gt;
 &lt;/taglib&gt;

BrTag.java
 package com.example.part1;
 import javax.servlet.jsp.*;
 import javax.servlet.jsp.tagext.*;
 public class BrTag implements Tag {
	private PageContext pageContext;
	private Tag parentTag;
	private String name;
	public void setPageContext(PageContext pageContext) {
		this.pageContext = pageContext;
	}
	public void setParent(Tag parentTag) {
		this.parentTag = parentTag;
	}
	public Tag getParent() {
		return this.parentTag;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int doStartTag() throws JspException {
		try {
			JspWriter out = pageContext.getOut();
			out.print(&quot;Hello &quot; + name);
		} catch (Exception e) {
			throw new JspException(e.getMessage());
		}
		return SKIP_BODY;
	}
	public int doEndTag() throws JspException {
		return EVAL_PAGE;
	}
	public void release() {
	}
 }　

JSP
 &lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=utf-8&quot; pageEncoding=&quot;utf-8&quot;%&gt;
 &lt;%@ taglib uri=&quot;http://www.javaroad.jp/tags/br&quot; prefix=&quot;br&quot; %&gt;
 &lt;/html&gt;
 &lt;head&gt;&lt;/head&gt;
 &lt;body&gt;
  &lt;br&gt;
  &lt;br:brTag name=&quot;java&quot; /&gt;
  &lt;br&gt;
 &lt;/body&gt;
 &lt;/html&gt;
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-07-10T03:04:41+09:00</dc:date>
    <utime>1373393081</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/86.html">
    <title>sample.jsp</title>
    <link>https://w.atwiki.jp/ayikat/pages/86.html</link>
    <description>
       &lt;%@ page language=&quot;[[java]]&quot; contentType=&quot;text/html; charset=utf-8&quot; pageEncoding=&quot;utf-8&quot;%&gt;
 &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
 &lt;html&gt;
 &lt;head&gt;
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-31j&quot;&gt;
 &lt;title&gt;view&lt;/title&gt;
 &lt;script language=&quot;[[javascript]]&quot;&gt;
 function onPriviousPage() {
    var a = document.bbb.abc.value;
    location.href=a;
 }
 &lt;/script&gt;
 &lt;style type=&quot;text/css&quot;&gt;
 &lt;!--
 .samp {
    border: none;
    width: 8.5em; 
    word-wrap: break-word;
 }
 --&gt;
 &lt;/style&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;% String sam = (String)request.getAttribute(&quot;sam&quot;);%&gt;
 &lt;form name=&quot;bbb&quot;&gt;
 &lt;br&gt;
 下のボタンをクリック&lt;br&gt;&lt;br&gt;
 &lt;input type=&quot;button&quot; value=&quot;遷移する&quot; onclick=&quot;onPriviousPage()&quot;&gt;
 &lt;br&gt;
 &lt;input type=&quot;text&quot; name=&quot;abc&quot; value=&quot;&quot;/&gt;
 &lt;br&gt;
 &lt;div class=&quot;samp&quot;&gt;&lt;%= sam %&gt;&lt;/div&gt;
 &lt;br&gt;
 &lt;/form&gt;
 &lt;/body&gt;
 &lt;/html&gt;

　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-07-09T02:34:51+09:00</dc:date>
    <utime>1373304891</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/83.html">
    <title>javascript</title>
    <link>https://w.atwiki.jp/ayikat/pages/83.html</link>
    <description>
      　
-Sample1
&lt;form name=&quot;frm&quot; action=&quot;&quot; method=&quot;post&quot;&gt;
&lt;input type=&quot;checkbox&quot; value=&quot;1&quot; onclick=&quot;if(document.frm.c.disabled==true){document.frm.c.disabled=false;}else{document.frm.c.disabled=true;}&quot;&gt;
&lt;input type=&quot;button&quot; name=&quot;c&quot; value=&quot;check1&quot; onclick=&quot;alert(&#039;aaaa&#039;);&quot; disabled&gt;
&lt;/form&gt;

　

 function change_pulldown(){
   pulldown_option = document.getElementById(&quot;hoge&quot;).getElementsByTagName(&#039;option&#039;);
   for(i=0; i&lt;pulldown_option.length;i++){
      if(pulldown_option[i].value == &quot;クラブマンハイレッグ&quot;){
         pulldown_option[i].selected = true;
         break;
      }
   }
 }
 &lt;select id=&quot;hoge&quot;&gt;
   &lt;option value=&quot;イングラム&quot;&gt;イングラム&lt;/option&gt;
   &lt;option value=&quot;グリフォン&quot;&gt;グリフォン&lt;/option&gt;
   &lt;option value=&quot;タイラント2000&quot;&gt;タイラント2000&lt;/option&gt;
   &lt;option value=&quot;クラブマンハイレッグ&quot;&gt;クラブマンハイレッグ&lt;/option&gt;
 &lt;/select&gt;


 &lt;head&gt;
 &lt;script language=&quot;javascript&quot;&gt;
 function onPriviousPage() {
  var a = document.getElementById(&quot;idName&quot;).innerHTML;
  a = document.forms[0].abc.value;
  a = document.bbb.abc.value;
  location.href=a;
 }
 &lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;form name=&quot;bbb&quot;&gt;
 &lt;input type=&quot;button&quot; value=&quot;PriviousPage&quot; onclick=&quot;onPriviousPage()&quot;&gt;
 &lt;br&gt;&lt;p&gt;&lt;%= aid %&gt;&lt;/p&gt;
 &lt;% if(aid.equals(&quot;1&quot;)){ %&gt;
 &lt;p id=&quot;idName&quot;&gt;sample.html&lt;/p&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;abc&quot; value=&quot;sample.html&quot;/&gt;
 &lt;% } else { %&gt;
 &lt;p id=&quot;idName&quot;&gt;sample3.html&lt;/p&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;abc&quot; value=&quot;sample3.html&quot;/&gt;
 &lt;% }%&gt;
 &lt;/body&gt;

　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-07-08T02:56:22+09:00</dc:date>
    <utime>1373219782</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/85.html">
    <title>spring</title>
    <link>https://w.atwiki.jp/ayikat/pages/85.html</link>
    <description>
      http://viralpatel.net/blogs/spring-3-mvc-themes-tutorial-example/


&lt;link href=&quot;${pageContext.request.contextPath}/styles/themes/default.css&quot; rel=&quot;stylesheet&quot;&gt; 


nweb.xml i add :

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.css&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.js&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.gif&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.jpg&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.png&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;

&lt;mvc:resources mapping=&quot;/css/**&quot; location=&quot;/css/&quot;/&gt;


href=&quot;&lt;c:url value=&#039;/css/bootstrap.css&#039;/&gt;&quot;
And this will thus mean: in the css folder, right under the root of the webapp. If the context path of your webapp is /myFirstWebApp, the generated href will thus be
href=&quot;/myFirstWebApp/css/bootstrap.css&quot;




And in the page header i reference to css file with the following code :

&lt;%@page contentType=&quot;text/html&quot; pageEncoding=&quot;UTF-8&quot;%&gt;
&lt;%@ [[taglib]] prefix=&quot;c&quot; uri=&quot;http://[[java]].sun.com/jsp/jstl/core&quot;%&gt;
&lt;%@ taglib prefix=&quot;fmt&quot; uri=&quot;http://java.sun.com/jsp/jstl/fmt&quot; %&gt;
&lt;%@ taglib prefix=&quot;form&quot; uri=&quot;http://www.springframework.org/tags/form&quot;%&gt;
&lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;link href=&quot;${pageContext.request.contextPath}/css/global.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;


　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-07-04T08:30:46+09:00</dc:date>
    <utime>1372894246</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/84.html">
    <title>StringTemplate</title>
    <link>https://w.atwiki.jp/ayikat/pages/84.html</link>
    <description>
      http://www.stringtemplate.org/index.html
http://www.antlr.org/
http://www.stringtemplate.org/download/

http://www.antlr.org/wiki/display/ST4/Using+StringTemplate+with+Java#UsingStringTemplatewithJava-install

**v2.2
http://www.ii-okinawa.ne.jp/~hrk/st22sample/doc.html#N10022

**v3

**[[v4]]
http://www.antlr.org/wiki/display/ST4/StringTemplate+4+Documentation
http://mvnrepository.com/artifact/org.antlr/ST4/4.0.7
http://www.antlr.org/wiki/display/ST4/Using+StringTemplate+with+Java#UsingStringTemplatewithJava-install
　
https://weblogs.[[java]].net/blog/aberrant/archive/2010/05/25/using-stringtemplate-part-1-introduction-stringtemplate

参考
velocity
http://codezine.jp/article/detail/72

　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-06-26T02:26:21+09:00</dc:date>
    <utime>1372181181</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/ayikat/pages/82.html">
    <title>Spock</title>
    <link>https://w.atwiki.jp/ayikat/pages/82.html</link>
    <description>
      http://grails.jp/news/testing-grails.html
http://jggug.doorkeeper.jp/events/3872

http://www.christianoestreich.com/2012/11/domain-constraints-grails-spock-updated/
http://yamkazu.hatenablog.com/entry/20120519/1337434864
http://ldaley.com/post/1281387832/spocks-new-matching-support

http://grails.1312388.n4.nabble.com/Spock-unit-test-service-tha-use-other-services-td4637977.html
http://grails.1312388.n4.nabble.com/bootstrapping-problem-td1357649.html
http://grails.org/doc/1.0.x/ref/Domain%20Classes/addTo.html
http://mrpaulwoods.wordpress.com

github
 grails-spock-examples
 geb-example-grails


grails test-app :spock



  import grails.plugin.spock.*
  @Grab(&#039;org.spockframework:spock-core:0.7-groovy-2.0&#039;)
  class ColorSpec extends UnitSpec {
    def &#039;ColorのcolorNameで検索できる&#039;() {
        setup:
                mockDomain(Color)
        when: &#039;Colorの保存&#039;
                new Color(colorName: colorName).save()
        then: &#039;mockDomainを使ってcolorNameで検索&#039;
                def color = Color.findByTitle(colorName)
                color != null
                color.colorName == colorName
        where:
                colorName = &#039;Red!&#039;
    }
  }


        def m_item = new gapp.M_item(name: &#039;aaaaa&#039;).save()
        new gapp.M_receipt(m_item: m_item, receipt: &#039;001111&#039;).save()


        def sc = new StoryCategory( categoryName:&quot;art&quot;) 
            sc.save() 
            new StoryComplete ( 
                   allowComments:true, 
                   body:&quot;bootsrap story body&quot;, 
                   title:&quot;1 - story title&quot;, 
                   createdOn: new Date(), 
                   modifiedOn: new Date(), 
                   storyCategory:sc 
           ).save() 




　
　
　
　
　
　
　
　
　
　
　
　
　
　
　
　    </description>
    <dc:date>2013-06-04T02:10:34+09:00</dc:date>
    <utime>1370279434</utime>
  </item>
  </rdf:RDF>
