jeesite中的配置

<context:property-placeholder ignore-unresolvable="true" location="classpath:jeesite.properties" /> 

这里location值为参数配置文件的位置,参数配置文件通常放在src目录下,而参数配置文件的格式跟java通用的参数配置文件相同,即键值对的形式

 

<context:component-scan base-package="com.thinkgem.jeesite" use-default-filters="false">

注解类位于包 com.thinkgem.jeesite 下

 

 

<!-- 定义视图文件解析 /WEB-INF/views/*.jsp -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="${web.view.prefix}"/>
<property name="suffix" value="${web.view.suffix}"/>
</bean>

 

 web.view.prefix 与 web.view.suffix 定义在  jeesite.properties 文件中:

web.view.prefix=/WEB-INF/views/
web.view.suffix=.jsp

 

开始页面定义在shiro 中的 配置文件 loginUrl 中 

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager" /><!--
 <property name="loginUrl" value="${adminPath}/login" />
<property name="successUrl" value="${adminPath}?login" />
<property name="filters">
<map>
<entry key="cas" value-ref="casFilter"/>
<entry key="authc" value-ref="formAuthenticationFilter"/>
</map>
</property>
<property name="filterChainDefinitions">
<ref bean="shiroFilterChainDefinitions"/>
</property>
</bean>

 

在类LoginController 中 @RequestMapping(value = "${adminPath}/login", method = RequestMethod.GET) 定义了 处理登陆的方法

如果已经登陆过 在此打开登陆页面时 输入系统主页面时 

LoginController 类中会直接调用以下方法    //@RequiresPermissions("user") shiro判断已经登陆 就执行 index 方法

@RequiresPermissions("user")
@RequestMapping(value = "${adminPath}")

public String index(HttpServletRequest request, HttpServletResponse response) 

posted @ 2017-02-16 15:38  My-yunShu  阅读(421)  评论(0编辑  收藏  举报