スズキです。
「T2で"/"でも"/index.html"の処理になるように」を改良してみました。
http://blog.suz-lab.com/2009/12/t2indexhtml.html
今までのものは、"/mobile/"などのサブフォルダに対応していなかったので、
それにも対応するよう、下記のように修正しています。
--------【Java】--------
@Page("/")
public abstract class AbstractIndexPage extends AbstractPage {
@Override
@Default
public Navigation others(Request request) {
String path = request.getRequestURI();
if(path.endsWith("/")) {
this.setAttributes(request);
return Forward.to(path + "index.html");
} else if(path.endsWith("/index.html")) {
this.setAttributes(request);
return Forward.to(path);
} else {
return Forward.to(path);
}
}
}
--------
http://code.google.com/p/suz-lab-gae/source/browse/trunk/suz-lab-gae/src/suz/lab/gae/page/AbstractIndexPage.java?r=36
"mobylet + T2 + Velocity on GAE/J"がとりあえず動くようになった!
--------
http://www.suz-lab.com
2009年12月21日月曜日
登録:
コメントの投稿 (Atom)

0 コメント:
コメントを投稿