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