lets-blade/blade

Template path not recognized

AppyCat opened this issue · 0 comments

I have got an app working with Blade. However the templates path is not being recognized.

When the app is built, the structure is as follows:

build/classes/java/main/example/Application.class

The templates are in

build/resources/main/templates

I've tried the app.properties option but still can't get this to work.

The only way it does work is if I manually copy the templates folder to:

build/classes/java/main/templates

My Application.java file code is as follows:

package example;
import com.blade.Blade;
import com.blade.security.web.csrf.CsrfMiddleware;
import com.blade.exception.TemplateException;
import com.blade.mvc.WebContext;
import com.blade.mvc.http.Request;
import com.blade.mvc.http.Session;
import com.blade.mvc.ui.ModelAndView;
import com.blade.mvc.ui.template.TemplateEngine;

import example.controller.IndexController;

public class Application {
public static void main(String[] args) {
Blade.of().get("/", ctx -> {
ctx.attribute("name", "biezhi");
ctx.render("index.html");
}).start(IndexController.class, args);
}
}

What do I need to do to correct this, I appreciate any suggestions.

Thank you.