Yi EungJun 2014-11-21
Upgrade Play from 2.2.6 to 2.3.6
* Upgrade sbt from 0.13.0 to 0.13.5.
* Upgrade jsmessages from 1.6.1 to 1.6.2.
* Downgrade play-2-mail from 1.0.0 to 0.9.1.
* Split project/Build.scala into build.sbt and
  project/BuildConfig.scala.
* Introduce sbt-less.
* Introduce sbt-twirl, the new template engine for PlayFramework, and
  fix compile errors caused by it.
    * Import scala.collection.JavaConversions._ for conversion between
      Java and Scala collections.
    * Import java.lang_ and java.util._ to use java types.
    * Use implicitJavaLang imported from play.core.j.PlayMagicForJava._
      instead of lang.
    * Use requestHeader imported from play.core.j.PlayMagicForJava._
      instead of request.
    * Specify play.data.Form in full qualified name to avoid conflict
      with play.api.data.Form.
    * Fix the other template errors.
* Etc
    * Use Result instead of deprecated SimpleResult.
    * Use java.nio.file.NotDirectoryException instead of
      scalax.file.NotDirectoryException.
    * Update README to say use "acvitator" command instead of "play".
    * Add methods to PlayServlet to support Servlet 3.1

IMPORTANT NOTE: You should modify the version of h2database on which
Play depends from 1.3.175 to 1.3.176 in
~/.ivy2/cache/com.typesafe.play/play-jdbc_2.10/ivy-2.3.6.xml as follows:

        

to avoid org.h2.jdbc.JdbcSQLException because of the bug that h2database
1.3.175 cannot create or alter sequence.
@5016350de928be1f44b01d0be31b80c4c123db29
README.md
--- README.md
+++ README.md
@@ -31,25 +31,25 @@
 
 JDK version 7(1.7) is required.
 
-### Download playframework
+### Download Play Activator
 
-    curl -O http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    curl -O http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 or
 
-    wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 or using web browser (for windows)
 
-    http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 ### Unzip
 
-    unzip play-2.1.0.zip
+    unzip typesafe-activator-1.2.10-minimal.zip
 
 ### Change directory to unzipped directory
 
-    cd play-2.1.0
+    cd typesafe-activator-1.2.10-minimal
 
 ### Download Yobi
 
@@ -66,19 +66,19 @@
     
 **Caution! in case2, You might come across troubles when you try to upgrade Yobi.**
 
-> You can locate your own Yobi directory in any other place. Please note that you must add playframework home path to $PATH environment in that case.
+> You can locate your own Yobi directory in any other place. Please note that you must add Play Activator home path to $PATH environment in that case.
 
 ### Change directory to cloned Yobi directory (or cd to your unzipped file directory)
 
     cd yobi
 
-### Run play framework
+### Run Play Activator
 
-    ../play
+    ../activator
 
 or (for windows)
 
-    ..\play
+    ..\activator
 
 Required files will be download automatically. In the first time, it may take about 10 min or more.
 
@@ -94,7 +94,7 @@
 Also, you can configure start options.
 If your system's memory is over than 4G, we recommend to use follow options.
 
-    _JAVA_OPTIONS="-Xmx2048m -Xms1024m" play "start -DapplyEvolutions.default=true -Dhttp.port=9000"
+    _JAVA_OPTIONS="-Xmx2048m -Xms1024m" activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
 
 ### Connect with browser
 
@@ -102,7 +102,7 @@
 
 If you want to change port, check your permission to use 80 port
 
