DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

A Spark Job Runner in Web Browser


I wrote a Spark script. Now I need adding a web interface for it. Thus users can input parameters of the script in web browser, run the script, and see the calculation results in browser.

JEE

Download apache tomcat 7.0.56 core (apache-tomcat-7.0.56.tar.gz) and extract it to ~/apps;

Download Eclipse IDE for Java EE Developers (eclipse-jee-luna-SR1-linux-gtk-x86_64.tar.gz) and extract it to ~/apps;

Start Eclipse IDE for Java EE Developers, build a new Web project: [File -> New -> Web -> Dynamic Web Project];

Specify "Project" as "SparkRunner", "Target runtime" as "Apache Tomcat v7.0". If the default runtime has not existed yet, build a new one: Type of runtime environment: Apache -> Apache Tomcat v7.0). Check "Generate web.xml deployment descriptor" at the last step and click "Finish".

Add the following texts into "web-app" of web.xml under $PROJECT_HOME/WebContent/WEB-INF:

<servlet>
    <servlet-name>JobRunner</servlet-name>
    <servlet-class>com.boco.dm.JobRunner</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>JobRunner</servlet-name>
    <url-pattern>/JobRunner</url-pattern>
</servlet-mapping>

Ref:

The Deployment Descriptor: web.xml



Published

Oct 27, 2014

Last Updated

Oct 27, 2014

Category

Tech

Tags

  • jee 1
  • shell 46
  • spark 21
  • web 16

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor