菜鸟95270
去maven窗口clean一下,是因为你直接复制的,没自己写
乖乖丶女
F12看有无报错,看请求能不能进Controller
qq_李金虎_0
这个属性不要是关键字
大张张001
那是自定义模板 您可以百度搜一下 idea 自定义文件模版??
慕码人628507
https://github.com/zchengi/shiro-learn
花开彼岸天o

给 user/login 放行呀
我是远方
因为web.xml中的前端控制器如果设路径为"/",那么也会把静态资源也拦截掉,利用<mvc:resources mapping="/static/**" location="/static/" />可以排除对静态资源的拦截。
哆丶哆
在web.xml中添加
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
试试
weixin_慕数据5184775
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0"> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:spring/spring.xml</param-value> </context-param> <!--Spring监听器--> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <filter> <filter-name>shiroFilter</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>shiroFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <servlet> <servlet-name>SpringMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:spring/springmvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>SpringMVC</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app>
web.xml
另外,在pom.xml中spring依赖的版本最好换成4.3以上
weixin_慕数据5184775
创建Bean失败,Tomcat启动失败
慕先生7680133
idea部署有问题,删除tomcat,重新部署,别忘记配置
慕先生7680133
老师这个地方写错了 注意注意!!!
慕先生7680133
守到黎明
qq_慕UI4493750
kkdj1476238393
糖糖love慧
提供web相关的filter
jsp标签增强
HttpSession增强
慕粉9046625
已经解决了,springmvc.xml文件少了一些约束文件
慕标3551484
同问题,请问您解决了吗?
冷光1203
没有的看到
qq_我不叫土狗子t_0
这个是手动创建的,步骤如下
1、file—setting,左上角输入template
2、在左侧栏找到File And Code Templates
3、中间选中Files
4、点击+号,增添新的模板
5、输入模板名字:Name:web.xml(或者spring.xml) (name可以自定义)
6、后缀名extension:xml
7、在面板中间输入内容:(具体根据所需的xml进行自定义)
8、把enable live Template(激活模板)勾选上
9、点击Apply—ok
10、接下来就可以创建了
weixin_慕斯5345482

DefaultSecurityManager
DefaultWebSecurityManager
qq_土豆_60
这是因为即使没有在对应的Controller类中添加对GET请求的处理方法。但是在进入首页加载表单的时候,默认就是个get请求,而恰好这个请求被笔者的设置拦截了,所以当请求被拦截后又找不到对应的处理方法,报出了这个错误。
修改方法:
1.在对应的Controller类中修改成method=requestMethod.POST修改为GET请求的处理方法。
2.把上面的“method = RequestMethod.POST”去掉,就可以同时处理GET和POST请求。
音殿
莫槑
已经引入了
莫槑
https://blog.csdn.net/yanghanxiu/article/details/79366263 已解决
qq_MEGALOVANIA_0
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <filter> <filter-name>shiroFilter</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>shiroFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/spring.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>DispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/springmvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> </servlet> <servlet-mapping> <servlet-name>DispatcherServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <!-- 注册spring提供的针对POST请求的中文乱码问题 --> <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
独尊123
spring.xml中的这个用错了吧
<property name=""> <value> login.html = anon /subLogin = anon /* = authc </value> </property>
spring.xml中 这个filterChainDefinitions用错了吧
枝丫儿风吹吹
愿岁月厚待我至爱之人
s确少lf4j依赖包,加进去就行了