NutzCN Logo
问答 如何去掉lulichat里的登陆拦截
发布于 2345天前 作者 qq_ab1e7f22 1361 次浏览 复制 上一个帖子 下一个帖子
标签:

http://192.168.0.113:8080/upload/imgs/YI[LCK_`{~1}4C3P`~C%F_O.png
这个是我访问图片的路径,访问的时候会被拦截器拦截然后跳回登陆页面。
我尝试去掉拦截去访问图片,搞了大半天了但还是失败了,所以特意来请教各位。

下面是shiro.ini的配置------------------------------------------------------------

[main]
#Session
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager

# Session Cache
# sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
# sessionManager.sessionDAO = $sessionDAO

cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
cacheManager.cacheManagerConfigFile=classpath:ehcache.xml
securityManager.cacheManager = $cacheManager

# sessionIdGenerator=org.apache.shiro.session.mgt.eis.JavaUuidSessionIdGenerator
# sessionDAO.sessionIdGenerator=$sessionIdGenerator

# session listener
sessionListener=com.dd.listener.ShiroSessionListener
sessionManager.sessionListeners=$sessionListener

# cookie
sessionIdCookie=org.apache.shiro.web.servlet.SimpleCookie
sessionIdCookie.name=sid
sessionIdCookie.maxAge=43200000
sessionIdCookie.httpOnly=true
sessionManager.sessionIdCookie=$sessionIdCookie
sessionManager.sessionIdCookieEnabled=true
sessionManager.globalSessionTimeout=43200000
securityManager.sessionManager = $sessionManager

#user
user_realm =  com.dd.realm.SimpleAuthorizingRealm
user_realm.cacheManager = $cacheManager

#mis
#authc = com.dd.filter.AuthenticationFilter
authc.loginUrl  = /login.html
authc.successUrl = /user/chat
#authc.failureKeyAttribute=shiroLoginFailure

[urls]
/user/getUser = anon
/user/quit = anon
/user/loginImp = anon
/user/chat = anon
/user/chat1 = anon
/user/getOldMsgs = anon
/user/updteMesssageZt = anon
/user/seachUser = anon
/user/seach = anon
/user/getInitData = anon
/user/unreadMsgCount = anon
/user/getMsg = anon
/user/markRead = anon
/user/message = anon
/user/testDemo = anon
/upload/image = anon
/upload/imgs = anon
/upload/files = anon
/user/updteMesssageZt= anon
/user/getInitData= anon
/user/registry  = anon
/login.html     = anon
/user/login     = anon
/css/**         = anon
/js/**          = anon
/img/**         = anon
/user/logout    = logout
/** 	     	= authc

下面是web.xml配置-----------------------------------------------------------------------------------------------------
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >


Archetype Created Web Application

login.html


org.apache.shiro.web.env.EnvironmentLoaderListener


shiroEnvironmentClass
org.apache.shiro.web.env.IniWebEnvironment


shiroConfigLocations
classpath:shiro.ini


ShiroFilter
org.apache.shiro.web.servlet.ShiroFilter


ShiroFilter
/*

<filter>
<filter-name>DruidWebStatFilter</filter-name>
<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
<init-param>
  <param-name>exclusions</param-name>
  <param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*,/rs/*</param-value>
</init-param>



DruidWebStatFilter
/*


nutz
org.nutz.mvc.NutFilter

modules
com.dd.MainModule


nutz
/*
REQUEST
FORWARD



freemarker
freemarker.ext.servlet.FreemarkerServlet

TemplatePath
/


template_exception_handler
ignore


ContentType
text/html


template_update_delay
0


default_encoding
UTF-8


locale
zh_CN


number_format
0.##########


datetime_format
yyyy-MM-dd HH:mm:ss

2


freemarker
*.ftl


freemarker
*.html


com.dd.listener.SessionListener


1440000

2 回复
<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <display-name>Archetype Created Web Application</display-name>
  <welcome-file-list>
    <welcome-file>login.html</welcome-file>
  </welcome-file-list>
  <listener>
    <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
  </listener>
  <context-param>
    <param-name>shiroEnvironmentClass</param-name>
    <param-value>org.apache.shiro.web.env.IniWebEnvironment</param-value><!-- 默认先从/WEB-INF/shiro.ini,如果没有找classpath:shiro.ini -->
  </context-param>
  <context-param>
    <param-name>shiroConfigLocations</param-name>
    <param-value>classpath:shiro.ini</param-value>
  </context-param>

  <filter>
    <filter-name>ShiroFilter</filter-name>
    <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>ShiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <!--  <filter>
        <filter-name>cors</filter-name>
        <filter-class>com.dd.filter.SimpleCORSFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>cors</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>-->


    <filter>
    <filter-name>DruidWebStatFilter</filter-name>
    <filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
    <init-param>
      <param-name>exclusions</param-name>
      <param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*,/rs/*</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>DruidWebStatFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <filter>
    <filter-name>nutz</filter-name>
    <filter-class>org.nutz.mvc.NutFilter</filter-class>
    <init-param>
      <param-name>modules</param-name>
      <param-value>com.dd.MainModule</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>nutz</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
  </filter-mapping>



  <!-- freemarker -->
  <servlet>
    <servlet-name>freemarker</servlet-name>
    <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
    <init-param>
      <param-name>TemplatePath</param-name>
      <param-value>/</param-value>
    </init-param>
    <init-param>
      <param-name>template_exception_handler</param-name>
      <param-value>ignore</param-value>
    </init-param>
    <init-param>
      <param-name>ContentType</param-name>
      <param-value>text/html</param-value>
    </init-param>
    <init-param>
      <param-name>template_update_delay</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>default_encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
      <param-name>locale</param-name>
      <param-value>zh_CN </param-value>
    </init-param>
    <init-param>
      <param-name>number_format</param-name>
      <param-value>0.##########</param-value>
    </init-param>
    <init-param>
      <param-name>datetime_format</param-name>
      <param-value>yyyy-MM-dd HH:mm:ss</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>freemarker</servlet-name>
    <url-pattern>*.ftl</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>freemarker</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>
  <listener>
    <listener-class>com.dd.listener.SessionListener</listener-class>
  </listener>

  <session-config>
    <session-timeout>1440000</session-timeout>
  </session-config>
</web-app>

为啥图片文件名那么怪异的

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