-See [http://www.playframework.com/documentation/2.1.1/Production](http://www.playframework.com/documentation/2.1.1/Production)
+See [http://www.playframework.com/documentation/2.3.6/Production](http://www.playframework.com/documentation/2.3.6/Production)
 
 ### Upgrade Yobi
 
@@ -166,26 +166,25 @@
 
 JDK 7(1.7)이어야 합니다.
 
-### playframework 내려 받기
+### Play Activator 내려 받기
 
-    curl -O http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    curl -O http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 혹은
 
-    wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
+    wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 웹 브라우저에서 (이를테면, MS윈도우즈 사용자일 경우)
 
-    http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
-
+    http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
 
 ### 압축풀기
 
-    unzip play-2.1.0.zip
+    unzip typesafe-activator-1.2.10-minimal.zip
 
 ### 압축을 푼 다음 하위 디렉터리로 이동
 
-    cd play-2.1.0
+    cd typesafe-activator-1.2.10-minimal
 
 ### Yobi 소스 내려 받기
 
@@ -199,20 +198,20 @@
     
 주의! case2의 경우, 업그레이드를 할 때 문제가 생길 수 있습니다.
 
-> 임의의 장소에 Yobi 디렉터리를 위치시킬 경우에는 play 실행파일이 있는 playframework 디렉터리를 $PATH 환경변수에 추가해 주세요.
+> 임의의 장소에 Yobi 디렉터리를 위치시킬 경우에는 activator 실행파일이 있는 Play Activator 디렉터리를 $PATH 환경변수에 추가해 주세요.
 
 ### clone 받은 Yobi 디렉터리로 이동 
 (혹은 압축을 해제한 디렉터리로 이동)
 
     cd yobi
 
-### 상단에 있는 play 실행파일 실행
+### 상단에 있는 activator 실행파일 실행
 
-    ../play
+    ../activator
 
 혹은 (윈도우 사용자일 경우)
 
-    ..\play
+    ..\activator
 
 실행하면 필요한 파일들을 web에서 내려받습니다. 첫 실행시 네트워크 상황에 따라 10여분 가까이 소요될 수 있습니다.
 
@@ -226,7 +225,7 @@
 시작 옵션은 조정가능합니다. 만약 시스템 메모리가 4기가 이상이라면
 아래 옵션으로 실행하는걸 권장합니다.
 
-    _JAVA_OPTIONS="-Xmx2048m -Xms1024m" play "start -DapplyEvolutions.default=true -Dhttp.port=9000"
+    _JAVA_OPTIONS="-Xmx2048m -Xms1024m" activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
     
 
 ### 브라우저로 접속
@@ -234,7 +233,7 @@
     http://127.0.0.1:9000
 
 80 포트 등으로 포트를 변경하고 싶을 경우에는 해당 포트가 사용가능한지 확인 한 다음 80 포트를 사용할 수 있는 계정으로 실행합니다.
-관련해서는 [http://www.playframework.com/documentation/2.1.1/Production](http://www.playframework.com/documentation/2.1.1/Production) 부분을 확인해 주세요.
+관련해서는 [http://www.playframework.com/documentation/2.3.6/Production](http://www.playframework.com/documentation/2.3.6/Production) 부분을 확인해 주세요.
 
 ### 업그레이드 하기
 
app/Global.java
--- app/Global.java
+++ app/Global.java
@@ -43,7 +43,7 @@
 import play.data.Form;
 import play.mvc.*;
 import play.mvc.Http.RequestHeader;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 
 import utils.AccessControl;
@@ -104,12 +104,12 @@
     private Action<Void> getDefaultAction(final Http.Request request) {
         final long start = System.currentTimeMillis();
         return new Action.Simple() {
-            public Promise<SimpleResult> call(Http.Context ctx) throws Throwable {
+            public Promise<Result> call(Http.Context ctx) throws Throwable {
                 UserApp.initTokenUser();
                 UserApp.updatePreferredLanguage();
                 ctx.response().setHeader("Date", DateUtils.formatDate(new Date()));
                 ctx.response().setHeader("Cache-Control", "no-cache");
-                Promise<SimpleResult> promise = delegate.call(ctx);
+                Promise<Result> promise = delegate.call(ctx);
                 AccessLogger.log(request, promise, start);
                 return promise;
             }
@@ -119,8 +119,8 @@
     private Action<Void> getRestartAction() {
         return new Action.Simple() {
             @Override
-            public Promise<SimpleResult> call(Http.Context ctx) throws Throwable {
-                return Promise.pure((SimpleResult) ok(restart.render()));
+            public Promise<Result> call(Http.Context ctx) throws Throwable {
+                return Promise.pure((Result) ok(restart.render()));
             }
         };
     }
@@ -128,20 +128,20 @@
     private Action<Void> getConfigSecretAction() {
         return new Action.Simple() {
             @Override
-            public Promise<SimpleResult> call(Http.Context ctx) throws Throwable {
+            public Promise<Result> call(Http.Context ctx) throws Throwable {
                 if( ctx.request().method().toLowerCase().equals("post") ) {
                     Form<User> newSiteAdminUserForm = form(User.class).bindFromRequest();
 
                     if (hasError(newSiteAdminUserForm)) {
-                        return Promise.pure((SimpleResult) badRequest(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, newSiteAdminUserForm)));
+                        return Promise.pure((Result) badRequest(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, newSiteAdminUserForm)));
                     }
 
                     User siteAdmin = SiteAdmin.updateDefaultSiteAdmin(newSiteAdminUserForm.get());
                     replaceSiteSecretKey(createSeed(siteAdmin.password));
                     isRestartRequired = true;
-                    return Promise.pure((SimpleResult) ok(restart.render()));
+                    return Promise.pure((Result) ok(restart.render()));
                 } else {
-                    return Promise.pure((SimpleResult) ok(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, new Form<>(User.class))));
+                    return Promise.pure((Result) ok(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, new Form<>(User.class))));
                 }
             }
 
@@ -211,26 +211,26 @@
     }
 
     @Override
-    public Promise<SimpleResult> onHandlerNotFound(RequestHeader request) {
+    public Promise<Result> onHandlerNotFound(RequestHeader request) {
         AccessLogger.log(request, null, Http.Status.NOT_FOUND);
-        return Promise.pure((SimpleResult) Results.notFound(ErrorViews.NotFound.render()));
+        return Promise.pure((Result) Results.notFound(ErrorViews.NotFound.render()));
     }
 
     @Override
-    public Promise<SimpleResult> onError(RequestHeader request, Throwable t) {
+    public Promise<Result> onError(RequestHeader request, Throwable t) {
         AccessLogger.log(request, null, Http.Status.INTERNAL_SERVER_ERROR);
 
         if (Play.isProd()) {
-            return Promise.pure((SimpleResult) Results.internalServerError(views.html.error.internalServerError_default.render("error.internalServerError")));
+            return Promise.pure((Result) Results.internalServerError(views.html.error.internalServerError_default.render("error.internalServerError")));
         } else {
             return super.onError(request, t);
         }
     }
 
     @Override
-    public Promise<SimpleResult> onBadRequest(RequestHeader request, String error) {
+    public Promise<Result> onBadRequest(RequestHeader request, String error) {
         AccessLogger.log(request, null, Http.Status.BAD_REQUEST);
-        return Promise.pure((SimpleResult) badRequest(ErrorViews.BadRequest.render()));
+        return Promise.pure((Result) badRequest(ErrorViews.BadRequest.render()));
     }
 
 }
app/actions/AbstractProjectCheckAction.java
--- app/actions/AbstractProjectCheckAction.java
+++ app/actions/AbstractProjectCheckAction.java
@@ -29,7 +29,7 @@
 import play.mvc.Action;
 import play.mvc.Http.Context;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 import utils.AccessControl;
 import utils.AccessLogger;
@@ -48,21 +48,21 @@
  */
 public abstract class AbstractProjectCheckAction<T> extends Action<T> {
     @Override
-    public final Promise<SimpleResult> call(Context context) throws Throwable {
+    public final Promise<Result> call(Context context) throws Throwable {
         PathParser parser = new PathParser(context);
         String ownerLoginId = parser.getOwnerLoginId();
         String projectName = parser.getProjectName();
 
         Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName);
 
-        Promise<SimpleResult> promise;
+        Promise<Result> promise;
 
         if (project == null) {
             if (UserApp.currentUser() == User.anonymous){
                 flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
-                promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
+                promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
             } else {
-                promise = Promise.pure((SimpleResult) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
+                promise = Promise.pure((Result) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
             }
 
             AccessLogger.log(context.request(), promise, null);
@@ -72,7 +72,7 @@
 
         if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) {
             flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
-            promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
+            promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
             AccessLogger.log(context.request(), promise, null);
             return promise;
         }
@@ -80,6 +80,6 @@
         return call(project, context, parser);
     }
 
-    protected abstract Promise<SimpleResult> call(Project project, Context context, PathParser parser)
+    protected abstract Promise<Result> call(Project project, Context context, PathParser parser)
             throws Throwable;
 }
app/actions/AnonymousCheckAction.java
--- app/actions/AnonymousCheckAction.java
+++ app/actions/AnonymousCheckAction.java
@@ -26,7 +26,7 @@
 import play.mvc.Action;
 import play.mvc.Http.Context;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 import utils.AccessControl;
 import utils.AccessLogger;
@@ -42,7 +42,7 @@
 public class AnonymousCheckAction extends Action<AnonymousCheck> {
 
     @Override
-    public Promise<SimpleResult> call(Context context) throws Throwable {
+    public Promise<Result> call(Context context) throws Throwable {
         if ((AccessControl.isAnonymousNotAllowed() || configuration.requiresLogin()) &&
                 UserApp.currentUser().isAnonymous()) {
             if (configuration.displaysFlashMessage()) {
@@ -50,7 +50,7 @@
             }
             String loginFormUrl = routes.UserApp.loginForm().url();
             loginFormUrl += "?redirectUrl=" + context.request().path();
-            Promise<SimpleResult> promise = Promise.pure(redirect(loginFormUrl));
+            Promise<Result> promise = Promise.pure(redirect(loginFormUrl));
             AccessLogger.log(context.request(), promise, null);
             return promise;
         }
app/actions/DefaultProjectCheckAction.java
--- app/actions/DefaultProjectCheckAction.java
+++ app/actions/DefaultProjectCheckAction.java
@@ -24,7 +24,7 @@
 import models.Project;
 import play.mvc.Http.Context;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 
 /**
@@ -36,7 +36,7 @@
  */
 public class DefaultProjectCheckAction extends AbstractProjectCheckAction<Void> {
     @Override
-    protected Promise<SimpleResult> call(Project project, Context context, PathParser parser) throws Throwable {
+    protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
         return this.delegate.call(context);
     }
 }
app/actions/IsAllowedAction.java
--- app/actions/IsAllowedAction.java
+++ app/actions/IsAllowedAction.java
@@ -30,7 +30,7 @@
 import models.resource.ResourceConvertible;
 import play.mvc.Http.Context;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 import utils.AccessControl;
 import utils.AccessLogger;
@@ -49,19 +49,19 @@
  */
 public class IsAllowedAction extends AbstractProjectCheckAction<IsAllowed> {
     @Override
-    protected Promise<SimpleResult> call(Project project, Context context, PathParser parser) throws Throwable {
+    protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
         ResourceType resourceType = this.configuration.resourceType();
         ResourceConvertible resourceObject = Resource.getResourceObject(parser, project, resourceType);
         Operation operation = this.configuration.value();
 
         if(resourceObject == null) {
-            Promise<SimpleResult> promise = Promise.pure((SimpleResult) notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource())));
+            Promise<Result> promise = Promise.pure((Result) notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource())));
             AccessLogger.log(context.request(), promise, null);
             return promise;
         }
 
         if(!AccessControl.isAllowed(UserApp.currentUser(), resourceObject.asResource(), operation)) {
-            Promise<SimpleResult> promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
+            Promise<Result> promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
             AccessLogger.log(context.request(), promise, null);
             return promise;
         }
app/actions/IsCreatableAction.java
--- app/actions/IsCreatableAction.java
+++ app/actions/IsCreatableAction.java
@@ -24,7 +24,7 @@
 import models.User;
 import play.mvc.Http.Context;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 import utils.AccessControl;
 import utils.AccessLogger;
@@ -43,10 +43,10 @@
  */
 public class IsCreatableAction extends AbstractProjectCheckAction<IsCreatable> {
     @Override
-    protected Promise<SimpleResult> call(Project project, Context context, PathParser parser) throws Throwable {
+    protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
         User currentUser = UserApp.currentUser();
         if (!AccessControl.isProjectResourceCreatable(currentUser, project, this.configuration.value())) {
-            Promise<SimpleResult> promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
+            Promise<Result> promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
             AccessLogger.log(context.request(), promise, null);
             return promise;
         }
app/actions/IsOnlyGitAvailableAction.java
--- app/actions/IsOnlyGitAvailableAction.java
+++ app/actions/IsOnlyGitAvailableAction.java
@@ -25,7 +25,7 @@
 import models.Project;
 import play.mvc.Http.Context;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 import utils.AccessLogger;
 import utils.ErrorViews;
@@ -40,9 +40,9 @@
  */
 public class IsOnlyGitAvailableAction extends AbstractProjectCheckAction<IsOnlyGitAvailable> {
     @Override
-    protected Promise<SimpleResult> call(Project project, Context context, PathParser parser) throws Throwable {
+    protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
         if(!project.isGit()) {
-            Promise<SimpleResult> promise = Promise.pure((SimpleResult) badRequest(ErrorViews.BadRequest.render("error.badrequest.only.available.for.git")));
+            Promise<Result> promise = Promise.pure((Result) badRequest(ErrorViews.BadRequest.render("error.badrequest.only.available.for.git")));
             AccessLogger.log(context.request(), promise, null);
             return promise;
         }
app/actions/NullProjectCheckAction.java
--- app/actions/NullProjectCheckAction.java
+++ app/actions/NullProjectCheckAction.java
@@ -28,7 +28,7 @@
 import play.mvc.Action;
 import play.mvc.Http;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 import utils.AccessLogger;
 import utils.ErrorViews;
@@ -45,7 +45,7 @@
 public class NullProjectCheckAction extends Action<Void> {
 
     @Override
-    public Promise<SimpleResult> call(Http.Context context) throws Throwable {
+    public Promise<Result> call(Http.Context context) throws Throwable {
         PathParser parser = new PathParser(context);
         String ownerLoginId = parser.getOwnerLoginId();
         String projectName = parser.getProjectName();
@@ -53,13 +53,13 @@
         Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName);
 
         if (project == null) {
-            Promise<SimpleResult> promise;
+            Promise<Result> promise;
 
             if (UserApp.currentUser() == User.anonymous){
                 flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
-                promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
+                promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
             } else {
-                promise = Promise.pure((SimpleResult) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
+                promise = Promise.pure((Result) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
             }
 
             AccessLogger.log(context.request(), promise, null);
app/controllers/IssueApp.java
--- app/controllers/IssueApp.java
+++ app/controllers/IssueApp.java
@@ -34,7 +34,7 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.tika.Tika;
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import play.api.templates.Html;
+import play.twirl.api.Html;
 import play.data.Form;
 import play.data.validation.ValidationError;
 import play.db.ebean.Transactional;
app/controllers/PullRequestApp.java
--- app/controllers/PullRequestApp.java
+++ app/controllers/PullRequestApp.java
@@ -47,7 +47,7 @@
 import play.libs.Json;
 import play.mvc.Controller;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import playRepository.GitBranch;
 import playRepository.GitRepository;
 import playRepository.RepositoryService;
app/models/Attachment.java
--- app/models/Attachment.java
+++ app/models/Attachment.java
@@ -54,7 +54,7 @@
 import play.db.ebean.Model;
 import play.libs.Akka;
 import scala.concurrent.duration.Duration;
-import scalax.file.NotDirectoryException;
+import java.nio.file.NotDirectoryException;
 import utils.FileUtil;
 import utils.JodaDateUtil;
 
app/utils/AccessLogger.java
--- app/utils/AccessLogger.java
+++ app/utils/AccessLogger.java
@@ -25,7 +25,7 @@
 import play.libs.F.Callback;
 import play.libs.F.Promise;
 import play.mvc.Http;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -86,13 +86,13 @@
      * @see <a href="http://httpd.apache.org/docs/2.2/en/logs.html#combined">Combined Log Format - Apache HTTP Server</a>
      * @see <a href="http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats">Custom Log Formats - Apache HTTP Server</a>
      */
-    public static void log(final Http.Request request, final Promise<SimpleResult> promise,
+    public static void log(final Http.Request request, final Promise<Result> promise,
             final Long startTimeMillis) {
         final String username = UserApp.currentUser().loginId;
-        promise.onRedeem(new Callback<SimpleResult>() {
+        promise.onRedeem(new Callback<Result>() {
             @Override
-            public void invoke(final SimpleResult result) throws Throwable {
-                log(request, username, result.getWrappedSimpleResult().header().status(),
+            public void invoke(final Result result) throws Throwable {
+                log(request, username, result.toScala().header().status(),
                         startTimeMillis);
             }
         });
app/utils/BasicAuthAction.java
--- app/utils/BasicAuthAction.java
+++ app/utils/BasicAuthAction.java
@@ -29,7 +29,7 @@
 import play.mvc.Http.Request;
 import play.mvc.Http.Response;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 
 import java.io.UnsupportedEncodingException;
@@ -98,16 +98,16 @@
     }
 
     @Override
-    public Promise<SimpleResult> call(Context context) throws Throwable {
+    public Promise<Result> call(Context context) throws Throwable {
         User user;
         try {
             user = authenticate(context.request());
         } catch (MalformedCredentialsException error) {
-            Promise<SimpleResult> promise = Promise.pure((SimpleResult) badRequest());
+            Promise<Result> promise = Promise.pure((Result) badRequest());
             AccessLogger.log(context.request(), promise, null);
             return promise;
         } catch (UnsupportedEncodingException e) {
-            Promise<SimpleResult> promise = Promise.pure((SimpleResult) internalServerError());
+            Promise<Result> promise = Promise.pure((Result) internalServerError());
             AccessLogger.log(context.request(), promise, null);
             return promise;
         }
app/utils/ErrorViews.java
--- app/utils/ErrorViews.java
+++ app/utils/ErrorViews.java
@@ -23,7 +23,7 @@
 import models.Organization;
 import models.Project;
 import models.User;
-import play.api.templates.Html;
+import play.twirl.api.Html;
 import views.html.index.index;
 
 
app/utils/PlayServletContext.java
--- app/utils/PlayServletContext.java
+++ app/utils/PlayServletContext.java
@@ -302,4 +302,7 @@
         throw new UnsupportedOperationException();
     }
 
+    public String getVirtualServerName() {
+        throw new UnsupportedOperationException();
+    }
 }
app/utils/PlayServletRequest.java
--- app/utils/PlayServletRequest.java
+++ app/utils/PlayServletRequest.java
@@ -115,6 +115,16 @@
         return Integer.parseInt(contentLength);
     }
 
+    public long getContentLengthLong() {
+        String contentLength = request.getHeader(Http.HeaderNames.CONTENT_LENGTH);
+
+        if (contentLength == null) {
+            return -1;
+        }
+
+        return Long.parseLong(contentLength);
+    }
+
     @Override
     public String getContentType() {
         return request.getHeader(Http.HeaderNames.CONTENT_TYPE);
@@ -172,6 +182,18 @@
             protected void finalize() throws Throwable {
                 close();
                 super.finalize();
+            }
+
+            public void setReadListener(javax.servlet.ReadListener readListener) {
+                throw new UnsupportedOperationException();
+            }
+
+            public boolean isReady() {
+                throw new UnsupportedOperationException();
+            }
+
+            public boolean isFinished() {
+                throw new UnsupportedOperationException();
             }
         };
     }
@@ -556,4 +578,14 @@
         throw new UnsupportedOperationException();
     }
 
+    public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(java.lang.Class<T> httpUpgradeHandlerClass)
+	    throws java.io.IOException,
+		   ServletException {
+        throw new UnsupportedOperationException();
+    }
+
+    public String changeSessionId() {
+        throw new UnsupportedOperationException();
+    }
+
 }
app/utils/PlayServletResponse.java
--- app/utils/PlayServletResponse.java
+++ app/utils/PlayServletResponse.java
@@ -101,6 +101,14 @@
             target.close();
             super.close();
         }
+
+        public void setWriteListener(WriteListener writeListener) {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean isReady() {
+            throw new UnsupportedOperationException();
+        }
     }
 
     public PlayServletResponse(Response response) throws IOException {
@@ -189,6 +197,10 @@
     @Override
     public void setContentLength(int length) {
         this.response.setHeader(Http.HeaderNames.CONTENT_LENGTH, Integer.toString(length));
+    }
+
+    public void setContentLengthLong(long length) {
+        this.response.setHeader(Http.HeaderNames.CONTENT_LENGTH, Long.toString(length));
     }
 
     @Override
@@ -380,4 +392,8 @@
         }
         return (encoding.trim());
     }
+
+    public String getVirtualServerName() {
+        throw new UnsupportedOperationException();
+    }
 }
app/utils/SiteManagerAuthAction.java
--- app/utils/SiteManagerAuthAction.java
+++ app/utils/SiteManagerAuthAction.java
@@ -24,7 +24,7 @@
 import play.mvc.Action;
 import play.mvc.Http.Context;
 import play.mvc.Result;
-import play.mvc.SimpleResult;
+import play.mvc.Result;
 import play.libs.F.Promise;
 
 /**
@@ -32,9 +32,9 @@
  */
 public class SiteManagerAuthAction extends Action.Simple {
     @Override
-    public Promise<SimpleResult> call(Context context) throws Throwable {
+    public Promise<Result> call(Context context) throws Throwable {
         if (!UserApp.currentUser().isSiteManager()) {
-            return Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.auth.unauthorized.waringMessage")));
+            return Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.auth.unauthorized.waringMessage")));
         }
         return delegate.call(context);
     }
app/utils/TemplateHelper.scala
--- app/utils/TemplateHelper.scala
+++ app/utils/TemplateHelper.scala
@@ -25,7 +25,7 @@
 import play.api.i18n.Lang
 import models.CodeCommentThread
 import models.CommentThread
-import play.api.templates.Html
+import play.twirl.api.Html
 
 object TemplateHelper {
 
@@ -364,12 +364,12 @@
     def shortId(commitId: String) = commitId.substring(0, Math.min(7, commitId.size))
 
     @tailrec
-    def renderNonRangedThreads(threads: List[models.CommentThread], commitId: String, html: play.api.templates.Html): play.api.templates.Html =
+    def renderNonRangedThreads(threads: List[models.CommentThread], commitId: String, html: play.twirl.api.Html): play.twirl.api.Html =
       threads match {
         case head :: tail =>
           head match {
             case (thread: models.NonRangedCodeCommentThread)
-              if commitId == null || commitId == thread.commitId => html += partial_comment_thread(thread)
+              if commitId == null || commitId == thread.commitId => new Html(List(html, partial_comment_thread(thread)))
             case _ => ;
           }
           renderNonRangedThreads(tail, commitId, html)
@@ -378,16 +378,16 @@
 
     @tailrec
     def _renderEventsOnPullRequest(pull: PullRequest, events: List[PullRequestEvent],
-                                   html: play.api.templates.Html): play.api.templates.Html =
+                                   html: play.twirl.api.Html): play.twirl.api.Html =
       events match {
         case head :: tail =>
-          html += partial_pull_request_event(pull, head)
+          new Html(List(html, partial_pull_request_event(pull, head)))
           _renderEventsOnPullRequest(pull, tail, html)
         case _ => html
       }
 
     def renderEventsOnPullRequest(pull: PullRequest) =
-      _renderEventsOnPullRequest(pull, pull.pullRequestEvents.toList, play.api.templates.Html(""))
+      _renderEventsOnPullRequest(pull, pull.pullRequestEvents.toList, play.twirl.api.Html(""))
 
     def urlToCommentThread(thread: CommentThread) = {
         urlToContainer(thread) + "#thread-" + thread.id
app/views/board/create.scala.html
--- app/views/board/create.scala.html
+++ app/views/board/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form:Form[Posting], project:Project, isAllowedToNotice:Boolean, preparedPostBody:String = "")
+@(title:String, form: play.data.Form[Posting], project:Project, isAllowedToNotice:Boolean, preparedPostBody:String = "")
 
 @import utils.AccessControl._
 @import utils.TemplateHelper._
@@ -27,7 +27,7 @@
 @implicitField = @{ helper.FieldConstructor(simpleForm) }
 
 @readmeUpdateMessage = @{
-  if( request().getQueryString("readme") != null ) {
+  if( requestHeader.getQueryString("readme") != null ) {
       "Update README.md"
   }
 }
@@ -66,7 +66,7 @@
         @** end of fileUploader **@
 
         <div class="right-txt mt10 mb10">
-          @if(isAllowedToNotice && !stringToBoolean(request().getQueryString("readme"))){
+          @if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){
           <label class="checkbox">
             <input type="checkbox" id="notice" name="notice">
             @Messages("post.notice.label")
@@ -74,9 +74,9 @@
           }
 
           @if(isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.COMMIT)){
-            @if(project.isGit && stringToBoolean(request().getQueryString("readme"))){
+            @if(project.isGit && stringToBoolean(requestHeader.getQueryString("readme").get)){
             <label class="checkbox">
-              <input type="checkbox" id="readme" name="readme" @boolToCheckedString(request().getQueryString("readme"))>
+              <input type="checkbox" id="readme" name="readme" @boolToCheckedString(requestHeader.getQueryString("readme"))>
               @Messages("post.readmefy")
             </label>
             }
app/views/board/edit.scala.html
--- app/views/board/edit.scala.html
+++ app/views/board/edit.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form:Form[Posting], posting:Posting, number:Long,  project:Project, isAllowedToNotice:Boolean)
+@(title:String, form: play.data.Form[Posting], posting:Posting, number:Long,  project:Project, isAllowedToNotice:Boolean)
 
 @import utils.AccessControl._
 @import utils.TemplateHelper._
@@ -60,7 +60,7 @@
         @** end of fileUploader **@
 
         <div class="right-txt mt10 mb10">
-          @if(isAllowedToNotice && !stringToBoolean(request().getQueryString("readme"))){
+          @if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){
             @helper.input(form("notice")){(id, name, value, args) =>
             <label class="checkbox">
               <input type="checkbox" id="notice" name="notice" @toHtmlArgs(args) @(if(value.equals(Some("true"))) "checked" else "")/>
app/views/board/view.scala.html
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(post:Posting, commentForm:Form[PostingComment],  project:Project)
+@(post:Posting, commentForm: play.data.Form[PostingComment],  project:Project)
 
 @import utils.JodaDateUtil
 @import utils.TemplateHelper._
@@ -28,7 +28,7 @@
 @import utils.Markdown
 @implicitField = @{ helper.FieldConstructor(simpleForm) }
 
-@urlToPostings = @{ urlToList(request.getHeader("Referer"), routes.BoardApp.posts(project.owner, project.name).toString()) }
+@urlToPostings = @{ urlToList(requestHeader.headers.get("Referer").get, routes.BoardApp.posts(project.owner, project.name).toString()) }
 
 @projectLayout(post.title, project, utils.MenuType.BOARD){
 @projectMenu(project, utils.MenuType.BOARD, "main-menu-only")
app/views/code/branches.scala.html
--- app/views/code/branches.scala.html
+++ app/views/code/branches.scala.html
@@ -57,7 +57,7 @@
                     <tbody>
                         @partial_branchrow(project, head, true)
 
-                        @for(branch <- branches.iterator()) {
+                        @for(branch <- branches.iterator) {
                             @partial_branchrow(project, branch, false)
                         }
                     </tbody>
app/views/code/diff.scala.html
--- app/views/code/diff.scala.html
+++ app/views/code/diff.scala.html
@@ -151,7 +151,7 @@
                                     <p class="content">@thread.getFirstReviewComment().getContents()</p>
                                     <span class="date" title="@utils.JodaDateUtil.getDateString(thread.createdDate)">
                                         <span class="comments">
-                                        @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size()}
+                                        @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size}
                                         </span>
                                         <span class="avatar-wrap smaller margin-right-5">
                                             <img src="@User.findByLoginId(thread.author.loginId).avatarUrl" alt="@thread.author.name" />
@@ -170,7 +170,7 @@
                                     <p class="content">@thread.getFirstReviewComment().getContents()</p>
                                     <span class="date" title="@utils.JodaDateUtil.getDateString(thread.createdDate)">
                                         <span class="comments">
-                                        @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size()}
+                                        @if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size}
                                         </span>
                                         <span class="avatar-wrap smaller margin-right-5">
                                             <img src="@User.findByLoginId(thread.author.loginId).avatarUrl" alt="@thread.author.name" />
app/views/code/history.scala.html
--- app/views/code/history.scala.html
+++ app/views/code/history.scala.html
@@ -77,7 +77,7 @@
 }
 
 @isHistoryExistAndHasParent(history: List[playRepository.Commit]) = @{
-    (history.size() > 0 && history.get(history.size() - 1).getParentCount() > 0)
+    (history.size > 0 && history.get(history.size - 1).getParentCount() > 0)
 }
 
 @projectLayout(Messages("title.commitHistory"), project, utils.MenuType.CODE) {
@@ -137,7 +137,7 @@
                             @if(history.isEmpty()){
                                 <tr><td colspan="5" class="warning-none">@Messages("code.nocommits")</td></tr>
                             }
-                            @for(commit <- history.iterator()) {
+                            @for(commit <- history.iterator) {
                             @defining(getShowCommitURL(project, commit, path)){ showCommitURL =>
                             <tr>
                                 <td class="commit-id">
app/views/code/nohead.scala.html
--- app/views/code/nohead.scala.html
+++ app/views/code/nohead.scala.html
@@ -21,12 +21,12 @@
 @(project: Project)
 
 @getCodeURL(project: Project) = @{
-    if(session == null){
+    if(requestHeader.session == null){
         CodeApp.getURL(project.owner, project.name)
     } else {
-        defining(ProjectUser.roleOf(session.get("loginId"), project)) { role =>
+        defining(ProjectUser.roleOf(UserApp.currentUser.loginId, project)) { role =>
             if(role == "manager" || role == "member"){
-                CodeApp.getURL(project.owner, project.name).replace("://", "://" + session.get("loginId") + "@")
+                CodeApp.getURL(project.owner, project.name).replace("://", "://" + UserApp.currentUser.loginId + "@")
             } else {
                 CodeApp.getURL(project.owner, project.name)
             }
app/views/common/commentForm.scala.html
--- app/views/common/commentForm.scala.html
+++ app/views/common/commentForm.scala.html
@@ -24,7 +24,7 @@
 @import models.enumeration.ResourceType
 @import utils.AccessControl._
 
-@if(isResourceCreatable(User.findByLoginId(session.get("loginId")), container, resourceType)){
+@if(isResourceCreatable(UserApp.currentUser, container, resourceType)){
 
     <form id="comment-form" action="@action" method="post" enctype="multipart/form-data">
         <div class="write-comment-box">
app/views/common/debug.scala.html
--- app/views/common/debug.scala.html
+++ app/views/common/debug.scala.html
@@ -22,5 +22,5 @@
 @import play.api.Play.current
 
 <div class="container">
-    lang = @lang.code
+    lang = @implicitJavaLang.code
 </div>
app/views/common/scripts.scala.html
--- app/views/common/scripts.scala.html
+++ app/views/common/scripts.scala.html
@@ -101,7 +101,7 @@
 
         // current language set!
         if (typeof window.moment == "function" && typeof window.moment.lang == "function") {
-            moment.lang("@lang.language");
+            moment.lang("@implicitJavaLang.language");
         }
 
      	// yobi.Dropdown
@@ -120,10 +120,15 @@
                 $(htInfo.welTarget.parents("form").get(0)).submit();
             }
         });
-        @if(session.contains("loginId")){
-            yobi.ShortcutKey.setKeymapLink({
-            "P": "@routes.UserApp.userInfo(session.get("loginId"))"
-        });
+        @requestHeader.session.get("loginId") match {
+            case Some(loginId) => { }
+            case None => { }
+        }
+        @requestHeader.session.get("loginId") match {
+            case Some(v) => { yobi.ShortcutKey.setKeymapLink({
+                "P": "@routes.UserApp.userInfo(v)"
+            }); }
+            case None => { }
         }
 
         // yobi.Files
@@ -168,14 +173,11 @@
         }
 
         // notify flash messages
-        @for(key <- flash.keys) {
-            @if(key != utils.Constants.TITLE &&
-                key != utils.Constants.DESCRIPTION){
-                $yobi.notify("@Messages(flash.get(key))", 3000);
+        @requestHeader.flash.get(utils.Constants.TITLE) match {
+            case Some(title) => { $yobi.alert("@Messages(title)", null, "@Messages(requestHeader.flash.get(utils.Constants.DESCRIPTION).get)"); }
+            case None => { @requestHeader.flash.data.foreach {
+                case (_, value) => { $yobi.notify("@Messages(value)", 3000); }
             }
-            @if(key == utils.Constants.TITLE){
-                $yobi.alert("@Messages(flash.get(key))", null,
-                            "@Messages(flash.get(utils.Constants.DESCRIPTION))");
             }
         }
 
app/views/common/select2.scala.html
--- app/views/common/select2.scala.html
+++ app/views/common/select2.scala.html
@@ -22,7 +22,7 @@
 <script src="@routes.Assets.at("javascripts/lib/select2/select2.js")"></script>
 <script src="@routes.Assets.at("javascripts/common/yobi.ui.Select2.js")"></script>
 @{
-    lang.language match {
+    implicitJavaLang.language match {
         case "ko" => {
             Html("<script src=\"" + routes.Assets.at("javascripts/lib/select2/select2_locale_ko.js") + "\"></script>")
         }
app/views/common/usermenu.scala.html
--- app/views/common/usermenu.scala.html
+++ app/views/common/usermenu.scala.html
@@ -22,105 +22,108 @@
 @import utils.TemplateHelper._
 @orderString = @{"createdDate DESC"}
 <ul class="gnb-usermenu">
-    @if(session.contains("loginId")){
-    <li class="gnb-usermenu-dropdown">
-        <a href="javascript:void(0);" class="gnb-dropdown-toggle dropdwon-box-btn" data-toggle="dropdown">
-            <i class="yobicon-plus"></i>
-            <span class="caret"></span>
-        </a>
-        <ul class="dropdown-menu flat right">
-            <li>
-                <a href="@routes.ProjectApp.newProjectForm()">
-                    @Messages("button.newProject")
-                </a>
-            </li>
-            <li>
-                <a href="@routes.OrganizationApp.newForm()">
-                    @Messages("title.newOrganization")
-                </a>
-            </li>
-        </ul>
-    </li>
-    @if(session.get("userId").equals("1")) {
-    <li class="gnb-usermenu-item">
-        <a href="@routes.SiteApp.userList()" data-toggle="tooltip" title="@Messages("menu.siteAdmin")" data-placement="bottom" class="usermenu-icon-button">
-            <i class="yobicon-wrench"></i>
-        </a>
-    </li>
-    }
-    <li class="gnb-usermenu-dropdown">
-        <a href="javascript:void(0);" class="gnb-dropdown-toggle" data-toggle="dropdown">
-            <span class="avatar-wrap smaller">
-                <img src="@User.findByLoginId(session.get("loginId")).avatarUrl" />
-            </span>
-            <span class="caret"></span>
-        </a>
-        <ul class="dropdown-menu flat right">
-            <li class="title">
-                @User.findByLoginId(session.get("loginId")).name <span class="disabled">@{"@"}@session.get("loginId")</span>
-            </li>
-            <li>
-                <a href="@routes.IssueApp.userIssues()">@Messages("issue.myIssue")</a>
-            </li>
-            <li>
-                <a href="@routes.UserApp.userInfo(session.get("loginId"))">@Messages("userinfo.profile")</a>
-            </li>
-            <li>
-                <a href="@routes.UserApp.editUserInfoForm()">
-                    @Messages("userinfo.accountSetting")
-                 </a>
-            </li>
-            <li>
-                <a href="@routes.UserApp.logout()">
-                    @Messages("title.logout")
-                </a>
-            </li>
-            @defining(UserApp.currentUser.getOrganizations(5)) { groups =>
-                <li class="title">
-                    @Messages("title.organization")
-                    <span class="numberic">@groups.size</span>
+    @requestHeader.session.get("loginId") match {
+      case Some(loginId) => {
+        <li class="gnb-usermenu-dropdown">
+            <a href="javascript:void(0);" class="gnb-dropdown-toggle dropdwon-box-btn" data-toggle="dropdown">
+                <i class="yobicon-plus"></i>
+                <span class="caret"></span>
+            </a>
+            <ul class="dropdown-menu flat right">
+                <li>
+                    <a href="@routes.ProjectApp.newProjectForm()">
+                        @Messages("button.newProject")
+                    </a>
                 </li>
-                @if(groups.length > 0) {
-                    @for(organization <- groups){
-                        <li><a href="@routes.OrganizationApp.organization(organization.name)">@if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>} <span class="bold">@organization.name</span></a></li>
+                <li>
+                    <a href="@routes.OrganizationApp.newForm()">
+                        @Messages("title.newOrganization")
+                    </a>
+                </li>
+            </ul>
+        </li>
+        @if(requestHeader.session.get("userId").equals("1")) {
+        <li class="gnb-usermenu-item">
+            <a href="@routes.SiteApp.userList()" data-toggle="tooltip" title="@Messages("menu.siteAdmin")" data-placement="bottom" class="usermenu-icon-button">
+                <i class="yobicon-wrench"></i>
+            </a>
+        </li>
+        }
+        <li class="gnb-usermenu-dropdown">
+            <a href="javascript:void(0);" class="gnb-dropdown-toggle" data-toggle="dropdown">
+                <span class="avatar-wrap smaller">
+                    <img src="@User.findByLoginId(loginId).avatarUrl" />
+                </span>
+                <span class="caret"></span>
+            </a>
+            <ul class="dropdown-menu flat right">
+                <li class="title">
+                    @User.findByLoginId(loginId).name <span class="disabled">@{"@"}@loginId</span>
+                </li>
+                <li>
+                    <a href="@routes.IssueApp.userIssues()">@Messages("issue.myIssue")</a>
+                </li>
+                <li>
+                    <a href="@routes.UserApp.userInfo(loginId)">@Messages("userinfo.profile")</a>
+                </li>
+                <li>
+                    <a href="@routes.UserApp.editUserInfoForm()">
+                        @Messages("userinfo.accountSetting")
+                    </a>
+                </li>
+                <li>
+                    <a href="@routes.UserApp.logout()">
+                        @Messages("title.logout")
+                    </a>
+                </li>
+                @defining(UserApp.currentUser.getOrganizations(5)) { groups =>
+                    <li class="title">
+                        @Messages("title.organization")
+                        <span class="numberic">@groups.size</span>
+                    </li>
+                    @if(groups.size > 0) {
+                        @for(organization <- groups){
+                            <li><a href="@routes.OrganizationApp.organization(organization.name)">@if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>} <span class="bold">@organization.name</span></a></li>
+                        }
+                    } else {
+                        <li class="empty">@Messages("organization.is.empty")</li>
                     }
-                } else {
-                    <li class="empty">@Messages("organization.is.empty")</li>
                 }
-            }
-            @defining(UserApp.currentUser.getVisitedProjects(10)){ visitedProjects =>
-                <li class="title">
-                    @Messages("project.recently.visited")
-                    <span class="numberic">@visitedProjects.size</span>
-                </li>
-                @if(visitedProjects.length > 0) {
-                    @for(visited <- visitedProjects){
-                        <li><a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)">@if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)">} else{<span class="dummy-25px"> </span>} <span class="bold">@visited.project.name</span> <span class="darkgray-txt small-font margin-right-15">of @visited.project.owner</span></a></li>
-                    }
-                } else {
-                    @defining(Project.findProjectsCreatedByUser(UserApp.currentUser.loginId, orderString)) { myProjects =>
-                        @if(myProjects.length > 0) {
-                            @for(project <- myProjects){
-                                <li>@if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)">} <a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="bold">@project.name</span> <span class="darkgray-txt small-font margin-right-15">of @project.owner</span></a></li>
+                @defining(UserApp.currentUser.getVisitedProjects(10)){ visitedProjects =>
+                    <li class="title">
+                        @Messages("project.recently.visited")
+                        <span class="numberic">@visitedProjects.size</span>
+                    </li>
+                    @if(visitedProjects.size > 0) {
+                        @for(visited <- visitedProjects){
+                            <li><a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)">@if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)">} else{<span class="dummy-25px"> </span>} <span class="bold">@visited.project.name</span> <span class="darkgray-txt small-font margin-right-15">of @visited.project.owner</span></a></li>
+                        }
+                    } else {
+                        @defining(Project.findProjectsCreatedByUser(UserApp.currentUser.loginId, orderString)) { myProjects =>
+                            @if(myProjects.size > 0) {
+                                @for(project <- myProjects){
+                                    <li>@if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)">} <a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="bold">@project.name</span> <span class="darkgray-txt small-font margin-right-15">of @project.owner</span></a></li>
+                                }
+                            } else {
+                                <li class="empty">@Messages("project.is.empty")</li>
                             }
-                        } else {
-                            <li class="empty">@Messages("project.is.empty")</li>
                         }
                     }
                 }
-            }
-        </ul>
-    </li>
-    } else {
-    <li>
-        <a href="@routes.UserApp.signupForm()" class="ybtn ybtn-success">
-            @Messages("title.signup")
-        </a>
-    </li>
-    <li class="gnb-usermenu-item">
-        <a href="@routes.UserApp.loginForm()" class="user-item-btn" data-login="required">
-            @Messages("title.login")
-        </a>
-    </li>
+            </ul>
+        </li>
+      }
+      case None => {
+        <li>
+            <a href="@routes.UserApp.signupForm()" class="ybtn ybtn-success">
+                @Messages("title.signup")
+            </a>
+        </li>
+        <li class="gnb-usermenu-item">
+            <a href="@routes.UserApp.loginForm()" class="user-item-btn" data-login="required">
+                @Messages("title.login")
+            </a>
+        </li>
+      }
     }
 </ul>
app/views/error/forbidden.scala.html
--- app/views/error/forbidden.scala.html
+++ app/views/error/forbidden.scala.html
@@ -28,7 +28,7 @@
       <i class="ico ico-err2"></i>
       <p>@Messages(messageKey)</p>
       @if(UserApp.currentUser.isAnonymous){
-      <a href="@routes.UserApp.loginForm?redirectUrl=@request.uri" class="ybtn ybtn-primary" data-login="required">@Messages("title.login")</a>
+      <a href="@routes.UserApp.loginForm?redirectUrl=@requestHeader.uri" class="ybtn ybtn-primary" data-login="required">@Messages("title.login")</a>
       }
     </div>
   </div>
app/views/git/create.scala.html
--- app/views/git/create.scala.html
+++ app/views/git/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form:Form[PullRequest], project:Project, projects:List[Project],
+@(title:String, form: play.data.Form[PullRequest], project:Project, projects:List[Project],
   fromProject:Project, toProject:Project,
   fromBranches:List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch],
   pullRequest:models.PullRequest)
app/views/git/edit.scala.html
--- app/views/git/edit.scala.html
+++ app/views/git/edit.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form:Form[PullRequest], project:Project,
+@(title:String, form: play.data.Form[PullRequest], project:Project,
   fromBranches: List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch],
   pullRequest:models.PullRequest)
 
app/views/git/fork.scala.html
--- app/views/git/fork.scala.html
+++ app/views/git/fork.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, project: Project, forkProject: Project, forkedProjects: List[Project], form: Form[Project], orgUserList:List[OrganizationUser])
+@(title:String, project: Project, forkProject: Project, forkedProjects: List[Project], form: play.data.Form[Project], orgUserList:List[OrganizationUser])
 
 @import utils.TemplateHelper._
 @import controllers.UserApp
app/views/git/partial_list.scala.html
--- app/views/git/partial_list.scala.html
+++ app/views/git/partial_list.scala.html
@@ -25,8 +25,8 @@
 @import org.apache.commons.lang3.StringUtils
 
 <ul class="post-list-wrap">
-@if(page.getList.size()> 0){
-    @for(req <- page.getList.iterator()) {
+@if(page.getList.size> 0){
+    @for(req <- page.getList.iterator) {
     @defining(User.findByLoginId(req.contributor.loginId)){ user =>
         <li class="post-item">
             <div class="span10">
app/views/git/partial_pull_request_event.scala.html
--- app/views/git/partial_pull_request_event.scala.html
+++ app/views/git/partial_pull_request_event.scala.html
@@ -55,7 +55,7 @@
             @if(event.newValue == PullRequestReviewAction.DONE.name) {
             <li class="event" id="comment-@event.id">
                 <span class="state changed">@Messages("pullRequest.review")</span>
-                @Html(Messages("notification.pullrequest.reviewed",linkToUser(user.loginId, user.name)))
+                @Html(Messages("notification.pullrequestHeader.reviewed",linkToUser(user.loginId, user.name)))
                 <span class="date">
                     <a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a>
                 </span>
@@ -63,7 +63,7 @@
             } else {
             <li class="event" id="comment-@event.id">
                 <span class="state changed">@Messages("pullRequest.unreview")</span>
-                @Html(Messages("notification.pullrequest.unreviewed", linkToUser(user.loginId, user.name)))
+                @Html(Messages("notification.pullrequestHeader.unreviewed", linkToUser(user.loginId, user.name)))
                 <span class="date">
                     <a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a>
                 </span>
app/views/git/partial_reviewlist.scala.html
--- app/views/git/partial_reviewlist.scala.html
+++ app/views/git/partial_reviewlist.scala.html
@@ -32,7 +32,7 @@
             @thread.getFirstReviewComment().getContents()
         </p>
         <p class="info">
-            @defining(thread.reviewComments.size()-1) { numberOfComments =>
+            @defining(thread.reviewComments.size-1) { numberOfComments =>
                 @if(numberOfComments > 0) {
                     <span class="comments pull-left">
                         <i class="yobicon-comments"></i> @numberOfComments
app/views/git/partial_state.scala.html
--- app/views/git/partial_state.scala.html
+++ app/views/git/partial_state.scala.html
@@ -28,7 +28,7 @@
 
 @getCodeURL(project: Project) = @{
     if(ProjectUser.isMember(project.id, UserApp.currentUser().id)){
-        CodeApp.getURL(project.owner, project.name).replace("://", "://" + session.get("loginId") + "@")
+        CodeApp.getURL(project.owner, project.name).replace("://", "://" + UserApp.currentUser.loginId + "@")
     } else {
         CodeApp.getURL(project.owner, project.name)
     }
app/views/git/viewChanges.scala.html
--- app/views/git/viewChanges.scala.html
+++ app/views/git/viewChanges.scala.html
@@ -47,7 +47,7 @@
                 </div>
             </div>
 
-            <div class="codediff-wrap mt10 @if(request.cookies.get("diffs-only") != null){diffs-only}">
+            <div class="codediff-wrap mt10 @if(requestHeader.cookies.get("diffs-only") != null){diffs-only}">
                 <button type="button" class="ybtn ybtn-default btn-show-reviewcards">
                     <i class="yobicon-restore"></i>
                 </button>
@@ -158,8 +158,8 @@
                         </button>
 
                         <ul class="nav nav-tabs" style="margin-bottom:10px;">
-                            <li class="active"><a href="#reviewcards-open" data-toggle="tab">@Messages("issue.state.open") @pull.getCommentThreadsByState(CommentThread.ThreadState.OPEN).size()</a></li>
-                            <li><a href="#reviewcards-closed" data-toggle="tab">@Messages("issue.state.closed") @pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED).size()</a></li>
+                            <li class="active"><a href="#reviewcards-open" data-toggle="tab">@Messages("issue.state.open") @pull.getCommentThreadsByState(CommentThread.ThreadState.OPEN).size</a></li>
+                            <li><a href="#reviewcards-closed" data-toggle="tab">@Messages("issue.state.closed") @pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED).size</a></li>
                         </ul>
 
                         <div class="tab-content review-list">
app/views/help/keymap.scala.html
--- app/views/help/keymap.scala.html
+++ app/views/help/keymap.scala.html
@@ -20,7 +20,7 @@
 **@
 @(section:String, project:Project)(implicit request: play.api.mvc.RequestHeader)
 
-@isMac = @{request.headers.get("User-Agent").getOrElse("").contains("Macintosh")}
+@isMac = @{requestHeader.headers.get("User-Agent").getOrElse("").contains("Macintosh")}
 @ctrl = @{if(isMac){"⌘"}else{"CTRL"}}
 
 <div class="pull-right" style="padding:10px 0;">
app/views/index/partial_notifications.scala.html
--- app/views/index/partial_notifications.scala.html
+++ app/views/index/partial_notifications.scala.html
@@ -51,7 +51,7 @@
 }
 
 @defining(NotificationEvent.findByReceiver(UserApp.currentUser, from, size)){ notifications =>
-    @if(notifications.size() == 0){
+    @if(notifications.size == 0){
     <div class="warning-none">
         <i class="yobicon-danger"></i> @Messages("notification.none")
     </div>
app/views/issue/create.scala.html
--- app/views/issue/create.scala.html
+++ app/views/issue/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, issueForm:Form[Issue], project:Project)
+@(title:String, issueForm: play.data.Form[Issue], project:Project)
 @import helper._
 @import scala.collection.mutable.Map
 @import models.enumeration.ResourceType
app/views/issue/edit.scala.html
--- app/views/issue/edit.scala.html
+++ app/views/issue/edit.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, issueForm:Form[Issue], issue:Issue,  project:Project)
+@(title:String, issueForm: play.data.Form[Issue], issue:Issue,  project:Project)
 @import helper._
 @import scala.collection.mutable.Map
 @import models.enumeration.ResourceType
app/views/issue/my_partial_list.scala.html
--- app/views/issue/my_partial_list.scala.html
+++ app/views/issue/my_partial_list.scala.html
@@ -70,13 +70,13 @@
                 </span>
                 }
 
-                @if(issue.comments.size()>0 || issue.voters.size()>0) {
+                @if(issue.comments.size>0 || issue.voters.size>0) {
                 <span class="infos-item item-count-groups">
-                    @if(issue.comments.size()>0){
-                        @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size() )
+                    @if(issue.comments.size>0){
+                        @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size )
                     }
-                    @if(issue.voters.size()>0){
-                        @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size(), "strong" )
+                    @if(issue.voters.size>0){
+                        @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size, "strong" )
                     }
                 </span>
                 }
app/views/issue/my_partial_list_quicksearch.scala.html
--- app/views/issue/my_partial_list_quicksearch.scala.html
+++ app/views/issue/my_partial_list_quicksearch.scala.html
@@ -25,7 +25,7 @@
     <li @if(param.assigneeId == UserApp.currentUser().id){ class="active"}>
         <a pjax-filter href="#"
             data-author-id=""
-            data-assignee-id="@User.findByLoginId(session.get("loginId")).id"
+            data-assignee-id="@UserApp.currentUser.id"
             data-milestone-id="@param.milestoneId"
             data-mention-id="">
             @Messages("issue.list.assignedToMe")
@@ -33,7 +33,7 @@
     </li>
     <li @if(param.authorId == UserApp.currentUser().id){ class="active"}>
         <a pjax-filter href="#"
-            data-author-id="@User.findByLoginId(session.get("loginId")).id"
+            data-author-id="@UserApp.currentUser.id"
             data-assignee-id=""
             data-milestone-id="@param.milestoneId"
             data-mention-id="">
@@ -45,7 +45,7 @@
             data-author-id=""
             data-assignee-id=""
             data-milestone-id="@param.milestoneId"
-            data-mention-id="@User.findByLoginId(session.get("loginId")).id">
+            data-mention-id="@UserApp.currentUser.id">
             @Messages("issue.list.mentionedOfMe")
         </a>
     </li>
app/views/issue/my_partial_search.scala.html
--- app/views/issue/my_partial_search.scala.html
+++ app/views/issue/my_partial_search.scala.html
@@ -78,7 +78,7 @@
         </ul>
         @if(!currentPage.getList.isEmpty){
             <div class="filter-wrap small-heights">
-                @if(currentPage.getList.size() > 1){
+                @if(currentPage.getList.size > 1){
 
                 <div class="filters pull-right">
                   @makeFilterLink("dueDate", param.orderBy, param.orderDir, Messages("common.order.dueDate"))
app/views/issue/partial_list.scala.html
--- app/views/issue/partial_list.scala.html
+++ app/views/issue/partial_list.scala.html
@@ -73,13 +73,13 @@
                     </span>
                     }
 
-                    @if(issue.comments.size()>0 || issue.voters.size()>0) {
+                    @if(issue.comments.size>0 || issue.voters.size>0) {
                     <span class="infos-item item-count-groups">
-                    @if(issue.comments.size()>0){
-                        @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size() )
+                    @if(issue.comments.size>0){
+                        @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size )
                     }
-                    @if(issue.voters.size()>0){
-                        @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size(), "strong" )
+                    @if(issue.voters.size>0){
+                        @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size, "strong" )
                     }
                     </span>
                     }
app/views/issue/partial_list_quicksearch.scala.html
--- app/views/issue/partial_list_quicksearch.scala.html
+++ app/views/issue/partial_list_quicksearch.scala.html
@@ -37,7 +37,7 @@
     @if(!UserApp.currentUser().isAnonymous){
     <li @if(param.assigneeId == UserApp.currentUser().id){ class="active"}>
         <a pjax-filter href="#"
-           data-assignee-id="@User.findByLoginId(session.get("loginId")).id"
+           data-assignee-id="@UserApp.currentUser.id"
            data-author-id=""
            data-milestone-id="@param.milestoneId">
             @Messages("issue.list.assignedToMe")
@@ -47,7 +47,7 @@
     <li @if(param.authorId == UserApp.currentUser().id){ class="active"}>
         <a pjax-filter href="#"
            data-assignee-id=""
-           data-author-id="@User.findByLoginId(session.get("loginId")).id"
+           data-author-id="@UserApp.currentUser.id"
            data-milestone-id="@param.milestoneId">
             @Messages("issue.list.authoredByMe")
             <span class="num-badge pull-right">@Issue.countIssuesBy(project.id, paramForIssuesAuthoredByMe)</span>
app/views/issue/partial_list_wrap.scala.html
--- app/views/issue/partial_list_wrap.scala.html
+++ app/views/issue/partial_list_wrap.scala.html
@@ -70,7 +70,7 @@
                     @partial_massupdate(project, param)
                 }
 
-                @if(currentPage.getList.size() > 1){
+                @if(currentPage.getList.size > 1){
                 <div class="filters pull-right">
                     @makeFilterLink("dueDate", param.orderBy, param.orderDir, Messages("common.order.dueDate"))
                     @makeFilterLink("updatedDate", param.orderBy, param.orderDir, Messages("common.order.updatedDate"))
@@ -83,7 +83,7 @@
             @partial_list(project, currentPage.getList, param, currentPage.getPageIndex, currentPage.getTotalPageCount)
 
             <div class="pull-left" style="padding:10px;">
-                <a href="@addQueryString(removeQueryString(request.uri, "pageNum"), "format=xls")" class="ybtn small">
+                <a href="@addQueryString(removeQueryString(requestHeader.uri, "pageNum"), "format=xls")" class="ybtn small">
                     <i class="yobicon-file-excel"></i> @Messages("issue.downloadAsExcel")
                 </a>
             </div>
app/views/issue/view.scala.html
--- app/views/issue/view.scala.html
+++ app/views/issue/view.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, issue:Issue, issueForm:Form[Issue], commentForm:Form[Comment],project:Project)
+@(title:String, issue:Issue, issueForm: play.data.Form[Issue], commentForm: play.data.Form[Comment],project:Project)
 @import org.apache.commons.lang.StringUtils
 @import helper._
 @import scala.collection.mutable.Map
@@ -39,7 +39,12 @@
 
 @isFirstState(state:State) = {@if(issue.state.state == Issue.availableStates.get(0).state()){dirty}}
 
-@urlToIssues = @{ urlToList(request.getHeader("Referer"), routes.IssueApp.issues(project.owner, project.name, "open").toString()) }
+@urlToIssues = @{
+  requestHeader.headers.get("Referer") match {
+    case Some(u) => urlToList(u, routes.IssueApp.issues(project.owner, project.name, "open").toString())
+    case _ => routes.IssueApp.issues(project.owner, project.name, "open").toString()
+  }
+}
 
 @urlToVote = @{
     if(issue.isVotedBy(UserApp.currentUser)){
@@ -113,7 +118,7 @@
                             }
 
                             <div id="vote" class="vote-wrap">
-                                @if(isResourceCreatable(User.findByLoginId(session.get("loginId")), issue.asResource(), ResourceType.ISSUE_COMMENT)) {
+                                @if(isResourceCreatable(UserApp.currentUser, issue.asResource(), ResourceType.ISSUE_COMMENT)) {
                                     <a href="@urlToVote" class="ybtn @if(issue.isVotedBy(UserApp.currentUser)){ybtn-watching}" title="@getVoteButtonTitle"
                                        data-request-method="post" data-toggle="tooltip">
                                         <span class="heart"><i class="yobicon-hearts"></i></span>
app/views/milestone/create.scala.html
--- app/views/milestone/create.scala.html
+++ app/views/milestone/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form: Form[Milestone], project: Project)
+@(title:String, form: play.data.Form[Milestone], project: Project)
 
 @import utils.TemplateHelper._
 @import models.enumeration._
app/views/milestone/edit.scala.html
--- app/views/milestone/edit.scala.html
+++ app/views/milestone/edit.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title: String, form: Form[Milestone], milestoneId: Long, project: Project)
+@(title: String, form: play.data.Form[Milestone], milestoneId: Long, project: Project)
 
 @import utils.TemplateHelper._
 @import models.enumeration._
app/views/organization/create.scala.html
--- app/views/organization/create.scala.html
+++ app/views/organization/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, form: Form[Organization])
+@(title:String, form: play.data.Form[Organization])
 
 @siteLayout("app.name", utils.MenuType.NONE) {
 <div class="page-wrap-outer">
@@ -32,7 +32,10 @@
                     <dt>
                         <div class="n-alert" data-errType="name">
                             <div class="orange-txt">
-                                @if(flash.get("warning") != null) { <span class="warning">@Messages(flash.get("warning"))</span> }
+                                @requestHeader.flash.get("warning") match {
+                                  case Some(msg) => { <span class="warning">@Messages(msg)</span> }
+                                  case None => { }
+                                }
                                 <span class="msg wrongName" style="display: none;"></span>
                             </div>
                         </div>
app/views/organization/partial_settingmenu.scala.html
--- app/views/organization/partial_settingmenu.scala.html
+++ app/views/organization/partial_settingmenu.scala.html
@@ -23,7 +23,7 @@
 @isActiveSubMenu(calls: Call*) = @{
     var menuState = ""
     for(call <- calls) {
-        if(call.toString().equals(request().path().toString())) {
+        if(call.toString().equals(requestHeader.path.toString())) {
             menuState = "active"
         }
     }
app/views/organization/setting.scala.html
--- app/views/organization/setting.scala.html
+++ app/views/organization/setting.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(organization:Organization, organizationForm: Form[Organization])
+@(organization:Organization, organizationForm: play.data.Form[Organization])
 
 @import utils.TemplateHelper._
 
app/views/organization/view.scala.html
--- app/views/organization/view.scala.html
+++ app/views/organization/view.scala.html
@@ -114,7 +114,7 @@
                                     }
                                 </ul>
                                 <p>
-                                    @Html(Messages("project.onmember", User.findUsersByProject(project.id).length))
+                                    @Html(Messages("project.onmember", User.findUsersByProject(project.id).size))
                                     <i class="yobicon-eye yobicon-middle"></i> @Html(Messages("project.onwatching", project.getWatchingCount))
                                 </p>
                             </div>
app/views/project/change_vcs.scala.html
--- app/views/project/change_vcs.scala.html
+++ app/views/project/change_vcs.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(message: String)(projectForm: Form[Project], project:Project)
+@(message: String)(projectForm: play.data.Form[Project], project:Project)
 
 @import helper._
 @import utils.TemplateHelper._
app/views/project/create.scala.html
--- app/views/project/create.scala.html
+++ app/views/project/create.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, newProjectForm:Form[Project], orgUserList:List[OrganizationUser])
+@(title:String, newProjectForm: play.data.Form[Project], orgUserList:List[OrganizationUser])
 
 @import utils.TemplateHelper._
 @import playRepository.RepositoryService
app/views/project/delete.scala.html
--- app/views/project/delete.scala.html
+++ app/views/project/delete.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(message: String)(projectForm: Form[Project], project:Project)
+@(message: String)(projectForm: play.data.Form[Project], project:Project)
 
 @import helper._
 @import utils.TemplateHelper._
app/views/project/importing.scala.html
--- app/views/project/importing.scala.html
+++ app/views/project/importing.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(title:String, newProjectForm:Form[Project], orgUserList:List[OrganizationUser])
+@(title:String, newProjectForm: play.data.Form[Project], orgUserList:List[OrganizationUser])
 
 @import utils.TemplateHelper._
 @import playRepository.RepositoryService
app/views/project/list.scala.html
--- app/views/project/list.scala.html
+++ app/views/project/list.scala.html
@@ -89,7 +89,7 @@
                         }
                         </ul>
                         <p>
-                            @Html(Messages("project.onmember", User.findUsersByProject(project.id).length))
+                            @Html(Messages("project.onmember", User.findUsersByProject(project.id).size))
                             <i class="yobicon-eye yobicon-middle"></i> @Html(Messages("project.onwatching", project.getWatchingCount))
                         </p>
                     </div>
app/views/project/partial_history.scala.html
--- app/views/project/partial_history.scala.html
+++ app/views/project/partial_history.scala.html
@@ -47,7 +47,7 @@
 <div class="content-container nm">
   <div class="main-stream" style="width:100%;">
     <ul class="activity-streams unstyled">
-      @for(history <- histories.iterator()) {
+      @for(history <- histories.iterator) {
       <li class="activity-stream">
         <a href="@userPageUrlOnHistory(history)" class="avatar-wrap pull-left mr10">
           <img src="@userAvatarUrlOnHistory(history)" width="32" height="32">
app/views/project/partial_settingmenu.scala.html
--- app/views/project/partial_settingmenu.scala.html
+++ app/views/project/partial_settingmenu.scala.html
@@ -27,7 +27,7 @@
 @isActiveSubMenu(calls: Call*) = @{
     var menuState = ""
     for(call <- calls) {
-        if(call.toString().equals(request().path())) {
+        if(call.toString().equals(requestHeader.path)) {
             menuState = "active"
         }
     }
app/views/project/setting.scala.html
--- app/views/project/setting.scala.html
+++ app/views/project/setting.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(message: String)(projectForm: Form[Project], project: Project, branches: List[String])
+@(message: String)(projectForm: play.data.Form[Project], project: Project, branches: List[String])
 
 @import helper._
 @import utils.TemplateHelper._
app/views/project/transfer.scala.html
--- app/views/project/transfer.scala.html
+++ app/views/project/transfer.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(message: String)(projectForm: Form[Project], project:Project)
+@(message: String)(projectForm: play.data.Form[Project], project:Project)
 
 @import helper._
 @import utils.TemplateHelper._
app/views/projectMenu.scala.html
--- app/views/projectMenu.scala.html
+++ app/views/projectMenu.scala.html
@@ -131,8 +131,9 @@
         @if(project.menuSetting.pullRequest && project.vcs.equals("GIT")){
            ,"F": "@getPullRequestURL(project)"
         }
-        @if(ProjectUser.roleOf(session.get("loginId"), project).equals("manager")){
-           ,"Q": "@routes.ProjectApp.settingForm(project.owner, project.name)"
+        @requestHeader.session.get("loginId") match {
+            case Some(role) if role.equals("manager") => { "Q": "@routes.ProjectApp.settingForm(project.owner, project.name)" }
+            case _ => { }
         }
     };
 
app/views/reviewthread/partial_list.scala.html
--- app/views/reviewthread/partial_list.scala.html
+++ app/views/reviewthread/partial_list.scala.html
@@ -24,7 +24,7 @@
 @import utils.TemplateHelper._
 @import utils.JodaDateUtil
 
-@if(page.getList().size() > 0){
+@if(page.getList().size > 0){
 <ul class="post-list-wrap">
     @for(thread <- page.getList())  {
         @defining(User.find.byId(thread.getFirstReviewComment.author.id)){ user =>
@@ -54,7 +54,7 @@
                 <span class="infos-item" title="@JodaDateUtil.getDateString(thread.createdDate)">
                     @agoOrDateString(thread.createdDate)
                 </span>
-                @defining(thread.reviewComments.size()-1) { numberOfComments =>
+                @defining(thread.reviewComments.size-1) { numberOfComments =>
 
                     @if(numberOfComments > 0) {
                     <span class="infos-item item-count-groups">
app/views/search/partial_issue_comments.scala.html
--- app/views/search/partial_issue_comments.scala.html
+++ app/views/search/partial_issue_comments.scala.html
@@ -25,7 +25,7 @@
 @import utils.JodaDateUtil
 
 @defining(searchResult.getIssueComments) { page =>
-    @if(page.getList.length > 0) {
+    @if(page.getList.size > 0) {
     <ul class="search-list-wrap">
         @for(comment <- page.getList) {
             @defining(User.findByLoginId(comment.authorLoginId)){ user =>
app/views/search/partial_issues.scala.html
--- app/views/search/partial_issues.scala.html
+++ app/views/search/partial_issues.scala.html
@@ -27,7 +27,7 @@
 @urlToList(project:Project, state:String) = {@routes.IssueApp.issues(project.owner, project.name, "open", "html", 1)}
 
 @defining(searchResult.getIssues) { page =>
-    @if(page.getList.length > 0) {
+    @if(page.getList.size > 0) {
     <ul class="search-list-wrap">
         @for(issue <- page.getList) {
             @defining(User.findByLoginId(issue.authorLoginId)){ user =>
app/views/search/partial_milestones.scala.html
--- app/views/search/partial_milestones.scala.html
+++ app/views/search/partial_milestones.scala.html
@@ -34,7 +34,7 @@
 }
 
 @defining(searchResult.getMilestones) { page =>
-    @if(page.getList.length > 0) {
+    @if(page.getList.size > 0) {
     <ul class="search-list-wrap">
         @for(milestone <- page.getList) {
         <li class="search-list-item">
app/views/search/partial_post_comments.scala.html
--- app/views/search/partial_post_comments.scala.html
+++ app/views/search/partial_post_comments.scala.html
@@ -25,7 +25,7 @@
 @import utils.JodaDateUtil
 
 @defining(searchResult.getPostComments) { page =>
-    @if(page.getList.length > 0) {
+    @if(page.getList.size > 0) {
     <ul class="search-list-wrap">
         @for(comment <- page.getList) {
             @defining(User.findByLoginId(comment.authorLoginId)){ user =>
app/views/search/partial_posts.scala.html
--- app/views/search/partial_posts.scala.html
+++ app/views/search/partial_posts.scala.html
@@ -25,7 +25,7 @@
 @import utils.JodaDateUtil
 
 @defining(searchResult.getPosts) { page =>
-    @if(page.getList.length > 0) {
+    @if(page.getList.size > 0) {
     <ul class="search-list-wrap">
         @for(post <- page.getList) {
             @defining(User.findByLoginId(post.authorLoginId)){ user =>
app/views/search/partial_projects.scala.html
--- app/views/search/partial_projects.scala.html
+++ app/views/search/partial_projects.scala.html
@@ -25,7 +25,7 @@
 @import utils.JodaDateUtil._
 
 @defining(searchResult.getProjects) { page =>
-    @if(page.getList.length > 0) {
+    @if(page.getList.size > 0) {
     <ul class="search-list-wrap">
         @for(project <- page.getList) {
             @defining(User.findByLoginId(project.owner)){ user =>
app/views/search/partial_reviews.scala.html
--- app/views/search/partial_reviews.scala.html
+++ app/views/search/partial_reviews.scala.html
@@ -26,7 +26,7 @@
 @import utils.TemplateHelper.DiffRenderer._
 
 @defining(searchResult.getReviews) { page =>
-    @if(page.getList.length > 0) {
+    @if(page.getList.size > 0) {
     <ul class="search-list-wrap">
         @for(review <- page.getList) {
             <li class="search-list-item">
app/views/search/partial_users.scala.html
--- app/views/search/partial_users.scala.html
+++ app/views/search/partial_users.scala.html
@@ -25,7 +25,7 @@
 @import utils.JodaDateUtil
 
 @defining(searchResult.getUsers) { page =>
-    @if(page.getList.length > 0) {
+    @if(page.getList.size > 0) {
     <ul class="search-list-wrap">
         @for(user <- page.getList) {
             <li class="search-list-item project">
app/views/site/mail.scala.html
--- app/views/site/mail.scala.html
+++ app/views/site/mail.scala.html
@@ -37,11 +37,11 @@
 </div>
 }
 
-@if(notConfiguredItems != null && notConfiguredItems.size() > 0) {
+@if(notConfiguredItems != null && notConfiguredItems.size > 0) {
 <div class="alert alert-error">
     <p>@Html(Messages("site.mail.notConfigured", "/admin/mailconf"))</p>
     <ul>
-    @for(item <- notConfiguredItems.iterator()) {
+    @for(item <- notConfiguredItems.iterator) {
         <li>@item</li>
     }
     </ul>
app/views/site/siteMngLayout.scala.html
--- app/views/site/siteMngLayout.scala.html
+++ app/views/site/siteMngLayout.scala.html
@@ -23,7 +23,7 @@
 @isActiveMenu(calls: Call*) = @{
     var menuState = ""
     for(call <- calls) {
-        if(call.toString().equals(request().path())) {
+        if(call.toString().equals(requestHeader.path)) {
             menuState = "active"
         }
     }
app/views/site/userList.scala.html
--- app/views/site/userList.scala.html
+++ app/views/site/userList.scala.html
@@ -179,7 +179,7 @@
     <script type="text/x-jquery-tmpl" id="dismissable-alerts-request">
         <div class="alert alert-fail">
             <button type="button" class="close" data-dismiss="alert">&times;</button>
-            <h4>sending request...</h4>
+            <h4>sending requestHeader...</h4>
         </div>
     </script>
 
app/views/user/edit.scala.html
--- app/views/user/edit.scala.html
+++ app/views/user/edit.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(userForm:Form[User], user:User)
+@(userForm: play.data.Form[User], user:User)
 
 @import helper._
 @import utils.TemplateHelper._
app/views/user/edit_emails.scala.html
--- app/views/user/edit_emails.scala.html
+++ app/views/user/edit_emails.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(userForm:Form[User], user:User)
+@(userForm: play.data.Form[User], user:User)
 
 @import helper._
 @import utils.TemplateHelper._
app/views/user/edit_notifications.scala.html
--- app/views/user/edit_notifications.scala.html
+++ app/views/user/edit_notifications.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(userForm:Form[User], user:User)
+@(userForm: play.data.Form[User], user:User)
 
 @import helper._
 @import utils.TemplateHelper._
app/views/user/edit_password.scala.html
--- app/views/user/edit_password.scala.html
+++ app/views/user/edit_password.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(userForm:Form[User], user:User)
+@(userForm: play.data.Form[User], user:User)
 
 @import helper._
 @import utils.TemplateHelper._
app/views/user/login.scala.html
--- app/views/user/login.scala.html
+++ app/views/user/login.scala.html
@@ -18,7 +18,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **@
-@(message:String, authInfoForm:Form[AuthInfo], redirectUrl:String)
+@(message:String, authInfoForm: play.data.Form[AuthInfo], redirectUrl:String)
 
 @siteLayout(message, utils.MenuType.NONE) {
 <div class="page full">
app/views/user/partial_issues.scala.html
--- app/views/user/partial_issues.scala.html
+++ app/views/user/partial_issues.scala.html
@@ -64,13 +64,13 @@
             </span>
             }
 
-            @if(issue.comments.size()>0 || issue.voters.size()>0) {
+            @if(issue.comments.size>0 || issue.voters.size>0) {
             <span class="infos-item item-count-groups">
-            @if(issue.comments.size()>0){
-                @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size() )
+            @if(issue.comments.size>0){
+                @countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size )
             }
-            @if(issue.voters.size()>0){
-                @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size(), "strong" )
+            @if(issue.voters.size>0){
+                @countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size, "strong" )
             }
             </span>
             }
app/views/user/partial_projectlist.scala.html
--- app/views/user/partial_projectlist.scala.html
+++ app/views/user/partial_projectlist.scala.html
@@ -68,9 +68,9 @@
         </div>
 
         <div class="stats">
-            @Html(Messages("project.onmember", User.findUsersByProject(project.id).length))<br/>
+            @Html(Messages("project.onmember", User.findUsersByProject(project.id).size))<br/>
 
-            @if(session.get("loginId") != project.owner ){
+            @if(UserApp.currentUser.loginId != project.owner ){
                 @if(User.isWatching(project)){