If use Play2, and sample application of japid42, you will see that it holds japid's view under the following default structure:
{your_app}/japidroot/japidview
How to change it to: {your_app}/app/views ? (to standard/classic play's structure)
If use Play2, and sample application of japid42, you will see that it holds japid's view under the following default structure:
{your_app}/japidroot/japidview
How to change it to: {your_app}/app/views ? (to standard/classic play's structure)
On
import play.Play;
import play.mvc.Http.RequestHeader;
import play.mvc.Result;
import play.mvc.Results;
import cn.bran.japid.template.JapidRenderer;
import cn.bran.play.JapidController;
public class Global extends JapidRenderer {
@Override
public void onStartJapid() {
setTemplateRoot("japidroot");
setLogVerbose(true);
setKeepJavaFiles(false); // keep the Java code derived from Japid scripts in memory only
}
@Override
public Result onError(RequestHeader h, Throwable t) {
if (Play.application().isProd())
return Results.internalServerError(JapidController.renderJapidWith("onError.html", h, t));
else
return super.onError(h, t);
}
@Override
public Result onBadRequest(RequestHeader r, String s) {
if (Play.application().isProd())
return Results.badRequest(JapidController.renderJapidWith("onBadRequest.html", r, s));
else
return super.onBadRequest(r, s);
}
@Override
public Result onHandlerNotFound(RequestHeader r) {
// usually one needs to use a customized error reporting in production.
//
if (Play.application().isProd() || Play.application().isDev())
return Results.notFound(JapidController.renderJapidWith("onHandlerNotFound.html", r));
else
return super.onHandlerNotFound(r);
}
}
Ok. I've figured this out.
This configuration says japid that "app" folder is root where japid scripts located, then it tries to find/look-up for 'japidviews' folder.
So, what I need to do:
It is OK to me to have "japidviews" but but "views". At least it is in "app" directory but not outside.