NutzCN Logo
问答 http://localhost:90/index.html 不能否映射到 @At(“/index”)
发布于 1805天前 作者 JsckChin 1821 次浏览 复制 上一个帖子 下一个帖子
标签:

有什么方式可以支持一下吗

9 回复
@At({"/",“/index”})

welcome file的映射,反斜杠就行

	// 主页
	@At({ "/","/index"})
	@Ok("beetl:app/index.html")
	public void index(HttpServletRequest req){

	}

我是这样写的呀 不行

http://localhost:90/list.html

	// 详情
	@At("/list")
	@Ok("beetl:app/list.html")
	public void list(@Param("page")int page,HttpServletRequest req){
	}

客户要求全站可以访问.html后缀 例如这种 http://localhost:90/list.html

兽总大神 求教一下

访问index.html的时候,后台有日志不

访问index.html 有日志
访问list.html 没有日志

2019-05-15 12:14:50,499 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/xs : SysLoginModule.login(SysLoginModule.java:74)
2019-05-15 12:14:50,499 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'siteConfigService'<class com.yunqi.modules.service.site.SiteConfigService>
2019-05-15 12:14:50,505 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT * FROM site_config  WHERE id=?
    |      1 |
    |--------|
    | config |
  For example:> "SELECT * FROM site_config  WHERE id='config'"
2019-05-15 12:14:50,509 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'dateUtil'<class com.yunqi.common.util.DateUtil>
2019-05-15 12:14:50,509 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'sysLoginModule'<class com.yunqi.modules.controller.platform.sys.SysLoginModule>
2019-05-15 12:14:50,510 com.yunqi.common.processor.LogTimeProcessor.process(LogTimeProcessor.java:24) DEBUG - [ GET]URI=/xs 11ms

问题已经解决 关闭此话题
解决方案

<filter>
        <filter-name>nutz</filter-name>
        <filter-class>org.nutz.mvc.NutFilter</filter-class>
        <init-param>
            <param-name>modules</param-name>
            <param-value>com.mine.app.MainModule</param-value>
        </init-param>
        <init-param>
            <param-name>exclusions</param-name>
            <!-- *.XXX 忽略后缀 -->
            <!-- /XX/* 忽略前缀 -->
            <!-- /cc   忽略固定路径 -->
            <!-- 下面的例子忽略了html和ftl后缀, 忽略了/rs/和/druid/前缀,和忽略了固定路径/abc/notaction -->
            <param-value>*.html,*.ftl,/rs/*,/druid/*,/abc/notaction</param-value>
        </init-param>
    </filter>
添加回复
请先登陆
回到顶部