Created
July 22, 2011 15:06
-
-
Save franz-ka/1099632 to your computer and use it in GitHub Desktop.
First GAE + Spring MVC
This file contains 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
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | |
<%@ page session="false" %> | |
<html> | |
<head> | |
<title>Home</title> | |
</head> | |
<body> | |
<h1>Hello world!</h1> | |
</body> | |
</html> |
This file contains 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
package com.gae.app; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
/** | |
* Handles requests for the application home page. | |
*/ | |
@Controller | |
public class HomeController { | |
@RequestMapping(value = "/") | |
public String home() { | |
System.out.println("HomeController: Passing through..."); | |
return "home"; | |
} | |
} |
This file contains 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:mvc="http://www.springframework.org/schema/mvc" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xsi:schemaLocation=" | |
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd | |
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"> | |
<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure --> | |
<!-- Scans within the base package of the application for @Components to configure as beans --> | |
<!-- @Controller, @Service, @Configuration, etc. --> | |
<context:component-scan base-package="com.gae.app" /> | |
<!-- Enables the Spring MVC @Controller programming model --> | |
<mvc:annotation-driven /> | |
<!-- Resolve logical view names to .jsp resources in the /WEB-INF/views directory --> | |
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> | |
<property name="prefix" value="/WEB-INF/views/" /> | |
<property name="suffix" value=".jsp" /> | |
</bean> | |
</beans> |
This file contains 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"> | |
<!-- Processes application requests --> | |
<servlet> | |
<servlet-name>appServlet</servlet-name> | |
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> | |
<init-param> | |
<param-name>contextConfigLocation</param-name> | |
<param-value>/WEB-INF/servlet-context.xml</param-value> | |
</init-param> | |
<load-on-startup>1</load-on-startup> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>appServlet</servlet-name> | |
<url-pattern>/</url-pattern> | |
</servlet-mapping> | |
</web-app> |
DLS:
ecplise for java EE >> http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/heliossr2
jdk6 u26 >> http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html
asm-jar >> http://forge.ow2.org/projects/asm
cglib-jar >> http://sourceforge.net/projects/cglib/files/
commons-logging >> http://commons.apache.org/logging/download_logging.cgi
springframework (latest GA) >> http://www.springsource.com/download/community
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usando Eclipse 3.6 R2 + GAE + Spring MVC
New >> Web Application Project
Agregar a "war/WEB-INF/lib"
asm-4.0_RC1
cglib-2.2.2
commons-logging-1.1.1
org.springframework.asm-3.0.5.RELEASE.jar
org.springframework.beans-3.0.5.RELEASE.jar
org.springframework.context-3.0.5.RELEASE.jar
org.springframework.core-3.0.5.RELEASE.jar
org.springframework.expression-3.0.5.RELEASE.jar
org.springframework.web-3.0.5.RELEASE.jar
org.springframework.web.servlet-3.0.5.RELEASE.jar
Agregar (user library)Spring3 con
org.springframework.context-3.0.5.RELEASE.jar
org.springframework.web-3.0.5.RELEASE.jar
org.springframework.web.servlet-3.0.5.RELEASE.jar