NutzCN Logo
问答 nutz集成Thymeleaf后,Thymeleaf怎么使用shiro标签
发布于 2584天前 作者 老司机 2032 次浏览 复制 上一个帖子 下一个帖子
标签:

RT nutz集成Thymeleaf后,Thymeleaf怎么使用shiro标签

24 回复

Thymeleaf有shiro标签的?

所以Thymeleaf本身并没有shiro标签咯

那你把插件加进去不就好了?

在shiro的configuration中配置
nutzboot 应该如何配置呢


@Bean public ShiroDialect shiroDialect() { return new ShiroDialect(); }

这跟shiro什么关系

Thymeleaf 不熟, 得问问温泉了

看了看, 配置上应该就可以了

thymeleaf.dialects.shiro=at.pollux.thymeleaf.shiro.dialect.ShiroDialect

自己修改nutzboot-demo-simple-mvc-shiro 启动失败了

[WARN ] 15:22:21.453 org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:554) - Failed startup of context o.e.j.w.WebAppContext@745c2004{/,[file:///Users/apple/IdeaProjects/nutzboot/nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-mvc-shiro/target/classes/static/],UNAVAILABLE}
org.nutz.mvc.LoadingException: java.lang.RuntimeException: Can not eval th:/home.html("th:/home.html") View for public org.nutz.lang.util.NutMap io.nutz.demo.simple.MainLauncher.index()
	at org.nutz.mvc.LoadingException$FC$ea86c19f63d257f4e49c243bba1db3c3.invoke(LoadingException.java)
	at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:1022)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:207)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:135)
	at org.nutz.boot.starter.nutz.mvc.NbMvcLoading.load(NbMvcLoading.java:28)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:136)
	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:750)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:744)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:369)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:852)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
	at org.eclipse.jetty.server.Server.start(Server.java:415)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:137)
	at org.nutz.boot.AppContext.startServers(AppContext.java:310)
	at org.nutz.boot.NbApp.execute(NbApp.java:210)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at io.nutz.demo.simple.MainLauncher.main(MainLauncher.java:64)
Caused by: java.lang.RuntimeException: Can not eval th:/home.html("th:/home.html") View for public org.nutz.lang.util.NutMap io.nutz.demo.simple.MainLauncher.index()
	at org.nutz.lang.Lang.makeThrow(Lang.java:139)
	at org.nutz.mvc.view.ViewZone.makeView(ViewZone.java:90)
	at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:89)
	at org.nutz.mvc.impl.processor.ViewProcessor.init(ViewProcessor.java:31)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:38)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:205)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	... 29 more
[INFO ] 15:22:21.489 org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:292) - Started ServerConnector@13ce0715{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO ] 15:22:21.490 org.eclipse.jetty.server.Server.doStart(Server.java:407) - Started @2544ms
[DEBUG] 15:22:21.490 org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:139) - Jetty monitor props:
----------------------------------------------
http.port                                : 8080
http.host                                : 0.0.0.0
http.idleTimeout                         : 300000
https.enable                             : false
welcome_files                            : index.html,index.htm,index.do
maxFormContentSize                       : 1073741824
----------------------------------------------
[DEBUG] 15:22:21.491 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) - Get 'mainLauncher'<class io.nutz.demo.simple.MainLauncher>
[ERROR] 15:22:21.491 org.nutz.boot.NbApp.execute(NbApp.java:224) - something happen!!
java.lang.RuntimeException: Context 'app' had been deposed!
	at org.nutz.lang.Lang.makeThrow(Lang.java:139)
	at org.nutz.ioc.impl.ScopeContext.checkBuffer(ScopeContext.java:39)
	at org.nutz.ioc.impl.ScopeContext.fetch(ScopeContext.java:55)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:161)
	at org.nutz.boot.NbApp.execute(NbApp.java:214)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at io.nutz.demo.simple.MainLauncher.main(MainLauncher.java:64)
