Last active
May 22, 2017 17:44
-
-
Save fabiangarga/172ed9fd77dd597e627b3203b9a5bb80 to your computer and use it in GitHub Desktop.
Java Spring MVC Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Error on dispatchler check this link: | |
* http://javarevisited.blogspot.com.uy/2015/09/eclipse-javalangclassnotfoundexception.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.pluralsight</groupId> | |
<artifactId>FitnessTracker</artifactId> | |
<packaging>war</packaging> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>FitnessTracker Maven Webapp</name> | |
<url>http://maven.apache.org</url> | |
<dependencies> | |
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>3.8.1</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-webmvc</artifactId> | |
<version>4.2.4.RELEASE</version> | |
</dependency> | |
<dependency> | |
<groupId>javax.servlet</groupId> | |
<artifactId>servlet-api</artifactId> | |
<version>2.5</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>javax.servlet</groupId> | |
<artifactId>jstl</artifactId> | |
<version>1.2</version> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
<build> | |
<finalName>FitnessTracker</finalName> | |
</build> | |
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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:mvc="http://www.springframework.org/schema/mvc" | |
xmlns:p="http://www.springframework.org/schema/p" | |
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd | |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> | |
<mvc:annotation-driven/> | |
<mvc:resources location="pdfs" mapping="/pdfs/**"/> | |
<mvc:interceptors> | |
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" | |
p:paramName="language"/> | |
</mvc:interceptors> | |
<context:component-scan base-package="com.pluralsight.controller"/> | |
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" | |
p:prefix="/WEB-INF/jsp/" p:suffix=".jsp"/> | |
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource" | |
p:basename="messages"/> | |
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" | |
p:defaultLocale="en"/> | |
</beans> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app version="2.5" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee | |
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> | |
<servlet> | |
<servlet-name>fitTrackerServlet</servlet-name> | |
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> | |
<init-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value>/WEB-INF/config/servlet-config.xml</param-value> | |
</init-param> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>fitTrackerServlet</servlet-name> | |
<url-pattern>*.html</url-pattern> | |
</servlet-mapping> | |
<servlet-mapping> | |
<servlet-name>fitTrackerServlet</servlet-name> | |
<url-pattern>/pdfs/**</url-pattern> | |
</servlet-mapping> | |
<display-name>Archetype Created Web Application</display-name> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment