Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesward committed Aug 13, 2012
1 parent 4a44268 commit a7ffe80
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 48 deletions.
33 changes: 33 additions & 0 deletions README.md
@@ -0,0 +1,33 @@
Containerless Spring MVC
------------------------

Run Spring MVC in a self-contained / containerless application.

### Run Locally

Build with Maven:

mvn package

Run:

java -cp target/classes:target/dependency/* com.jamesward.Webapp

Open:

> [http://localhost:8080](http://localhost:8080)

### Run on Heroku

Create an app:

heroku create

Deploy:

git push heroku master

Open:

heroku open
6 changes: 3 additions & 3 deletions pom.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>springmvc-https-enforcer</artifactId>
<groupId>com.jamesward</groupId>
<artifactId>containerless-spring</artifactId>
<version>0.0.1-SNAPSHOT</version>

<dependencies>
Expand All @@ -19,7 +19,7 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>8.1.3.v20120416</version>
<version>8.1.5.v20120716</version>
</dependency>
</dependencies>

Expand Down
39 changes: 0 additions & 39 deletions src/main/java/com/jamesward/HttpsEnforcer.java

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/com/jamesward/WebConfig.java
@@ -1,6 +1,5 @@
package com.jamesward;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/jamesward/Webapp.java
Expand Up @@ -6,9 +6,6 @@
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

import javax.servlet.DispatcherType;
import java.util.EnumSet;


public class Webapp {

Expand All @@ -21,7 +18,6 @@ public static void main(String[] args) throws Exception {
final ServletContextHandler context = new ServletContextHandler();
context.setContextPath("/");
context.addServlet(servletHolder, "/*");
context.addFilter(HttpsEnforcer.class, "/*", EnumSet.of(DispatcherType.REQUEST));

String webPort = System.getenv("PORT");
if (webPort == null || webPort.isEmpty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/index.html
@@ -1,6 +1,6 @@
<!doctype html>
<html>
<body>
hello, HTTPS
hello, world
</body>
</html>

0 comments on commit a7ffe80

Please sign in to comment.