JavaのWebアプリケーション開発フレームワークによる、Webサイト開発の顛末記です。

EclipseのMavenを使った、Spring-MVC、Thymeleaf、MyBatis 等のプログラミングテクニックを、
備忘録的に記録しています。実際に動くソースコードを多用して説明していますので、
これからEclipseや、Spring-MVCを始めたいと思っている人にとって、少しでも参考になれば幸いです。
Spring-MVCの散歩道 > 応用の森(Thymeleaf編) > Javaの定数を、view(Thymeleaf)で参照する方法

package jp.dip.arimodoki.cntl;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import jp.dip.arimodoki.common.CConst;

@Controller
public class General implements CConst {

    @RequestMapping(value = "/general")
     public String general(Model model) throws Exception {

        //CConstという名前で自分自身をデータモデルに追加する
        model.addAttribute("CConst", this);

        return "general";
    }
}