You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@batchee.apache.org by rm...@apache.org on 2014/03/30 22:07:29 UTC

[06/11] BATCHEE-16 splitting batchee war in embedded jar and webapp war

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/js/start.js
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/js/start.js b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/js/start.js
new file mode 100644
index 0000000..2f5e37d
--- /dev/null
+++ b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/js/start.js
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+$(function () {
+    $('#add-param').click(function () {
+        var keyEntry = $('#key');
+        var valueEntry = $('#value');
+
+        var key = keyEntry.val();
+        var value = valueEntry.val();
+
+        $('#values').append('' +
+            '<div id="cg_' + key + '" class="control-group">' +
+            '  <div class="controls" id="c_' + key + '">' +
+            '    <input type="text" name="k_' + key + '" value="' + key + '">' +
+            '    <input type="text" name="v_' + key + '" value="' + value + '">' +
+            '    <button class="btn btn-small" type="button">Remove</button>' +
+            '  </div>' +
+            '</div>');
+
+        keyEntry.val('');
+        valueEntry.val('');
+
+        var blockId = '#cg_' + key;
+        $(blockId).on('click', function(event) {
+            event.preventDefault();
+            $(blockId).remove();
+        });
+    });
+
+    $('#set-job-name').on('click', function(event) {
+        event.preventDefault();
+        $('#job-name').val($('#job-name-input').val());
+    });
+
+    $('#start-job').submit(function (event) {
+        var jobNameInput = $('#job-name-input');
+        if (jobNameInput.length) {
+            $('#job-name').val(jobNameInput.val());
+        }
+    });
+});

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/layout.jsp
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/layout.jsp b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/layout.jsp
new file mode 100644
index 0000000..fdbf9b5
--- /dev/null
+++ b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/layout.jsp
@@ -0,0 +1,63 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+--%>
+<%@ page session="false" %>
+<% final String mapping = (String) request.getAttribute("mapping"); %>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="Apache JBatch GUI">
+
+    <link href="<%= request.getAttribute("context") %>/internal/batchee/css/bootstrap.min.3.0.0.css" rel="stylesheet" media="screen">
+
+    <title>Apache JBatch GUI</title>
+</head>
+
+<body>
+
+<div class="container">
+    <div class="header">
+        <ul class="nav nav-pills pull-right">
+            <li><a href="<%= mapping %>/start/">New Batch</a></li>
+            <li><a href="<%= mapping %>/">Home</a></li>
+        </ul>
+        <h3 class="text-muted">Apache JBatch GUI</h3>
+    </div>
+
+    <div id="content" class="row">
+        <jsp:include page="/internal/batchee/${requestScope.view}.jsp" />
+    </div>
+
+    <div class="footer">
+        <p>Apache &copy; Company 2013</p>
+    </div>
+</div>
+
+<script src="<%= request.getAttribute("context") %>/internal/batchee/js/jquery-2.0.3.min.js"></script>
+<script src="<%= request.getAttribute("context") %>/internal/batchee/js/bootstrap.min.3.0.0.js"></script>
+<%
+    final String pageJs = (String) request.getAttribute("pageJs");
+    if (pageJs != null) {
+        for (final String js : pageJs.split(",")) {
+%>
+<script src="<%= request.getAttribute("context") %>/internal/batchee/js/<%= js %>"></script>
+<%
+        }
+    }
+%>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/read-only.jsp
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/read-only.jsp b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/read-only.jsp
new file mode 100644
index 0000000..2ddee9a
--- /dev/null
+++ b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/read-only.jsp
@@ -0,0 +1,19 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+--%>
+<%@ page session="false" %>
+<p>This deployment is read only since deployed out of the JBatch application
+so you can't run/stop batches.</p>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/start.jsp
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/start.jsp b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/start.jsp
new file mode 100644
index 0000000..7cffa98
--- /dev/null
+++ b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/start.jsp
@@ -0,0 +1,59 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+--%>
+<%@ page import="java.net.URLEncoder" %>
+<%@ page import="org.apache.batchee.servlet.JBatchController" %>
+<%@ page session="false" %>
+
+<%
+    request.setAttribute("pageJs", "start.js");
+
+    final String name = (String) request.getAttribute("name");
+    final boolean newJob = name == null || name.isEmpty();
+    if (newJob) {
+%>
+<div>
+    Add needed job parameters and name for the new job then click on submit:
+</div>
+<% } else { %>
+<div>
+    Add needed job parameters for job <b><%= name %></b> then click on submit:
+</div>
+<% } %>
+
+<% if (newJob) { %>
+<div class="control-group">
+    <div class="controls" id="c_' + key + '">
+        <input type="text" id="job-name-input" placeholder="type job name...">
+        <button id="set-job-name" class="btn btn-small" type="button">Set Job Name</button>
+    </div>
+</div>
+<% } %>
+
+<div class="control-group">
+  <div class="controls">
+      <input type="text" id="key" placeholder="type a key...">
+      <input type="text" id="value" placeholder="type a value...">
+      <button id="add-param" class="btn btn-small" type="button">Add</button>
+  </div>
+</div>
+
+<form action="<%= request.getAttribute("mapping") %>/doStart/<%= URLEncoder.encode(name, "UTF-8") %>" method="POST"
+      class="form-horizontal">
+    <div id="values"></div>
+    <input id="job-name" type="hidden" name="<%= JBatchController.FORM_JOB_NAME %>" value="<%= name %>">
+    <button id="start-job" type="submit" class="btn">Submit</button>
+</form>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/step-executions.jsp
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/step-executions.jsp b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/step-executions.jsp
new file mode 100644
index 0000000..84dbe6c
--- /dev/null
+++ b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/step-executions.jsp
@@ -0,0 +1,51 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+--%>
+<%@ page session="false" %>
+<%@ page import="org.apache.batchee.servlet.MetricsHelper" %>
+<%@ page import="javax.batch.runtime.StepExecution" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.apache.batchee.servlet.StatusHelper" %>
+
+<% final String name = (String) request.getAttribute("name"); %>
+<h4>Step executions for execution #<%= request.getAttribute("executionId") %> of <%= name %></h4>
+
+<table class="table tabl-hover">
+    <thead>
+    <tr>
+        <th>#</th>
+        <th>Step name</th>
+        <th>Batch status</th>
+        <th>Exit status</th>
+        <th>Start time</th>
+        <th>End time</th>
+        <th>Metrics</th>
+    </tr>
+    </thead>
+    <tbody>
+<% for ( final StepExecution step : (List<StepExecution>) request.getAttribute("steps") ) { %>
+    <tr class="<%= StatusHelper.statusClass(step.getBatchStatus()) %>">
+        <td><%= step.getStepExecutionId() %></td>
+        <td><%= step.getStepName() %></td>
+        <td><%= step.getBatchStatus().name() %></td>
+        <td><%= step.getExitStatus() %></td>
+        <td><%= step.getStartTime() %></td>
+        <td><%= step.getEndTime() %></td>
+        <td><%= MetricsHelper.toString(step.getMetrics()) %></td>
+    </tr>
+<% } %>
+    </tbody>
+</table>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/view.jsp
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/view.jsp b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/view.jsp
new file mode 100644
index 0000000..f6ff9f7
--- /dev/null
+++ b/gui/servlet/embedded/src/main/resources/META-INF/resources/internal/batchee/view.jsp
@@ -0,0 +1,22 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+--%>
+<%@ page session="false" %>
+
+<p>Batch <%= request.getAttribute("name") %></p>
+<pre>
+    <%= request.getAttribute("content") %>
+</pre>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer b/gui/servlet/embedded/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
new file mode 100644
index 0000000..29382ab
--- /dev/null
+++ b/gui/servlet/embedded/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
@@ -0,0 +1 @@
+org.apache.batchee.servlet.JBatchServletInitializer

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/ServletTest.java
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/ServletTest.java b/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/ServletTest.java
new file mode 100644
index 0000000..122b270
--- /dev/null
+++ b/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/ServletTest.java
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.batchee.servlet;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.DomNode;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import org.apache.batchee.servlet.util.CreateSomeJobs;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.descriptor.api.Descriptors;
+import org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.batch.runtime.BatchStatus;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(Arquillian.class)
+public class ServletTest {
+    @ArquillianResource
+    private URL base;
+
+    @Test
+    public void home() throws IOException {
+        assertEquals("init", extractContent("", "/ul/li/a[1]/text()"));
+    }
+
+    @Test
+    public void instances() throws IOException {
+        assertEquals(BatchStatus.COMPLETED.name(), extractContent("executions/init", "/table/tbody/tr/td[2]"));
+    }
+
+    @Test
+    public void steps() throws IOException {
+        assertEquals("step1", extractContent("step-executions/0", "/table/tbody/tr/td[2]"));
+    }
+
+    @Test(expected = FailingHttpStatusCodeException.class)
+    public void privateUrl() throws IOException {
+        final WebClient client = newWebClient();
+        client.getPage(base.toExternalForm() + "jbatch/internal/batchee/jobs.jsp");
+    }
+
+    private String extractContent(final String endUrl, final String xpath) throws IOException {
+        final String url = base.toExternalForm() + "jbatch/" + endUrl;
+        final WebClient webClient = newWebClient();
+
+        final HtmlPage page = webClient.getPage(url);
+        final List<?> byXPath = page.getByXPath("//div[@id=\"content\"]" + xpath);
+        assertEquals(1, byXPath.size());
+
+        final Object next = byXPath.iterator().next();
+        if (!DomNode.class.isInstance(next)) {
+            throw new IllegalArgumentException("Can't find text for " + next);
+        }
+        return DomNode.class.cast(next).asText();
+    }
+
+    private WebClient newWebClient() {
+        final WebClient webClient = new WebClient();
+        webClient.getOptions().setJavaScriptEnabled(false);
+        webClient.getOptions().setCssEnabled(false);
+        webClient.getOptions().setAppletEnabled(false);
+        return webClient;
+    }
+
+    @Deployment(testable = false)
+    public static Archive<?> war() {
+        final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "batchee-gui.war")
+            .addAsWebInfResource(new StringAsset(
+                Descriptors.create(WebAppDescriptor.class)
+                    .metadataComplete(true)
+                    .createListener()
+                        .listenerClass(CreateSomeJobs.class.getName())
+                    .up()
+                    .createFilter()
+                        .filterName("JBatch Private Filter")
+                        .filterClass(JBatchServletInitializer.PrivateFilter.class.getName())
+                    .up()
+                    .createServlet()
+                        .servletName("JBatch")
+                        .servletClass(JBatchController.class.getName())
+                        .loadOnStartup(1)
+                    .up()
+                    .createFilterMapping()
+                        .filterName("JBatch Private Filter")
+                        .urlPattern("/*")
+                    .up()
+                    .createServletMapping()
+                        .servletName("JBatch")
+                        .urlPattern("/jbatch/*")
+                    .up()
+                    .exportAsString()), "web.xml")
+            // GUI
+            .addPackages(true, JBatchController.class.getPackage())
+            // test data to create some job things to do this test
+            .addPackage(CreateSomeJobs.class.getPackage())
+            .addAsWebInfResource("META-INF/batch-jobs/init.xml", "classes/META-INF/batch-jobs/init.xml");
+
+        for (final String resource : Arrays.asList("layout.jsp", "jobs.jsp", "job-instances.jsp", "step-executions.jsp",
+                                                    "css/bootstrap.min.3.0.0.css", "js/bootstrap.min.3.0.0.js")) {
+            webArchive.addAsWebResource("META-INF/resources/internal/batchee/" + resource, "internal/batchee/" + resource);
+        }
+
+        return webArchive;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/util/CreateSomeJobs.java
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/util/CreateSomeJobs.java b/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/util/CreateSomeJobs.java
new file mode 100644
index 0000000..3896e4a
--- /dev/null
+++ b/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/util/CreateSomeJobs.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.batchee.servlet.util;
+
+import org.apache.batchee.util.Batches;
+
+import javax.batch.operations.JobOperator;
+import javax.batch.operations.NoSuchJobException;
+import javax.batch.runtime.BatchRuntime;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.annotation.WebListener;
+import java.util.Properties;
+
+@WebListener
+public class CreateSomeJobs implements ServletContextListener {
+    @Override
+    public void contextInitialized(final ServletContextEvent sce) {
+        final JobOperator operator = BatchRuntime.getJobOperator();
+
+        try { // initialize only once to ensure we can use in tests ids
+            operator.getJobInstances("init", 0, 10);
+        } catch (final NoSuchJobException nsje) {
+            final Properties jobParameters = new Properties();
+            jobParameters.setProperty("test", "jbatch");
+            final long id = operator.start("init", jobParameters);
+            Batches.waitForEnd(operator, id);
+        }
+    }
+
+    @Override
+    public void contextDestroyed(final ServletContextEvent sce) {
+        // no-op
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/util/SimpleBatchlet.java
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/util/SimpleBatchlet.java b/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/util/SimpleBatchlet.java
new file mode 100644
index 0000000..afe3ddb
--- /dev/null
+++ b/gui/servlet/embedded/src/test/java/org/apache/batchee/servlet/util/SimpleBatchlet.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.batchee.servlet.util;
+
+import javax.batch.api.BatchProperty;
+import javax.batch.api.Batchlet;
+import javax.inject.Inject;
+
+public class SimpleBatchlet implements Batchlet {
+    @Inject
+    @BatchProperty
+    private String value;
+
+    @Inject
+    @BatchProperty
+    private String sleep;
+
+    private volatile boolean stopped = false;
+
+    @Override
+    public String process() throws Exception {
+        if (value == null) {
+            value = "OK";
+        }
+        if (sleep != null) {
+            long done = 0;
+            final long max = Long.parseLong(sleep);
+            while (done < max && !stopped) {
+                Thread.sleep(1000);
+                done += 1000;
+            }
+        }
+        return value;
+    }
+
+    @Override
+    public void stop() throws Exception {
+        stopped = true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/test/resources/META-INF/batch-jobs/another-job.xml
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/test/resources/META-INF/batch-jobs/another-job.xml b/gui/servlet/embedded/src/test/resources/META-INF/batch-jobs/another-job.xml
new file mode 100644
index 0000000..7d447ea
--- /dev/null
+++ b/gui/servlet/embedded/src/test/resources/META-INF/batch-jobs/another-job.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  See the NOTICE file distributed with this work for additional information
+  regarding copyright ownership. Licensed under the Apache License,
+  Version 2.0 (the "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<job id="another-job" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
+  <step id="single-step">
+    <batchlet ref="org.apache.batchee.servlet.util.SimpleBatchlet">
+      <properties>
+        <property name="value" value="#{jobParameters['value']}"/>
+        <property name="sleep" value="#{jobParameters['sleep']}"/>
+      </properties>
+    </batchlet>
+  </step>
+</job>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/test/resources/META-INF/batch-jobs/init.xml
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/test/resources/META-INF/batch-jobs/init.xml b/gui/servlet/embedded/src/test/resources/META-INF/batch-jobs/init.xml
new file mode 100644
index 0000000..3e1140f
--- /dev/null
+++ b/gui/servlet/embedded/src/test/resources/META-INF/batch-jobs/init.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  See the NOTICE file distributed with this work for additional information
+  regarding copyright ownership. Licensed under the Apache License,
+  Version 2.0 (the "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<job id="init" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
+  <step id="step1">
+    <batchlet ref="org.apache.batchee.servlet.util.SimpleBatchlet">
+      <properties>
+        <property name="value" value="#{jobParameters['value']}"/>
+        <property name="sleep" value="#{jobParameters['sleep']}"/>
+      </properties>
+    </batchlet>
+  </step>
+</job>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/embedded/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/gui/servlet/embedded/src/test/resources/arquillian.xml b/gui/servlet/embedded/src/test/resources/arquillian.xml
new file mode 100644
index 0000000..96514c8
--- /dev/null
+++ b/gui/servlet/embedded/src/test/resources/arquillian.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<arquillian xmlns="http://jboss.org/schema/arquillian"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="http://jboss.org/schema/arquillian
+                                http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+  <container qualifier="tomcat7" default="true">
+    <configuration>
+      <property name="tomcatHome">target/tomcat7</property>
+      <property name="workDir">target/arquillian-work</property>
+      <property name="unpackArchive">true</property>
+      <property name="bindHttpPort">1234</property>
+    </configuration>
+  </container>
+</arquillian>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/pom.xml
----------------------------------------------------------------------
diff --git a/gui/servlet/pom.xml b/gui/servlet/pom.xml
index d635301..76dddc4 100644
--- a/gui/servlet/pom.xml
+++ b/gui/servlet/pom.xml
@@ -28,276 +28,10 @@
 
   <artifactId>batchee-servlet</artifactId>
   <name>BatchEE :: GUI :: Servlet</name>
-  <packaging>war</packaging>
+  <packaging>pom</packaging>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-jbatch_1.0_spec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-servlet_3.0_spec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-jaxrs_1.1_spec</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-atinject_1.0_spec</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.cxf</groupId>
-      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.batchee</groupId>
-      <artifactId>batchee-jbatch</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.shrinkwrap.descriptors</groupId>
-      <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.shrinkwrap.resolver</groupId>
-      <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.arquillian.junit</groupId>
-      <artifactId>arquillian-junit-container</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.arquillian.protocol</groupId>
-      <artifactId>arquillian-protocol-servlet</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.arquillian.container</groupId>
-      <artifactId>arquillian-tomcat-embedded-7</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.tomcat.embed</groupId>
-      <artifactId>tomcat-embed-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.tomcat.embed</groupId>
-      <artifactId>tomcat-embed-jasper</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.tomcat.embed</groupId>
-      <artifactId>tomcat-embed-logging-juli</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.eclipse.jdt.core.compiler</groupId>
-      <artifactId>ecj</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>net.sourceforge.htmlunit</groupId>
-      <artifactId>htmlunit</artifactId>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-war-plugin</artifactId>
-        <version>2.4</version>
-        <configuration>
-          <failOnMissingWebXml>false</failOnMissingWebXml>
-          <archiveClasses>true</archiveClasses>
-          <attachClasses>true</attachClasses>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <version>2.4</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test-jar</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin> <!-- use mvn tomcat7:run  -->
-        <groupId>org.apache.tomcat.maven</groupId>
-        <artifactId>tomcat7-maven-plugin</artifactId>
-        <version>2.2</version>
-        <configuration>
-          <ignorePackaging>true</ignorePackaging>
-          <path>/</path>
-          <warSourceDirectory>${project.basedir}/src/main/resources/META-INF/resources</warSourceDirectory>
-          <additionalClasspathDirs>
-            <additionalClasspathDir>${project.build.directory}/${project.build.finalName}.${project.packaging}
-            </additionalClasspathDir>
-            <additionalClasspathDir>${project.build.directory}/${project.build.finalName}-tests.${project.packaging}
-            </additionalClasspathDir>
-          </additionalClasspathDirs>
-        </configuration>
-        <dependencies>
-          <dependency>
-            <groupId>org.apache.tomcat.embed</groupId>
-            <artifactId>tomcat-embed-core</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-util</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-coyote</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-api</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-jdbc</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-dbcp</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-servlet-api</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-jsp-api</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-jasper</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-jasper-el</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-el-api</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-catalina</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-tribes</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-catalina-ha</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-annotations-api</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-juli</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.tomcat.embed</groupId>
-            <artifactId>tomcat-embed-logging-juli</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.tomcat.embed</groupId>
-            <artifactId>tomcat-embed-logging-log4j</artifactId>
-            <version>${tomcat.version}</version>
-          </dependency>
-
-          <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-atinject_1.0_spec</artifactId>
-            <version>${atinject.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-atinject_1.0_spec</artifactId>
-            <version>${atinject.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jbatch_1.0_spec</artifactId>
-            <version>${batch-api.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>com.fasterxml.jackson.jaxrs</groupId>
-            <artifactId>jackson-jaxrs-json-provider</artifactId>
-            <version>${jackson.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
-            <version>${cxf.version}</version>
-            <exclusions>
-              <exclusion>
-                <groupId>com.sun.xml.bind</groupId>
-                <artifactId>jaxb-impl</artifactId>
-              </exclusion>
-              <exclusion>
-                <groupId>org.apache.geronimo.specs</groupId>
-                <artifactId>geronimo-javamail_1.4_spec</artifactId>
-              </exclusion>
-              <exclusion>
-                <groupId>org.apache.ws.xmlschema</groupId>
-                <artifactId>xmlschema-core</artifactId>
-              </exclusion>
-              <exclusion>
-                <groupId>org.codehaus.woodstox</groupId>
-                <artifactId>woodstox-core-asl</artifactId>
-              </exclusion>
-            </exclusions>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.batchee</groupId>
-            <artifactId>batchee-jbatch</artifactId>
-            <version>${project.version}</version>
-          </dependency>
-        </dependencies>
-      </plugin>
-    </plugins>
-  </build>
+  <modules>
+    <module>embedded</module>
+    <module>webapp</module>
+  </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/src/main/java/org/apache/batchee/servlet/JBatchController.java
----------------------------------------------------------------------
diff --git a/gui/servlet/src/main/java/org/apache/batchee/servlet/JBatchController.java b/gui/servlet/src/main/java/org/apache/batchee/servlet/JBatchController.java
deleted file mode 100644
index aaab084..0000000
--- a/gui/servlet/src/main/java/org/apache/batchee/servlet/JBatchController.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.batchee.servlet;
-
-import javax.batch.operations.BatchRuntimeException;
-import javax.batch.operations.JobExecutionNotRunningException;
-import javax.batch.operations.JobOperator;
-import javax.batch.operations.NoSuchJobExecutionException;
-import javax.batch.runtime.BatchRuntime;
-import javax.batch.runtime.JobExecution;
-import javax.batch.runtime.JobInstance;
-import javax.batch.runtime.StepExecution;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-public class JBatchController extends HttpServlet {
-    private static final String DEFAULT_MAPPING_SERVLET25 = "/jbatch";
-    private static final int DEFAULT_PAGE_SIZE = 30;
-
-    public static final String FORM_JOB_NAME = "___batchee_job_name___";
-
-    private static final String EXECUTIONS_MAPPING = "/executions/";
-    private static final String STEP_EXECUTIONS_MAPPING = "/step-executions/";
-    private static final String START_MAPPING = "/start/";
-    private static final String DO_START_MAPPING = "/doStart/";
-    private static final String VIEW_MAPPING = "/view/";
-
-    private JobOperator operator;
-
-    private String context;
-    private String mapping = DEFAULT_MAPPING_SERVLET25;
-    private int executionByPage = DEFAULT_PAGE_SIZE;
-    private boolean readOnly = false;
-
-    public JBatchController mapping(final String rawMapping) {
-        this.mapping = rawMapping.substring(0, rawMapping.length() - 2); // mapping pattern is /xxx/*
-        return this;
-    }
-
-    public JBatchController executionByPage(final int byPage) {
-        executionByPage = byPage;
-        return this;
-    }
-
-    public JBatchController readOnly(final boolean readOnly) {
-        this.readOnly = readOnly;
-        return this;
-    }
-
-    @Override
-    public void init(final ServletConfig config) throws ServletException {
-        this.operator = BatchRuntime.getJobOperator();
-
-        this.context = config.getServletContext().getContextPath();
-        if ("/".equals(context)) {
-            context = "";
-        }
-
-        mapping = context + mapping;
-    }
-
-    @Override
-    protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
-        resp.setContentType("text/html");
-        resp.setCharacterEncoding("UTF-8");
-        req.setAttribute("context", context);
-        req.setAttribute("mapping", mapping);
-
-        final String path = req.getPathInfo();
-        if (path != null && path.startsWith(EXECUTIONS_MAPPING)) {
-            final String name = URLDecoder.decode(path.substring(EXECUTIONS_MAPPING.length()), "UTF-8");
-            final int start = extractInt(req, "start", -1);
-            listExecutions(req, name, executionByPage, start);
-        } else if (path != null && path.startsWith(STEP_EXECUTIONS_MAPPING)) {
-            final int executionId = Integer.parseInt(path.substring(STEP_EXECUTIONS_MAPPING.length()));
-            listStepExecutions(req, executionId);
-        } else if (path != null && path.startsWith(VIEW_MAPPING)) {
-            final String name = URLDecoder.decode(path.substring(VIEW_MAPPING.length()), "UTF-8");
-            view(req, name);
-        } else if (path != null && path.startsWith(START_MAPPING)) {
-            if (readOnly) {
-                reportReadOnly(req);
-            } else {
-                final String name = URLDecoder.decode(path.substring(START_MAPPING.length()), "UTF-8");
-                start(req, name);
-            }
-        } else if (path != null && path.startsWith(DO_START_MAPPING)) {
-            if (readOnly) {
-                reportReadOnly(req);
-            } else {
-                String name = URLDecoder.decode(path.substring(DO_START_MAPPING.length()), "UTF-8");
-                if (name.isEmpty()) {
-                    name = req.getParameter(FORM_JOB_NAME);
-                }
-
-                doStart(req, name, readProperties(req));
-            }
-        } else {
-            listJobs(req);
-        }
-
-        req.getRequestDispatcher("/internal/batchee/layout.jsp").forward(req, resp);
-    }
-
-    private void reportReadOnly(final HttpServletRequest req) {
-        req.setAttribute("view", "read-only");
-    }
-
-    private void view(final HttpServletRequest req, final String name) {
-        req.setAttribute("name", name);
-        req.setAttribute("view", "view");
-
-        // we copy the logic from jbatch module since the GUI is not (yet?) linked to our impl
-        final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
-        final String relativePath = "META-INF/batch-jobs/" + name + ".xml";
-        final InputStream stream = tccl.getResourceAsStream(relativePath);
-        if (stream == null) {
-            throw new BatchRuntimeException(new FileNotFoundException("Cannot find an XML for " + name));
-        }
-
-        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        int r;
-        try {
-            while ((r = stream.read()) != -1) {
-                baos.write(r);
-            }
-        } catch (final IOException e) {
-            throw new BatchRuntimeException(new FileNotFoundException("Cannot find an XML for " + name));
-        }
-
-        req.setAttribute("content", new String(baos.toByteArray())
-                                    .replace("&","&amp;")
-                                    .replace("<", "&lt;")
-                                    .replace(">", "&gt;")
-                                    .replace("\"", "&quot;")
-                                    .replace("'", "&apos;"));
-    }
-
-    private void doStart(final HttpServletRequest req, final String name, final Properties properties) {
-        req.setAttribute("id", operator.start(name, properties));
-        req.setAttribute("name", name);
-        req.setAttribute("view", "after-start");
-    }
-
-    private void start(final HttpServletRequest req, final String name) {
-        req.setAttribute("view", "start");
-        req.setAttribute("name", name);
-    }
-
-    private void listStepExecutions(final HttpServletRequest req, final int executionId) {
-        final List<StepExecution> steps = operator.getStepExecutions(executionId);
-        req.setAttribute("view", "step-executions");
-        req.setAttribute("steps", steps);
-        req.setAttribute("executionId", executionId);
-        req.setAttribute("name", operator.getJobExecution(executionId).getJobName());
-    }
-
-    private void listExecutions(final HttpServletRequest req, final String name, final int pageSize, final int inStart) {
-        if (!readOnly) { // can be an auto refresh asking for a stop
-            final String stopId = req.getParameter("stop");
-            if (stopId != null) {
-                try {
-                    operator.stop(Long.parseLong(stopId));
-                } catch (final NoSuchJobExecutionException nsje) {
-                    // no-op
-                } catch (final JobExecutionNotRunningException nsje) {
-                    // no-op
-                }
-            }
-        } else {
-            reportReadOnly(req);
-            return;
-        }
-
-        final int jobInstanceCount = operator.getJobInstanceCount(name);
-
-        int start = inStart;
-        if (start == -1) { // first page is last page
-            start = Math.max(0, jobInstanceCount - pageSize);
-        }
-
-        final List<JobInstance> instances = new ArrayList<JobInstance>(operator.getJobInstances(name, start, pageSize));
-        Collections.sort(instances, JobInstanceIdComparator.INSTANCE);
-
-        final Map<JobInstance, List<JobExecution>> executions = new LinkedHashMap<JobInstance, List<JobExecution>>();
-        for (final JobInstance instance : instances) {
-            executions.put(instance, operator.getJobExecutions(instance));
-        }
-
-        req.setAttribute("view", "job-instances");
-        req.setAttribute("name", name);
-        req.setAttribute("executions", executions);
-
-        int nextStart = start + pageSize;
-        if (nextStart > jobInstanceCount) {
-            nextStart = -1;
-        }
-        req.setAttribute("nextStart", nextStart);
-
-        req.setAttribute("previousStart", start - pageSize);
-
-        if (jobInstanceCount > pageSize) {
-            req.setAttribute("lastStart", Math.max(0, jobInstanceCount - pageSize));
-        } else {
-            req.setAttribute("lastStart", -1);
-        }
-    }
-
-    private void listJobs(final HttpServletRequest req) throws ServletException, IOException {
-        Set<String> names = operator.getJobNames();
-        if (names == null) {
-            names = Collections.emptySet();
-        }
-
-        req.setAttribute("view", "jobs");
-        req.setAttribute("names", names);
-    }
-
-    private static int extractInt(final HttpServletRequest req, final String name, final int defaultValue) {
-        final String string = req.getParameter(name);
-        if (string != null) {
-            return Integer.parseInt(string);
-        }
-        return defaultValue;
-    }
-
-    private static Properties readProperties(final HttpServletRequest req) {
-        final Map<String, String> map = new HashMap<String, String>();
-        final Enumeration<String> names = req.getParameterNames();
-        while (names.hasMoreElements()) {
-            final String key = names.nextElement();
-            if (FORM_JOB_NAME.equals(key)) {
-                continue;
-            }
-
-            map.put(key, req.getParameter(key));
-        }
-
-        final Properties properties = new Properties();
-        for (final Map.Entry<String, String> entry : map.entrySet()) {
-            final String key = entry.getKey();
-            if (key.startsWith("k_")) {
-                final String name = key.substring("k_".length());
-                properties.setProperty(name, map.get("v_" + name));
-            }
-        }
-        return properties;
-    }
-
-    private static class JobInstanceIdComparator implements java.util.Comparator<JobInstance> {
-        private static final JobInstanceIdComparator INSTANCE = new JobInstanceIdComparator();
-
-        @Override
-        public int compare(final JobInstance o1, final JobInstance o2) {
-            return (int) (o2.getInstanceId() - o1.getInstanceId()); // reverse order since users will prefer last first
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/src/main/java/org/apache/batchee/servlet/JBatchServletInitializer.java
----------------------------------------------------------------------
diff --git a/gui/servlet/src/main/java/org/apache/batchee/servlet/JBatchServletInitializer.java b/gui/servlet/src/main/java/org/apache/batchee/servlet/JBatchServletInitializer.java
deleted file mode 100644
index 808ed74..0000000
--- a/gui/servlet/src/main/java/org/apache/batchee/servlet/JBatchServletInitializer.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.batchee.servlet;
-
-import javax.servlet.DispatcherType;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletContainerInitializer;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.Set;
-
-public class JBatchServletInitializer implements ServletContainerInitializer {
-    public static final String ACTIVE = "org.apache.batchee.servlet.active";
-    public static final String CONTROLLER_MAPPING = "org.apache.batchee.servlet.mapping";
-    public static final String ACTIVE_PRIVATE_FILTER = "org.apache.batchee.servlet.filter.private";
-    public static final String BY_PAGE = "org.apache.batchee.servlet.pagination";
-
-    private static final String DEFAULT_MAPPING = "/jbatch/*";
-
-    @Override
-    public void onStartup(final Set<Class<?>> classes, final ServletContext ctx) throws ServletException {
-        final String active = ctx.getInitParameter(ACTIVE);
-        if (active != null && !Boolean.parseBoolean(active)) {
-            return;
-        }
-
-        String mapping = ctx.getInitParameter(CONTROLLER_MAPPING);
-        if (mapping == null) {
-            mapping = DEFAULT_MAPPING;
-        } else if (!mapping.endsWith("/*")) { // needed for the controller
-            mapping += "/*";
-        }
-
-        String byPage = ctx.getInitParameter(BY_PAGE);
-        if (byPage == null) {
-            byPage = "30";
-        } else {
-            byPage += byPage;
-        }
-
-        ctx.addServlet("JBatch Servlet", new JBatchController()
-                                            .readOnly(isReadOnly(ctx.getClassLoader()))
-                                            .mapping(mapping)
-                                            .executionByPage(Integer.parseInt(byPage)))
-                                            .addMapping(mapping);
-
-        final String activePrivateFilter = ctx.getInitParameter(ACTIVE_PRIVATE_FILTER);
-        if (activePrivateFilter == null || Boolean.parseBoolean(activePrivateFilter)) {
-            ctx.addFilter("JBatch Private Filter", PrivateFilter.class)
-                .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), false, "/*");
-        }
-    }
-
-    private static boolean isReadOnly(final ClassLoader classLoader) {
-        try {
-            return Collections.list(classLoader.getResources("META-INF/batch-jobs")).isEmpty();
-        } catch (final IOException e) {
-            return false;
-        }
-    }
-
-    public static class PrivateFilter implements Filter {
-        @Override
-        public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
-            if (HttpServletRequest.class.isInstance(request) && HttpServletResponse.class.isInstance(response)) {
-                final HttpServletRequest httpServletRequest = HttpServletRequest.class.cast(request);
-                final String requestURI = httpServletRequest.getRequestURI();
-                if (requestURI.contains("/internal/batchee") && requestURI.endsWith("jsp")) {
-                    HttpServletResponse.class.cast(response).sendError(HttpURLConnection.HTTP_NOT_FOUND);
-                    return;
-                }
-            }
-
-            chain.doFilter(request, response);
-        }
-
-        @Override
-        public void init(final FilterConfig filterConfig) throws ServletException {
-            //no-op
-        }
-
-        @Override
-        public void destroy() {
-            // no-op
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/src/main/java/org/apache/batchee/servlet/MetricsHelper.java
----------------------------------------------------------------------
diff --git a/gui/servlet/src/main/java/org/apache/batchee/servlet/MetricsHelper.java b/gui/servlet/src/main/java/org/apache/batchee/servlet/MetricsHelper.java
deleted file mode 100644
index ac2dee2..0000000
--- a/gui/servlet/src/main/java/org/apache/batchee/servlet/MetricsHelper.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.batchee.servlet;
-
-import javax.batch.runtime.Metric;
-
-public final class MetricsHelper {
-
-    private MetricsHelper() {
-        // private utility class ct
-    }
-
-    public static String toString(final Metric[] metrics) {
-        final StringBuilder builder = new StringBuilder();
-        final int length = metrics.length;
-        if (metrics != null && length > 0) {
-            for (int i = 0; i < length; i++) {
-                builder.append(metrics[i].getType().name().replace("_COUNT", "")).append(" = ").append(metrics[i].getValue());
-                if (i < length - 1) {
-                    builder.append(", ");
-                }
-            }
-        }
-        return builder.toString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/src/main/java/org/apache/batchee/servlet/StatusHelper.java
----------------------------------------------------------------------
diff --git a/gui/servlet/src/main/java/org/apache/batchee/servlet/StatusHelper.java b/gui/servlet/src/main/java/org/apache/batchee/servlet/StatusHelper.java
deleted file mode 100644
index dbc77c0..0000000
--- a/gui/servlet/src/main/java/org/apache/batchee/servlet/StatusHelper.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.batchee.servlet;
-
-import javax.batch.runtime.BatchStatus;
-
-public final class StatusHelper {
-    private StatusHelper() {
-        // no-op
-    }
-
-    public static String statusClass(final BatchStatus status) {
-        if (BatchStatus.COMPLETED.equals(status)) {
-            return "success";
-        }
-        if (BatchStatus.FAILED.equals(status)) {
-            return "danger";
-        }
-        if (BatchStatus.STARTED.equals(status) || BatchStatus.STARTING.equals(status)) {
-            return "active";
-        }
-        if (BatchStatus.STOPPED.equals(status) || BatchStatus.STOPPING.equals(status) || BatchStatus.ABANDONED.equals(status)) {
-            return "warning";
-        }
-        return ""; // shouldn't occur
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/d91a56a1/gui/servlet/src/main/resources/META-INF/resources/internal/batchee/after-start.jsp
----------------------------------------------------------------------
diff --git a/gui/servlet/src/main/resources/META-INF/resources/internal/batchee/after-start.jsp b/gui/servlet/src/main/resources/META-INF/resources/internal/batchee/after-start.jsp
deleted file mode 100644
index ccb13b5..0000000
--- a/gui/servlet/src/main/resources/META-INF/resources/internal/batchee/after-start.jsp
+++ /dev/null
@@ -1,20 +0,0 @@
-<%@ page import="java.net.URLEncoder" %>
-<%--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
---%>
-<%@ page session="false" %>
-
-<p>Started job instance <%= request.getAttribute("id") %> of batch <%= request.getAttribute("name") %></p>