sitemesh / sitemesh3

SiteMesh 3: Official repository
https://sitemesh.github.io/sitemesh-website/
Apache License 2.0
480 stars 168 forks source link

sitemesh3 配置多个装饰器时闪烁的问题(对不住各位,小弟英文不好⊙﹏⊙b汗) #105

Closed cliffs1314 closed 1 year ago

cliffs1314 commented 8 years ago

问题描述:我配置了两个装饰器,一个默认的,一个针对登录页的,当我请求登录的时候,会先显示默认的装饰器,然后在显示针对登录页面的装饰器,有一个闪烁的过程,是我配置的不对吗?配置多个装饰器时能否指定优先级?希望知道的朋友给解释下,谢谢!

wangjunling commented 7 years ago

我也遇到一个这种问题, 原因是:在web.xml配置了欢迎页面index.jsp index.jsp如下:

<%@ page contentType="text/html;charset=UTF-8" language="java" %> <script type="text/javascript"> location.href='/dun/index'; </script> 直接跳转,但是我在装饰器配置中没有过滤掉index.jsp。它会使用默认的装饰器。所以会闪一下,不知道你是不是类似这种情况。

cliffs1314 commented 7 years ago

您好,感谢您的回答.我的index.jsp和您配置的一样,直接跳转的,但是我的web.xml里面没有配置欢迎页面index.jsp,还是会闪烁

index.jsp如下:

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

web.xml如下:

<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">

Archetype Created Web Application contextConfigLocation classpath:spring/spring.xml propertiesConfigLocation classpath:*.properties org.springframework.web.context.ContextLoaderListener springDispatcherServlet org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:spring/spring-servlet.xml 1 springDispatcherServlet / encodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 encodingFilter /* sitemesh org.sitemesh.config.ConfigurableSiteMeshFilter sitemesh /* TokenFilter com.trustdata.multitenant.filter.TokenFilter TokenFilter /iam/ws/*

在 2017-03-23 15:00:21,"wangjunling" notifications@github.com 写道:

我也遇到一个这种问题, 原因是:在web.xml配置了欢迎页面index.jsp index.jsp如下:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

直接跳转,但是我在装饰器配置中没有过滤掉index.jsp。它会使用默认的装饰器。所以会闪一下,不知道你是不是类似这种情况。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

wangjunling commented 7 years ago

web.xml中的欢迎页不写的话,默认是去访问webapp根目录下的index.jsp或者index.html,所以你的index.jsp是不是在webapp根目录下?

cliffs1314 commented 7 years ago

恩恩,是的,那您的意思是需要在web.xml里面配置欢迎页么?

在 2017-04-12 14:44:12,"wangjunling" notifications@github.com 写道:

web.xml中的欢迎页不写的话,默认是去访问webapp根目录下的index.jsp或者index.html,所以你的index.jsp是不是在webapp根目录下?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

wangjunling commented 7 years ago

所以你现在会闪烁是因为sitemash拦截了index.jsp。你只需要在sitemash配置中配置排除index.jsp就好了 像这样: <mapping path="/index.jsp" exclue="true"/>

cliffs1314 commented 7 years ago

好的,问题解决了,感谢感谢!我记得之前这样试过,不行,完了才去问的.可能是我配置有问题,现在可以了,在此感谢! 对了,你们还要人吗?

在 2017-04-12 14:55:20,"wangjunling" notifications@github.com 写道:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

wangjunling commented 7 years ago

要人啊

cliffs1314 commented 7 years ago

那我可以吗?能带我来一盘吗?

在 2017-04-15 16:10:21,"wangjunling" notifications@github.com 写道:

要人啊

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

zhou-fei commented 7 years ago

再用下

codeconsole commented 1 year ago

Please re-open if this is still and issue.