Skip to content

Instantly share code, notes, and snippets.

@jrbalsas
Last active March 27, 2017 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrbalsas/59a24c1b582b4c8070bb42bb0d3104a3 to your computer and use it in GitHub Desktop.
Save jrbalsas/59a24c1b582b4c8070bb42bb0d3104a3 to your computer and use it in GitHub Desktop.
DAW Muro SpringMVC
<?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:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd">
</beans>
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<!-- Using annotated configuration and location of MVC classes -->
<mvc:annotation-driven />
<context:component-scan base-package="com.daw.muro" />
<!-- View resolver and jsp folder location -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/"
p:suffix=".jsp" />
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" 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">
<!-- Spring Context Listener: i.e. Dependency Injection -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!-- SpringMVC Dispatcher Servlet auto start and URL assignment -->
<servlet>
<servlet-name>SpringDispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SpringDispatcher</servlet-name>
<url-pattern>/main/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<!-- Sample authorization rule. Use Security Tab to add new rules-->
<!--
<security-constraint>
<display-name>Acceso a usuarios</display-name>
<web-resource-collection>
<web-resource-name>muro</web-resource-name>
<description/>
<url-pattern>/muro</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>USUARIOS</role-name>
<role-name>ADMINISTRADORES</role-name>
</auth-constraint>
</security-constraint>
-->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>file</realm-name>
<form-login-config>
<form-login-page>/index.jsp</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description/>
<role-name>USUARIOS</role-name>
</security-role>
<security-role>
<description/>
<role-name>ADMINISTRADORES</role-name>
</security-role>
</web-app>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment