搭建Struct2.3+hibermate4.2+Spring4.1,有错上网没解决,求助大婶

Spring Hibernate Integration Hello World Tutorial (Spring + Hibernate + MySql) |
Today i will walk you through the integration of Hibernate with a Spring MVC application using annotations. In this particular blog we will create a simple Hello World application in Spring and Hibernate. Our objective for today's discussion id to create a simple registration form using spring's
tags, the data is to be persist in a MySql database and after that we will retrieve the data from database and will show the data in table form.
The very first step to start an application is creating a database, lets create a database with name 'beingjavaguys_db' and create a 'USER' table in it. To create database simply copy the script below and run it in your 'query editor'. This will create a database and table with required fields.
DROP TABLE IF EXISTS `USER`;
/*!40101 SET @saved_cs_client
= @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(45) DEFAULT NULL,
`last_name` varchar(45) DEFAULT NULL,
`gender` varchar(45) DEFAULT NULL,
`city` varchar(45) DEFAULT NULL,
PRIMARY KEY (`user_id`)
Project Structure
Before we start adding some code to our application lets take a look at overall project structure. Create a simple 'web application' project in 'Eclipse' and add all code files to it as mentioned in rest part of this blog.
/WebContent/WEB-INF/web.xml
First of all add some entries to your 'web.xml' so that the 'tomcat container' could understand the behavior of application. Add a servlet entry point for 'DispatcherServlet' to make the container understand that all spring configuration is done in it and going to be used accordingly. Now add 'url-mapping' to 'DispatcherServlet' , this tells the container that all requests with /'.html' extention are going to be handled by spring itself. At the end of the file a entry for welcome file is added that indicates the starting point of the application.
&?xml version="1.0" encoding="UTF-8"?&
&web-app version="2.5" xmlns="/xml/ns/javaee"
&&& xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
&&& xsi:schemaLocation="/xml/ns/javaee /xml/ns/javaee/web-app_2_5.xsd"&
&&& &servlet&
&&& &&& &servlet-name&dispatcher&/servlet-name&
&&& &&& &servlet-class&org.springframework.web.servlet.DispatcherServlet&/servlet-class&
&&& &&& &load-on-startup&1&/load-on-startup&
&&& &/servlet&
&&& &servlet-mapping&
&&& &&& &servlet-name&dispatcher&/servlet-name&
&&& &&& &url-pattern&*.html&/url-pattern&
&&& &/servlet-mapping&
&&& &welcome-file-list&
&&& &&& &welcome-file&index.jsp&/welcome-file&
&&& &/welcome-file-list&
&/web-app&
/WebContent/index.jsp
In 'index.jsp' a 'SendRedirect' is added that redirects the control to '/register.html' so that spring could take the command from this point.
&%@page import="com.sun.mail.iap.Response"%&
&%@ page language="java" contentType="text/ charset=UTF-8"
&&& pageEncoding="UTF-8"%&
&&& &%response.sendRedirect("register.html"); %&
&!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&
/src/com/beingjavaguys/controller/HomeController.java
We have added a controller with name 'Home Controller' and configured it using required mappings. '@Controller' tells that the class is going to be used as a controller for the application. '@RequestMapping' tells that the method will behave like an action for the mentioned 'url pattern'. Whenever a request pattern will match to the pattern specified in '@RequestMapping' the code written in related method will be executed. Here you can see that the every action is returning an object of 'ModelAndView' class. 'ModelAndView' class offers a number of things to the application, the very first parameter that is passed to it, represents the name of view(required jsp file) that is going to be rendered after completion of action's code. The second parameter indicated a String value key for the object that is placed as third parameter. Using these capabilities we can send an object to view associated with a key.
package com.beingjavaguys.
import java.util.ArrayL
import java.util.HashM
import java.util.M
import org.springframework.beans.factory.annotation.A
import org.springframework.stereotype.C
import org.springframework.validation.BindingR
import org.springframework.web.bind.annotation.ModelA
import org.springframework.web.bind.annotation.RequestM
import org.springframework.web.servlet.ModelAndV
import com.beingjavaguys.domain.U
import com.beingjavaguys.service.UserS
@Controller
public class HomeController {
&& @Autowired
&&& private UserService userS
@RequestMapping("/register")
&&& public ModelAndView getRegisterForm(@ModelAttribute("user") User user,
&&& &&& &&& BindingResult result) {
&&& &&& ArrayList&String& gender = new ArrayList&String&();
&&& &&& gender.add("Male");
&&& &&& gender.add("Female");
&&& &&& ArrayList&String& city = new ArrayList&String&();
&&& &&& city.add("Delhi");
&&& &&& city.add("Kolkata");
&&& &&& cit.add("Chennai");
&&& &&& city.add("Bangalore");
&&& &&& Map&String, Object& model = new HashMap&String, Object&();
&&& &&& model.put("gender", gender);
&&& &&& model.put("city", city);
&&& &&& System.out.println("Register Form");
&&& &&& return new ModelAndView("Register", "model", model);
&&& @RequestMapping("/saveUser")
&&& public ModelAndView saveUserData(@ModelAttribute("user") User user,
&&& &&& &&& BindingResult result) {
&&& &&& userService.addUser(user);
&&& &&& System.out.println("Save User Data");
&&& &&& return new ModelAndView("redirect:/userList.html");
&&& @RequestMapping("/userList")
&&& public ModelAndView getUserList() {
&&& &&& Map&String, Object& model = new HashMap&String, Object&();
&&& &&& model.put("user", userService.getUser());
&&& &&& return new ModelAndView("UserDetails", model);
/src/com/beingjavaguys/dao/UserDao.java
DAO stand for data access object, it makes it easy to communicate the application with database. We are using an interface here this implements standard industrial practices. Required methods are declared here and being implemented in related implementation class associated with it.
package com.beingjavaguys.
import java.util.L
import com.beingjavaguys.domain.U
public interface UserDao {
public void saveUser ( User user );
public List&User& getUser();
/src/com/beingjavaguys/dao/UserDaoImpl.java
This is implementation class for UserDao interface, all methods declared in UserDao interface are implemented here to achieve the goal. 'saveUser()' method takes an User's object as parameter and persists it in the database using 'sessionFactory' object. Similarly 'getUser()' method is returning a list of User's object using a Hibernate Criteria query.
package com.beingjavaguys.
import java.util.L
import org.hibernate.SessionF
import org.springframework.beans.factory.annotation.A
import org.springframework.stereotype.R
import com.beingjavaguys.domain.U
@Repository("userDao")
public class UserDaoImpl implements UserDao {
&&& @Autowired
&&& private SessionFa
&&& @Override
&&& @Transactional
&&& public void saveUser(User user) {
&&& &&& sessionfactory.getCurrentSession().saveOrUpdate(user);
&&& @Override
&&& @Transactional
&&& public List&User& getUser() {
&&& &&& @SuppressWarnings("unchecked")
&&& &&& List&User& userlist = sessionfactory.getCurrentSession()
&&& &&& &&& &&& .createCriteria(User.class).list();
/src/com/beingjavaguys/domain/User.java
To represent User entity within the application and to persist User's objects we uses a User class with all required fields. This is nothing but a simple java bean with some Hibernate annotations. @Entity tells that the class is a domain class that maps to a table in the database. The name attribute of '@Table' specifies the table name in the database. @Id tells that the related column is going to represent the 'primary key' for the table and @GeneratedValue show auto increment nature for related column. The name attribute of '@Column' specifies the related column name for the field.
package com.beingjavaguys.
import javax.persistence.C
import javax.persistence.E
import javax.persistence.GeneratedV
import javax.persistence.Id;
import javax.persistence.T
@Table(name = "USER")
public class User {
&&& @GeneratedValue
&&& @Column(name = "user_id")
&&& @Column(name = "first_name")
&&& private String firstN
&&& @Column(name = "last_name")
&&& private String lastN
&&& @Column(name = "gender")
&&& private S
&&& @Column(name = "city")
&&& private String C
&&& public int getId() {
&&& public void setId(int id) {
&&& &&& this.id =
&&& public String getFirstName() {
&&& &&& return firstN
&&& public void setFirstName(String firstName) {
&&& &&& this.firstName = firstN
&&& public String getLastName() {
&&& &&& return lastN
&&& public void setLastName(String lastName) {
&&& &&& this.lastName = lastN
&&& public String getGender() {
&&& public void setGender(String gender) {
&&& &&& this.gender =
&&& public String getCity() {
&&& &&& return C
&&& public void setCity(String city) {
&&& &&& City =
/src/com/beingjavaguys/service/UserService.java
Service layer is added here to implement two layer architecture for the application, it works some kind of interface in between the application and database transactions. Its always a good practice to have a service layer in your application so that the application data can be isolated to database code and reusability can be enhanced.
package com.beingjavaguys.
import java.util.L
import com.beingjavaguys.domain.U
public interface UserService {
&&& public void addUser(User user);
&&& public List&User& getUser();
/src/com/beingjavaguys/service/UserServiceImpl.java
This is implementation for UserService interface, service methods are called in application controlled to perform database stuff.
package com.beingjavaguys.
import java.util.L
import org.springframework.beans.factory.annotation.A
import org.springframework.stereotype.S
import org.springframework.transaction.annotation.P
import org.springframework.transaction.annotation.T
import com.beingjavaguys.dao.UserD
import com.beingjavaguys.domain.U
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class UserServiceImpl implements UserService {
&&& @Autowired
&&& UserDao userD
&&& @Override
&&& public void addUser(User user) {
&&& &&& userDao.saveUser(user);
&&& @Override
&&& public List&User& getUser() {
&&& &&& return userDao.getUser();
/src/jdbc.properties
A property class is added here to specify all required database properties in a separated file, show_sql=true make all database queries to show on console.
database.driver=com.mysql.jdbc.Driver
database.url=jdbc:mysql://localhost:3306/beingjavaguys_db
database.user=root
database.password=root
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create/update&
/WebContent/WEB-INF/dispatcher-servlet.xml
Dispatcher servlet is the root of an spring application, all spring configurations goes here is a single file. The 'jspViewResolver' bean specifies the view files path and its prefix and suffix attributes makes it easy to use simple view names in application rather that specifying full path.
&?xml version="1.0" encoding="UTF-8"?&
&beans xmlns="http://www.springframework.org/schema/beans"
&&& xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
&&& xmlns:tx="http://www.springframework.org/schema/tx"
&&& xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"&
&&& &context:property-placeholder location="classpath:jdbc.properties" /&
&&& &context:component-scan base-package="com.beingjavaguys" /&
&&& &tx:annotation-driven transaction-manager="hibernateTransactionManager" /&
&&& &bean id="jspViewResolver"
&&& &&& class="org.springframework.web.servlet.view.InternalResourceViewResolver"&
&&& &&& &property name="viewClass"
&&& &&& &&& value="org.springframework.web.servlet.view.JstlView" /&
&&& &&& &property name="prefix" value="/WEB-INF/view/" /&
&&& &&& &property name="suffix" value=".jsp" /&
&&& &/bean&
&&& &bean id="dataSource"
&&& &&& class="org.springframework.jdbc.datasource.DriverManagerDataSource"&
&&& &&& &property name="driverClassName" value="${database.driver}" /&
&&& &&& &property name="url" value="${database.url}" /&
&&& &&& &property name="username" value="${database.user}" /&
&&& &&& &property name="password" value="${database.password}" /&
&&& &/bean&
&&& &bean id="sessionFactory"
&&& &&& class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&
&&& &&& &property name="dataSource" ref="dataSource" /&
&&& &&& &property name="annotatedClasses"&
&&& &&& &&& &list&
&&& &&& &&& &&& &value&com.beingjavaguys.domain.User&/value&
&&& &&& &&& &/list&
&&& &&& &/property&
&&& &&& &property name="hibernateProperties"&
&&& &&& &&& &props&
&&& &&& &&& &&& &prop key="hibernate.dialect"&${hibernate.dialect}&/prop&
&&& &&& &&& &&& &prop key="hibernate.show_sql"&${hibernate.show_sql}&/prop&
&&& &&& &&& &/props&
&&& &&& &/property&
&&& &/bean&
&&& &bean id="hibernateTransactionManager"
&&& &&& class="org.springframework.orm.hibernate3.HibernateTransactionManager"&
&&& &&& &property name="sessionFactory" ref="sessionFactory" /&
&&& &/bean&
/WebContent/WEB-INF/view/Register.jsp
&%@ page language="java" contentType="text/ charset=UTF-8"
pageEncoding="UTF-8"%&
&%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%&
&%@ taglib uri="/jsp/jstl/core" prefix="c"%&
&!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&
&meta http-equiv="Content-Type" content="text/ charset=UTF-8"&
&title&Being Java Guys | Registration Form&/title&
&div style="color:font-size: 30px"&Being Java Guys | Registration Form&/div&
&c:url var="userRegistration" value="saveUser.html"/&
&form:form id="registerForm" modelAttribute="user" method="post" action="${userRegistration}"&
&table width="400px" height="150px"&
&td&&form:label path="firstName"&First Name&/form:label&&/td&
&td&&form:input
path="firstName"/&&/td&
&td&&form:label path="lastName"&Last Name&/form:label&&/td&
&td&&form:input
path="lastName"/&&/td&
&td&&form:label path="gender"&Gender&/form:label&&/td&
&td&&form:radiobuttons path="gender" items="${model.gender}"/&&/td&
&td&&form:label path="city"&City&/form:label&&/td&
&td&&form:select path="city" items="${model.city}"&&/form:select&&/td&
&tr&&td&&/td&&td&
&input type="submit" value="Register" /&
&/td&&/tr&
&/form:form&
&a href="userList.html" &Click Here to see User List&/a&
/WebContent/WEB-INF/view/UserDetails.jsp
&%@ page language="java" contentType="text/ charset=UTF-8"
pageEncoding="UTF-8"%&
&%@ taglib uri="/jsp/jstl/core" prefix="c"%&
&!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&
&meta http-equiv="Content-Type" content="text/ charset=UTF-8"&
&title&Being Java Guys | User Details&/title&
&div style="color:font-size: 30px"&Being Java Guys | User Details&/div&
&c:if test="${!empty user}"&
&table border="1" bgcolor="black" width="600px"&
&tr style="background-color:color:text-align:" height="40px"&
&td&User Id&/td&
&td&First Name&/td&
&td&Last Name&/td&
&td&Gender&/td&
&td&City&/td&
&c:forEach items="${user}" var="user"&
&tr style="background-color:color:text-align:" height="30px" &
&td&&c:out value="${user.id}"/&&/td&
&td&&c:out value="${user.firstName}"/&&/td&
&td&&c:out value="${user.lastName}"/&&/td&
&td&&c:out value="${user.gender}"/&&/td&
&td&&c:out value="${user.city}"/&&/td&
&/c:forEach&
&a href="register.html" &Click Here to add new User&/a&
Here we are done with creating a simple hello world application using Spring and Hibernate. Just run your application on server, if everything went right you will see output something like these screens showing below.
In this blog we went through Spring, Hibernate Integration process and we get to know 'How to create a simple hello world applicaton is springa and hibernate using annotations'. In upcoming blogs we will dive into some others tutorials using spring and hibernate technologies.&
Thanks for reading !Being Java Guys
Subscribe to:
Skype: neel4softPost Reply
Bookmark Topic
Spring 3 + Spring Security 3 + Struts2 + Hibernate 3
Hello everybody. (Sorry for my english)
Im trying to get a architecture with Spring 3 + Spring Security 3 + Struts2 + Hibernate 3.
The app go right with Spring 3 + Struts2 + Hibernate 3 but I can not get anything with Spring Security.
None error is throwed by app.
Login.action and the following
load fine but when I push over submit button (j_spring_security_check), nothing happend and the default action PaginaNoEncontrada (Page not Found) is loaded
?Why does it work?
Thanks in advance.
That is my configuration code:
&?xml version="1.0" encoding="UTF-8"?&
&web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="/xml/ns/javaee"
xmlns:web="/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="/xml/ns/javaee "
id="WebApp_ID" version="2.5"&
&display-name&cv&/display-name&
&!--SPRING SECURITY--&
&filter-name&springSecurityFilterChain&/filter-name&
&filter-class&org.springframework.web.filter.DelegatingFilterProxy&/filter-class&
&filter-mapping&
&filter-name&springSecurityFilterChain&/filter-name&
&url-pattern&/*&/url-pattern&
&/filter-mapping&
&!--SPRING SECURITY--&
&!--SPRING--&
&listener&
&listener-class &org.springframework.web.context.ContextLoaderListener&/listener-class&
&/listener&
&listener&
&listener-class&org.springframework.web.util.Log4jConfigListener&/listener-class&
&/listener&
&context-param&
&param-name&contextConfigLocation&/param-name&
&param-value&
/WEB-INF/spring/applicationContext-dao.xml
/WEB-INF/spring/applicationContext-transaction.xml
/WEB-INF/spring/applicationContext-service.xml
&!--Spring Security Context--&
/WEB-INF/spring/applicationContext-security.xml
&/param-value&
&/context-param&
&!--SPRING--&
&!--STRUTS 2--&
&filter-name&struts2&/filter-name&
&filter-class&org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&/filter-class&
&filter-mapping&
&filter-name&struts2&/filter-name&
&url-pattern&/*&/url-pattern&
&/filter-mapping&
&!--STRUTS 2--&
&!--TILES--&
&listener&
&listener-class&org.apache.struts2.tiles.StrutsTilesListener&/listener-class&
&/listener&
&context-param&
&param-name&org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG&/param-name&
&param-value&/WEB-INF/tiles/tiles-def.xml,/WEB-INF/tiles/tiles-def-acciones.xml&/param-value&
&/context-param&
&!--TILES--&
&!--WEB-LISTENER--&
&listener&
&listener-class&un.listeners.LoadProperties&/listener-class&
&/listener&
&welcome-file-list&
&welcome-file&index.html&/welcome-file&
&/welcome-file-list&
&error-page&
&error-code&403&/error-code&
&location&/error.html&/location&
&/error-page&
&/web-app&
struts.xml
&?xml version="1.0" encoding="UTF-8" ?&
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"&
&constant name="struts.enable.DynamicMethodInvocation" value="false" /&
&constant name="struts.devMode" value="false" /&
&constant name="struts.i18n.encoding" value="UTF-8"/&
&constant name="struts.custom.i18n.resources" value="global.application, global.errores" /&
&include file="example.xml"/&
&package name="default" namespace="/" extends="struts-default"&
&result-types&
&result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" /&
&/result-types&
&!--INTERCEPTORS--&
&interceptors&
&interceptor name="noAction" class="un.interceptor.noActionInterceptor" /&
&interceptor-stack name="loggingStack"&
&interceptor-ref name="noAction" /&
&interceptor-ref name="defaultStack" /&
&/interceptor-stack&
&/interceptors&
&default-interceptor-ref name="loggingStack"&&/default-interceptor-ref&
&!--DEFAULT-ACTION--&
&default-action-ref name="PaginaNoEncontrada" /&
&!--GLOBAL RESULT--&
&global-results&
&result name="errorGeneral" type="tiles"&errorGeneral&/result&
&/global-results&
&!--EXCEPTIONS--&
&global-exception-mappings&
&exception-mapping exception="java.lang.Exception" result="error.errorGeneral"/&
&exception-mapping exception="java.lang.RuntimeException" result="error.errorGeneral"/&
&exception-mapping exception="comun.exceptions.AppException" result="error.errorGeneral"/&
&exception-mapping exception="comun.exceptions.BadArgumentException" result="error.errorGeneral"/&
&exception-mapping exception="comun.exceptions.FileException" result="error.errorGeneral"/&
&exception-mapping exception="comun.exceptions.SystemException" result="error.errorGeneral"/&
&/global-exception-mappings&
&!--ACTIONS--&
&action name="PaginaNoEncontrada"&
&result type="tiles"&paginaNoEncontrada&/result&
&action name="Login" class="es.cv.Login"&
&result name="input"&/jsp/pages/Login.jsp&/result&
&result name="languaje"&/jsp/pages/Login.jsp&/result&
&/package&
applicationContext-security.xml
&?xml version="1.0" encoding="UTF-8"?&
&beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd"&
&security:http auto-config="true" use-expressions="true" access-denied-page="/cv/denied.jsp" &
&security:intercept-url pattern="/cv/*" access="permitAll"/&
&security:intercept-url pattern="/cv/css/*" access="permitAll"/&
&security:intercept-url pattern="/cv/js/*" access="permitAll"/&
&security:intercept-url pattern="/cv/img/*" access="permitAll"/&
&security:intercept-url pattern="/cv/jsp/*" access="permitAll"/&
&security:intercept-url pattern="/cv/Login.action" filters="none"/&
&security:intercept-url pattern="/cv/example/*" access="isFullyAuthenticated()"/&
&security:form-login
login-page="/cv/Login.action"
default-target-url="/cv/example/HelloWorld.action"
authentication-failure-url="/cv/Login.action?error=true"/&
&security:logout
invalidate-session="true"
logout-success-url="/cv/Login.action"
logout-url="/cv/Login.action"/&
&/security:http&
&bean class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" id="passwordEncoder"/&
&bean id="customUserDetailsService" class="es.cv.business.services.impl.SpringSecurityService"/&
&security:authentication-manager&
&security:authentication-provider user-service-ref="customUserDetailsService"&
&security:password-encoder ref="passwordEncoder"/&
&/security:authentication-provider&
&/security:authentication-manager&
&%@include file="/jsp/meta/meta.jsp"%&
&title&Sign On&/title&
&s:form action="j_spring_security_check" method="post"&
&s:textfield key="j_username"/&
&s:password key="j_password" /&
&s:submit key="entrar"/&
Mark Spritzler
Posts: 17278
Please use the CODE tags to post code or xml, so that indentation remains and it is readable. The Code button above is what you use to add CODE tags.
Daniel Henry
use a regular &form& tag instead of &s:form&
&form id="LoginForm" method="POST" action="&s:url value='j_spring_security_check'/&" &
When you use &s:form& it actually posts it to j_spring_security_check.action, which obviously won't do anything.
Hope that helps.
Cheo Gomez
Hi, Im trying to do the same, could you please send me the code of your example?
thank you very much
Muhammad Abdul Arif
The url /j_spring_security_check doesnot match the
urls you provided below. so filters are not getting invoked.
&security:intercept-url pattern="/cv/*" access="permitAll"/&
&security:intercept-url pattern="/cv/css/*" access="permitAll"/&
&security:intercept-url pattern="/cv/js/*" access="permitAll"/&
&security:intercept-url pattern="/cv/img/*" access="permitAll"/&
&security:intercept-url pattern="/cv/jsp/*" access="permitAll"/&
&security:intercept-url pattern="/cv/Login.action" filters="none"/&
&security:intercept-url pattern="/cv/example/*" access="isFullyAuthenticated()"/&
You can do two things.
1) change the url j_spring_check_security to match below given patterns or
2)or add a new pattern for /j_spring_security_check as below
&security:intercept-url pattern="/j_spring_security_check**" access="isFullyAuthenticated()"/&
Post Reply
Bookmark Topic
Similar Threads

我要回帖

更多关于 hibermate 的文章

 

随机推荐