undertow.devMode=true undertow.host=0.0.0.0 undertow.port=6666 undertow.contextPath=/mytool
启动后,在ie浏览器,360浏览器,edge浏览器都可以正常访问,
但
在谷歌浏览器版本 84.0.4147.105(正式版本) (64 位)访问
找不到 localhost 的网页
找不到与以下网址对应的网页:http://localhost:6666/mytool
HTTP ERROR 404
换了端口不行,用127.0.0.1,ip地址访问也不行
然后用springboot开发的tomcat运行的都可以访问
具体代码架构:
java
│ └─code
│ │ JFinalApplication.java
│ │
│ ├─config
│ │ JFinalApplicationConfig.java
│ │
│ ├─controller
│ │ HelloController.java
│ │ TableDealController.java
│ │
│ ├─handler
│ ├─model
│ │ │ _JFinalDemoGenerator.java
│ │ │ _MappingKit.java
│ │ │
│ │ └─base
│ └─service
│ TableDealService.java
│
├─resources
│ │ demo-config-dev.txt
│ │ log4j.properties
│ │ logging.properties
│ │ undertow.txt
│ │
│ └─webapp
│ │ tableList.html
│ │ tableList1.html
│ │ tablelist2.html
│ │
│ ├─common
│ │ 404.html
│ │ 500.html
│ │ _layout.html
│ │ _paginate.html
│ │
│ ├─css
│ ├─img
│ └─js
│ vue.min.js
code.config;
code.controller.HelloController;
code.controller.TableDealController;
code.model._MappingKit;
com.jfinal.config.*;
com.jfinal.ext.handler.ContextPathHandler;
com.jfinal.json.MixedJsonFactory;
com.jfinal.kit.Prop;
com.jfinal.kit.PropKit;
com.jfinal.plugin.activerecord.ActiveRecordPlugin;
com.jfinal.plugin.druid.DruidPlugin;
com.jfinal.render.ViewType;
com.jfinal.template.Engine;
JFinalApplicationConfig JFinalConfig {
Prop ;
loadConfig() {
(== ) {
= PropKit.(, );
}
}
configConstant(Constants me) {
();
me.setDevMode(.getBoolean(, ));
me.setInjectDependency();
me.setInjectSuperClass();
me.setToSlf4jLogFactory();
me.setJsonFactory(MixedJsonFactory());
me.setViewType(ViewType.);
me.setBaseDownloadPath();
me.setBaseUploadPath();
me.setError404View();
me.setError500View();
}
configRoute(Routes routes) {
routes.add(, HelloController.,);
routes.add(, TableDealController.);
}
configEngine(Engine engine) {
engine.setBaseTemplatePath();
engine.setToClassPathSourceFactory();
engine.addSharedFunction();
engine.addSharedFunction();
}
configPlugin(Plugins plugins) {
DruidPlugin druidPlugin = DruidPlugin(.get(), .get(), .get());
plugins.add(druidPlugin);
ActiveRecordPlugin arp = ActiveRecordPlugin(druidPlugin);
_MappingKit.(arp);
plugins.add(arp);
}
DruidPlugin createDruidPlugin() {
();
DruidPlugin(.get(), .get(), .get());
}
configInterceptor(Interceptors me) {
}
configHandler(Handlers me) {
me.add(ContextPathHandler());
}
}code.controller;
com.jfinal.core.Controller;
HelloController Controller {
index() {
renderText();
}
}code;
code.config.JFinalApplicationConfig;
com.jfinal.server.undertow.UndertowServer;
JFinalApplication {
main(String[] args) {
UndertowServer.(JFinalApplicationConfig., , );
}
}# config dbschema=zyplayer_doc_manage jdbcUrl = jdbc:mysql://localhost:3306/zyplayer_doc_manage?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull user = root password =123456 devMode = true
# undertow undertow.devMode=true undertow.host=0.0.0.0 undertow.port=6666 undertow.contextPath=/mytool # fatjar undertow.resourcePath=src/main/resource/webapp, classpath:webapp # gzip undertow.gzip.enable=true # -11 91 9 undertow.gzip.level=-1 # undertow.gzip.minLength=1024 # IO # undertow.ioThreads= # worker # cores / (1 - ) # cores cpu = / (+ CPU) # undertow.workerThreads= # # keytool -genkeypair -validity 3650 -alias club -keyalg RSA -keystore club.jks # keytool -importkeystore -srckeystore club.jks -destkeystore club.pfx -deststoretype PKCS12 # "" localhosttomcat # # https/ssl jfinal http://www.jfinal.com/doc/1-4 # # ssl #undertow.ssl.enable=false # ssl 443 #undertow.ssl.port=443 # PKCS12 #undertow.ssl.keyStoreType=PKCS12 # #undertow.ssl.keyStore=demo.pfx # #undertow.ssl.keyStorePassword=111111 # ssl http2chrome : chrome://net-internals/#http2 #undertow.http2.enable=true # ssl http https # undertow.http.toHttps=false # ssl http https 302 # undertow.http.toHttpsStatusCode=302 # ssl http # undertow.http.disable=false
因为,我每天都用 chrome 浏览器访问用 jfinal undertow 开发的项目很多很多次
从来没有碰到过这个事