[INFO ] 15:22:21.499 org.eclipse.jetty.server.AbstractConnector.doStop(AbstractConnector.java:341) - Stopped ServerConnector@13ce0715{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO ] 15:22:21.499 org.eclipse.jetty.server.session.HouseKeeper.stopScavenging(HouseKeeper.java:167) - node0 Stopped scavenging
[INFO ] 15:22:21.501 org.eclipse.jetty.server.handler.ContextHandler$Context.log(ContextHandler.java:2345) - Cleaning up Shiro Environment
[INFO ] 15:22:21.502 org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:1045) - Stopped o.e.j.w.WebAppContext@745c2004{/,[file:///Users/apple/IdeaProjects/nutzboot/nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-mvc-shiro/target/classes/static/],UNAVAILABLE}
[INFO ] 15:22:21.513 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:283) - You can't depose a Ioc twice!
Disconnected from the target VM, address: '127.0.0.1:55998', transport: 'socket'

为什么加载失败呢

[DEBUG] 15:40:30.958 org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:51) - Eval FAIL!! : public void io.nutz.demo.simple.module.HomeModule.index()
java.lang.RuntimeException: Can not eval th:/home.html("th:/home.html") View for public void io.nutz.demo.simple.module.HomeModule.index()
	at org.nutz.lang.Lang.makeThrow(Lang.java:139)
	at org.nutz.mvc.view.ViewZone.makeView(ViewZone.java:90)
	at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:89)
	at org.nutz.mvc.impl.processor.ViewProcessor.init(ViewProcessor.java:31)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:38)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:205)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	at org.nutz.boot.starter.nutz.mvc.NbMvcLoading.load(NbMvcLoading.java:28)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:136)
	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:750)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:744)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:369)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:852)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
	at org.eclipse.jetty.server.Server.start(Server.java:415)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:137)
	at org.nutz.boot.AppContext.startServers(AppContext.java:310)
	at org.nutz.boot.NbApp.execute(NbApp.java:210)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at io.nutz.demo.simple.MainLauncher.main(MainLauncher.java:56)
[ERROR] 15:40:30.961 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:125) - Error happend during start serivce!
java.lang.RuntimeException: Can not eval th:/home.html("th:/home.html") View for public void io.nutz.demo.simple.module.HomeModule.index()
	at org.nutz.lang.Lang.makeThrow(Lang.java:139)
	at org.nutz.mvc.view.ViewZone.makeView(ViewZone.java:90)
	at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:89)
	at org.nutz.mvc.impl.processor.ViewProcessor.init(ViewProcessor.java:31)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:38)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:205)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	at org.nutz.boot.starter.nutz.mvc.NbMvcLoading.load(NbMvcLoading.java:28)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:136)
	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:750)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:744)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:369)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:852)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
	at org.eclipse.jetty.server.Server.start(Server.java:415)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:137)
	at org.nutz.boot.AppContext.startServers(AppContext.java:310)
	at org.nutz.boot.NbApp.execute(NbApp.java:210)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at io.nutz.demo.simple.MainLauncher.main(MainLauncher.java:56)
[ERROR] 15:40:30.961 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:127) - try to depose ioc
[INFO ] 15:40:30.964 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:287) - org.nutz.ioc.impl.NutIoc@1659363322 is closing. startup date [19-04-17 15:40:29.131]
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'nutFilter' ...
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroFilter' ...
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'whaleFilter' ...
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroRememberMeManager' ...
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'sqlManager' ...
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'dao' ...
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroRealm' ...
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroCacheManager' ...
[DEBUG] 15:40:30.965 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroWebSessionManager' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroWebSecurityManager' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroEnvironmentLoaderListener' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'nbServletContextListener' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'jettyStarter' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroEnvStarter' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'shiroFilterStarter' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'druidWebStatServletStarter' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'druidWebStatFilterStarter' ...
[DEBUG] 15:40:30.966 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'dataSourceStarter' ...
[DEBUG] 15:40:30.967 org.nutz.boot.starter.jdbc.DataSourceStarter.depose(DataSourceStarter.java:248) - shutdown slave datasource count=0
[DEBUG] 15:40:30.967 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'nutDaoStarter' ...
[DEBUG] 15:40:30.967 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'whaleFilterStarter' ...
[DEBUG] 15:40:30.967 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'nutFilterStarter' ...
[DEBUG] 15:40:30.967 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object '$aop_async' ...
[DEBUG] 15:40:30.968 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'counterService' ...
[DEBUG] 15:40:30.968 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'nbApp' ...
[DEBUG] 15:40:30.968 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'conf' ...
[DEBUG] 15:40:30.968 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:109) - Depose object 'appContext' ...
[DEBUG] 15:40:30.968 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:114) - Depose object 'druidDataSource' ...
[INFO ] 15:40:31.089 com.alibaba.druid.pool.DruidDataSource.close(DruidDataSource.java:1928) - {dataSource-1} closed
[DEBUG] 15:40:31.089 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:114) - Depose object 'dataSource' ...
[INFO ] 15:40:31.089 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:301) - org.nutz.ioc.impl.NutIoc@1659363322 is deposed. startup date [19-04-17 15:40:29.131]
[WARN ] 15:40:31.107 org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:554) - Failed startup of context o.e.j.w.WebAppContext@6d9fb2d1{/,[file:///Users/apple/IdeaProjects/nutzboot/nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-mvc-shiro/target/classes/static/],UNAVAILABLE}
org.nutz.mvc.LoadingException: java.lang.RuntimeException: Can not eval th:/home.html("th:/home.html") View for public void io.nutz.demo.simple.module.HomeModule.index()
	at org.nutz.mvc.LoadingException$FC$ea86c19f63d257f4e49c243bba1db3c3.invoke(LoadingException.java)
	at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:1022)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:207)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:135)
	at org.nutz.boot.starter.nutz.mvc.NbMvcLoading.load(NbMvcLoading.java:28)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:136)
	at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:750)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:744)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:369)
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:852)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
	at org.eclipse.jetty.server.Server.start(Server.java:415)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:382)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:137)
	at org.nutz.boot.AppContext.startServers(AppContext.java:310)
	at org.nutz.boot.NbApp.execute(NbApp.java:210)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at io.nutz.demo.simple.MainLauncher.main(MainLauncher.java:56)
