栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SMM博客系统(初始化xml配置)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SMM博客系统(初始化xml配置)

配置web.xml(注意web-app的内容也要更改否则报错)
  
  

  Blog
  
  
  	a.jsp
  
  
  
  
  	shiroFilter
  	org.springframework.web.filter.DelegatingFilterProxy
  	
  	
  		targetFilterLifecycle
  		true
  	
  
  
  
  	shiroFilter
  	/*
  
  
  
  
  	contextConfigLocation
  	classpath:applicationContext.xml
  
  
  
  
  	encodingFilter
  	org.springframework.web.filter.CharacterEncodingFilter
  	true
  	
		encoding
		UTF-8
	
  
  
  	encodingFilter
  	/*
  
  
  
  
  	org.springframework.web.context.ContextLoaderListener
  
  
  	com.blog.service.impl.InitComponent
  
  
  
  
  	springMVC
  	org.springframework.web.servlet.DispatcherServlet
  	
  		contextConfigLocation
  		classpath:spring-mvc.xml
  	
  	1
  	true
  
  
  
  	springMVC
  	*.do
  
  
  
  	springMVC
  	*.html
  
  


在resource下创建application.xml

配置applicationContext.xml



	
	
		
		
		
	

	
	
		
		
		
		
		
	
	
	
	
		
		
	
	
	
	
		
	
	
	
	
	
	
	
		
	
	
	
	
		
		
		
		
		
			
				/login=anon
				/admin/**=authc
			
		
	
	
	
	
	
	
	
	
	
		
	
	
	
	
		
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
					
		
	
	
	
	
		
			
	
	
	
		

在resource下创建mybatis-config.xml






	


配置application.xml-shiro

在com.blog.realm包新建一个类MyRealm(用来实现登录权限的验证)

public class MyRealm extends AuthorizingRealm {
	@Override
	protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
		// TODO Auto-generated method stub
		return null;
	}
}
配置spring-mvc.xml











	
	



	
	




启动 然后报错?

爆红:java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener

大概意思就是找不到这个类ContextLoaderListener 你的lib里面没有这spring相关的包

]项目右键Properties > Deployment Assembly ,然后在右边的界面里 Add > Java Build Path Entries > Maven Dependencies > Finish > Apply 然后解决问题

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/785351.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号