[jboss-cvs] JBossAS SVN: r99491 - in projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc: src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jan 15 11:38:29 EST 2010
Author: lvlcek at redhat.com
Date: 2010-01-15 11:38:29 -0500 (Fri, 15 Jan 2010)
New Revision: 99491
Added:
projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc/AccountController.java
projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/searchAccount.jsp
Modified:
projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/pom.xml
projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/web.xml
Log:
Solved TLD dependency issue (jar with TLD has to be in WEB-INF/lib folder but all other transitive dependencies have to be excluded manually in POM as they can be found in EAR/lib).
First simple working spring mvc model and JSP page (just a proof of concept).
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/pom.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/pom.xml 2010-01-15 16:38:15 UTC (rev 99490)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/pom.xml 2010-01-15 16:38:29 UTC (rev 99491)
@@ -10,7 +10,7 @@
<artifactId>sportsclub-invoicing-webmvc</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
- <name>sportsclub-invoicing-webmvc Maven Webapp</name>
+ <name>Sports Club Invoicing Spring MVC Front-End</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
@@ -25,7 +25,33 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
- <scope>provided</scope>
+ <version>2.5.6.SEC01</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Added: projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc/AccountController.java
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc/AccountController.java (rev 0)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/java/org/jboss/snowdrop/samples/sportsclub/springmvc/AccountController.java 2010-01-15 16:38:29 UTC (rev 99491)
@@ -0,0 +1,37 @@
+package org.jboss.snowdrop.samples.sportsclub.springmvc;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.ui.ModelMap;
+import org.springframework.validation.BindingResult;
+
+/**
+ * @author <a href="mailto:lvlcek at redhat.com">Lukas Vlcek</a>
+ */
+ at Controller
+public class AccountController
+{
+
+ @RequestMapping(value = "/searchAccount.do", method = RequestMethod.GET)
+ ModelMap enterPage(UserInput userInput)
+ {
+ userInput.setData("get");
+
+ ModelMap model = new ModelMap();
+ model.addAttribute(userInput);
+ return model;
+ }
+
+ @RequestMapping(value = "/searchAccount.do", method = RequestMethod.POST)
+ ModelMap updateAccount(UserInput userInput)
+ {
+
+ userInput.setData("post");
+
+ ModelMap model = new ModelMap();
+ model.addAttribute(userInput);
+ return model;
+ }
+
+}
Added: projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/searchAccount.jsp
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/searchAccount.jsp (rev 0)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/jsp/searchAccount.jsp 2010-01-15 16:38:29 UTC (rev 99491)
@@ -0,0 +1,36 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+<%--<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>--%>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
+<%--<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>--%>
+
+<html>
+<head><title>Sports Club: Invoicing - search account</title></head>
+<body>Hello in invoicing!
+<p>This is it: <c:out value="${userInput.data}"/></p>
+
+<form:form commandName="userInput">
+ <table>
+ <tr>
+ <tr>
+ <td>Current Invoice:</td>
+ <td><form:checkbox path="currentInvoice"/></td>
+ </tr>
+ <td>First Name:</td>
+ <td><form:input path="firstName"/></td>
+ </tr>
+ <tr>
+ <td>Last Name:</td>
+ <td><form:input path="lastName"/></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <input type="submit" value="Save Changes"/>
+ </td>
+ </tr>
+ </table>
+</form:form>
+
+</body>
+</html>
\ No newline at end of file
Modified: projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/web.xml 2010-01-15 16:38:15 UTC (rev 99490)
+++ projects/snowdrop/examples/trunk/sportsclub/sportsclub-invoicing-webmvc/src/main/webapp/WEB-INF/web.xml 2010-01-15 16:38:29 UTC (rev 99491)
@@ -3,7 +3,7 @@
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
- <display-name>Archetype Created Web Application</display-name>
+ <display-name>Sports Club Spring Web MVC Application</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-business-context.xml</param-value>
More information about the jboss-cvs-commits
mailing list