2018-07-16 12:46

JFinal.start("src/main/webapp", 8091, "/index");加个参数index

2018-07-16 09:43

开启beetl模板就出来了${ctxPath}

2018-07-15 20:48

http://localhost:8091/index/-------------#{ctxPath} 没有值显示

2018-07-15 20:47

在启动项加入了/index 调试观察窗口可以出现JFinal.me().getContextPaht()="/index" ,但前台页面依旧取不值

2018-07-15 17:23

@JFinal 调试时jfinal.me().getcontextpath=""

2018-07-15 17:16

@EATI001 按你提供方法控制台可以输出,但index.html无法解析

2018-07-15 11:21

控制台E:\installsoft\java\jre8\jdk8\bin\java -javaagent:E:\installsoft\ideaIU-2017.2.win\lib\idea_rt.jar=53326:E:\installsoft\ideaIU-2017.2.win\bin -Dfile.encoding=UTF-8 -classpath E:\installsoft\java\jre8\jdk8\jre\lib\charsets.jar;E:\installsoft\java\jre8\jdk8\jre\lib\deploy.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\access-bridge-64.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\cldrdata.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\dnsns.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\jaccess.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\jfxrt.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\localedata.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\nashorn.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\sunec.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\sunjce_provider.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\sunmscapi.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\sunpkcs11.jar;E:\installsoft\java\jre8\jdk8\jre\lib\ext\zipfs.jar;E:\installsoft\java\jre8\jdk8\jre\lib\javaws.jar;E:\installsoft\java\jre8\jdk8\jre\lib\jce.jar;E:\installsoft\java\jre8\jdk8\jre\lib\jfr.jar;E:\installsoft\java\jre8\jdk8\jre\lib\jfxswt.jar;E:\installsoft\java\jre8\jdk8\jre\lib\jsse.jar;E:\installsoft\java\jre8\jdk8\jre\lib\management-agent.jar;E:\installsoft\java\jre8\jdk8\jre\lib\plugin.jar;E:\installsoft\java\jre8\jdk8\jre\lib\resources.jar;E:\installsoft\java\jre8\jdk8\jre\lib\rt.jar;E:\installsoft\java\jre8\jdk8\jre\lib\javax.persistence.jar;E:\installsoft\ideaIU-2017.2.win\workspace\jfinal\jfinal-3.4_demo_for_maven\jfinal_demo_for_maven\target\classes;C:\Users\Administrator\.m2\repository\com\jfinal\jetty-server\8.1.8\jetty-server-8.1.8.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\jetty-xml\8.1.8.v20121106\jetty-xml-8.1.8.v20121106.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\jetty-util\8.1.8.v20121106\jetty-util-8.1.8.v20121106.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\jetty-servlet\8.1.8.v20121106\jetty-servlet-8.1.8.v20121106.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\jetty-security\8.1.8.v20121106\jetty-security-8.1.8.v20121106.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\jetty-server\8.1.8.v20121106\jetty-server-8.1.8.v20121106.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\orbit\javax.servlet\3.0.0.v201112011016\javax.servlet-3.0.0.v201112011016.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\jetty-continuation\8.1.8.v20121106\jetty-continuation-8.1.8.v20121106.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\jetty-http\8.1.8.v20121106\jetty-http-8.1.8.v20121106.jar;C:\Users\Administrator\.m2\repository\org\eclipse\jetty\jetty-io\8.1.8.v20121106\jetty-io-8.1.8.v20121106.jar;C:\Users\Administrator\.m2\repository\com\jfinal\jfinal\3.4\jfinal-3.4.jar;C:\Users\Administrator\.m2\repository\cglib\cglib-nodep\3.2.5\cglib-nodep-3.2.5.jar;C:\Users\Administrator\.m2\repository\log4j\log4j\1.2.16\log4j-1.2.16.jar;C:\Users\Administrator\.m2\repository\mysql\mysql-connector-java\5.1.44\mysql-connector-java-5.1.44.jar;C:\Users\Administrator\.m2\repository\com\alibaba\druid\1.0.29\druid-1.0.29.jar;E:\installsoft\java\jre8\jdk8\lib\jconsole.jar;E:\installsoft\java\jre8\jdk8\lib\tools.jar;C:\Users\Administrator\.m2\repository\com\jfinal\cos\2017.5\cos-2017.5.jar;C:\Users\Administrator\.m2\repository\com\ibeetl\beetl\2.7.15\beetl-2.7.15.jar;C:\Users\Administrator\.m2\repository\org\antlr\antlr4-runtime\4.2\antlr4-runtime-4.2.jar;C:\Users\Administrator\.m2\repository\org\abego\treelayout\org.abego.treelayout.core\1.0.1\org.abego.treelayout.core-1.0.1.jar;C:\Users\Administrator\.m2\repository\org\antlr\antlr4-annotations\4.2\antlr4-annotations-4.2.jar;C:\Users\Administrator\.m2\repository\com\jfinal\enjoy\3.4\enjoy-3.4.jar com.demo.common.DemoConfig
Starting JFinal 3.4
Starting web server on port: 8091
ctxPathTemplate Engine: JFinal Web
Starting Complete. Welcome To The JFinal World :)

JFinal-3.4 action report -------- 2018-07-15 11:09:09 --------------------------
Url : GET /
Controller : com.demo.index.IndexController.(IndexController.java:1)
Method : index
--------------------------------------------------------------------------------

JFinal-3.4 action report -------- 2018-07-15 11:09:11 --------------------------
Url : GET /
Controller : com.demo.index.IndexController.(IndexController.java:1)
Method : index
--------------------------------------------------------------------------------

2018-07-15 11:19

lwcompany 07-15 11:18
把target删除后重新编译,index.html中#(CONTEXT_PATH)
#(ctxPath)

----------------都没有显示

2018-07-15 09:27

public void configEngine(Engine me) {
me.addSharedFunction("/common/_layout.html");
me.addSharedFunction("/common/_paginate.html");
me.setDevMode(true);
me.addSharedObject("ctxPath", JFinal.me().getContextPath());
}
/**
* 配置处理器
*/
public void configHandler(Handlers me) {
me.add(new ContextPathHandler("ctxPath"));

}
前台
#@layout()
#define main()

JFinal Demo 项目首页



欢迎来到 JFinal极速开发世界!








本Demo采用 JFinal Template 作为视图文件。
点击此处开始试用Demo。

#(CONTEXT_PATH)
#(ctxPath)
还是没有结果

2018-07-14 17:17

嗯嗯,放在新的虚拟机就行,谢谢

2018-07-14 10:53

jfinal3.4+myaniu 能运行了

2018-07-12 20:59

BaseBlog.java 文件
public abstract class BaseBlogTest> extends Model implements IBean {

public M setId(Integer id) {
set("id", id);
return (M)this;
}

public Integer getId() {
return getInt("id");
}

public M setTitle(String title) {
set("title", title);
return (M)this;
}

public String getTitle() {
return getStr("title");
}

public M setContent(String content) {
set("content", content);
return (M)this;
}

public String getContent() {
return getStr("content");
}