Caused by: java.lang.RuntimeException: Can not eval th:/home.html("th:/home.html") View for public void io.nutz.demo.simple.module.HomeModule.index()
	at org.nutz.lang.Lang.makeThrow(Lang.java:139)
	at org.nutz.mvc.view.ViewZone.makeView(ViewZone.java:90)
	at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:89)
	at org.nutz.mvc.impl.processor.ViewProcessor.init(ViewProcessor.java:31)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:38)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:205)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	... 29 more
[INFO ] 15:40:31.150 org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:292) - Started ServerConnector@303013d6{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO ] 15:40:31.152 org.eclipse.jetty.server.Server.doStart(Server.java:407) - Started @3135ms
[DEBUG] 15:40:31.152 org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:139) - Jetty monitor props:
----------------------------------------------
http.port                                : 8080
http.host                                : 0.0.0.0
http.idleTimeout                         : 300000
https.enable                             : false
welcome_files                            : index.html,index.htm,index.do
maxFormContentSize                       : 1073741824
----------------------------------------------
[DEBUG] 15:40:31.154 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) - Get 'mainLauncher'<class io.nutz.demo.simple.MainLauncher>
[ERROR] 15:40:31.154 org.nutz.boot.NbApp.execute(NbApp.java:224) - something happen!!
java.lang.RuntimeException: Context 'app' had been deposed!
	at org.nutz.lang.Lang.makeThrow(Lang.java:139)
	at org.nutz.ioc.impl.ScopeContext.checkBuffer(ScopeContext.java:39)
	at org.nutz.ioc.impl.ScopeContext.fetch(ScopeContext.java:55)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:161)
	at org.nutz.boot.NbApp.execute(NbApp.java:214)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at io.nutz.demo.simple.MainLauncher.main(MainLauncher.java:56)
[INFO ] 15:40:31.164 org.eclipse.jetty.server.AbstractConnector.doStop(AbstractConnector.java:341) - Stopped ServerConnector@303013d6{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO ] 15:40:31.165 org.eclipse.jetty.server.session.HouseKeeper.stopScavenging(HouseKeeper.java:167) - node0 Stopped scavenging
[INFO ] 15:40:31.167 org.eclipse.jetty.server.handler.ContextHandler$Context.log(ContextHandler.java:2345) - Cleaning up Shiro Environment
[INFO ] 15:40:31.167 org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:1045) - Stopped o.e.j.w.WebAppContext@6d9fb2d1{/,[file:///Users/apple/IdeaProjects/nutzboot/nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-mvc-shiro/target/classes/static/],UNAVAILABLE}
[INFO ] 15:40:31.179 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:283) - You can't depose a Ioc twice!
Disconnected from the target VM, address: '127.0.0.1:60489', transport: 'socket'

Process finished with exit code 0
package io.nutz.demo.simple.module;

import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;

/**
 * @Author: Haimming https://github.com/HaimmingYu
 * @Date: 2019-04-17 15:27
 * @Version 1.0
 */

@At("/home")
@IocBean
public class HomeModule {
    
    @At({"/", "/home"})
    @Ok("th:/home.html")
    public void index() {
//        return NutMap.NEW().setv("name", "NB").setv("age", 18);
    }

}

依赖没加?

目测starter-thymeleaf也没加

shiro 只有 auth.addStringPermission("user:list");这个权限 但是 标签依然显示


<a shiro:hasPermission="user:create" href="createUser.html">Create a new User</a>

成功启动 运行 访问 没有问题 但是 标签不隐藏

那shiro属性消失了吗? 如果没有,那还是没配置成功

感觉ThymeleafView实现得不对...

感谢兽总 能生成一个 快照版本吗

快照版自动生成的

那如何获取最新的

添加回复
请先登陆
回到顶部