Sumo: An Authenticating Web Application with an Embedded R









Untitled

JSP i. About the Tutorial. Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic platform-independent method 
jsp tutorial


JSP File Uploading

A JSP can be used with an HTML form tag to allow users to upload files to the server. You can download it from http://commons.apache.org/io/.
jsp file uploading


Developing Web Applications Servlets

https://docs.oracle.com/cd/E12839_01/web.1111/e13712.pdf


Developing XML Solutions with JavaServer Pages Technology

lar as part of the Java software environment
jspxml






O'Reilly - JavaServer Pages 3rd Edition

You can download the Tomcat server in binary format or as source code that you compile yourself. If you're primarily interested in learning about JSP 


Sumo: An Authenticating Web Application with an Embedded R

Servlet and Java Server Pages (JSP) specifications 3Command to start R is configurable in the file 'sumo.xml'. ... org/doc/Rnews/Rnews_2003-3.pdf.
RJ


15415 Recitation Homework 9 Building Enterprise Web Application

Mar 27 2012 using JSP. 2 phases ... Server newcastle.db.cs.cmu. edu hw7 database. Client. Browser ... JSP is being turned into a Java file
recitation slides





JavaServer Pages™ (JSP™) v1.2 Syntax Reference

Aug 30 1999 Forwards a request to an HTML file
syntaxref


MEDICAL DEVICE AND HEALTH IT JOINT SECURITY PLAN

Jan 4 2019 JSP framework in Section VII of this document. ... direct download from the third-party that provides the product or.
HSCC MEDTECH JSP v


213410 Sumo: An Authenticating Web Application with an Embedded R

60 CONTRIBUTEDRESEARCHARTICLESSumo: An Authenticating Web

Application with an Embedded R Session

by Timothy T. Bergsma and Michael S. Smith

AbstractSumo is a web application intended

as a template for developers. It is distributed as a Java 'war" file that deploys automatically when placed in a Servlet container"s 'webapps" directory. If a user supplies proper credentials,

Sumo creates a session-specific Secure Shell con-

nection to the host and a user-specific R session over that connection. Developers may write dy- namic server pages that make use of the persis- tent R session and user-specific file space. The supplied example plots a data set conditional on preferencesindicatedby theuser; italsodisplays some static text. A companion server page al- lows the user to interact directly with the R ses- sion. Sumo"s novel feature set complements pre- vious efforts to supply R functionality over the internet. Despite longstanding interest in delivering R func- tionality over the internet (

Hornik

2011
), embed- ding R in a web application can still be technically challenging. Anonymity of internet users is a com- pounding problem, complicating the assignment of persistent sessions and file space. Sumo uses Java servlet technology to minimize administrative bur- den and requires authentication to allow unambigu- ous assignment of resources. Sumo has few depen- dencies and may be readily adapted to create other applications.

Deployment

Use of Sumo requires an internet server with the fol- lowing: users with passwor dedaccounts (Sumo defers to the server for all authentication) a system-wide installation of R ( http://cran. r-project.org) a r unninginstance of a Java servlet container , e.g. Tomcat 6 (http://tomcat.apache.org)

Secur eShell

1, e.g. OpenSSH (http://www.

openssh.com) or freeSSHd (http://www. freesshd.com) for Windows.

Tomcat, thereferenceimplementationfortheJava

Servlet and Java Server Pages (JSP) specifications,is widely available and surprisingly easy to install.

While frequently run behind Apache (http://www.

apache.org), it can function as a stand-alone web server. In our experience, it requires mere minutes to install under Linux (Ubuntu) or Mac OS X, and a little longer to install for Windows. Tomcat is open source.

Sumo is maintained athttp://sumo.googlecode.

comand is distributed under the GPL v3 open source license as a Java 'war" file. The current distribution, considered complete, is 'sumo-007.war" as of this writ- ing. It can be downloaded, optionally renamed (e.g. 'sumo.war"), and saved in Tomcat"s 'webapps" direc- tory. Tomcat discovers, installs, and launches the web application. By default, Tomcat listens on port

8080. The application can be accessed with a web

browser, e.g. athttp://localhost:8080/sumo.request authorize monitorevaluatelogoutlogin decorate linkinclude includeinclude linklinkfail form formredirectsucceedfailFigure 1: Sumo architecture: flow control among page requests. Solid boxes: visible JSPs. Dashed boxes: JSPs with no independent content.

Architecture

An http request for the web application Sumo de-

faults to the 'login.jsp" page (Figure1 ). Tomcat cre- ates a Java servlet session for the particular connec- tion. 'login.jsp" forwards the supplied credentials to a servlet (not shown) that tries to connect to the lo- cal host

2using Secure Shell. If successful, it immedi-

ately opens an R session usingR --vanilla3, stores pointers to the R session, and forwards the user to 'evaluate.jsp": the core of the application (see Fig- ure 2 ). The only other viewable page is 'monitor.jsp",1

OS X includes OpenSSH. Check the box: System Preferences|Sharing|remote login. In '/etc/sshd_config", add "PasswordAuthentica-

tion yes". With freeSSHd for Windows, uncheck: settings|SSH|Use new console engine.

2Host is configurable in the file 'sumo.xml".

3Command to start R is configurable in the file 'sumo.xml".

The R Journal Vol. 4/1, June 2012 ISSN 2073-4859

CONTRIBUTEDRESEARCHARTICLES61which allows direct interaction with the R command line (Figure 3 ).Figure 2: Sumo display: sample output of 'evaluate.jsp".Figure 3: Sumo display: sample output of 'monitor.jsp".Both 'evaluate.jsp" and 'monitor.jsp" use op- tional Sitemesh technology (http://www.sitemesh. org) to include 'decorate.jsp", which itself in- cludes the header, the footer, and navigation links to 'evaluate.jsp", 'monitor.jsp", and 'logout.jsp". 'decorate.jsp" also includes 'authorize.jsp", which redi- rects to 'login.jsp" for non-authenticated requests. Thus decorated, 'evaluate.jsp" and 'monitor.jsp" always include links to each other and are only available to authenticated users.

The key to embedding R in Sumo is the ex-

change of information between the Java session and the R session. The exchange occurs primarily in 'evaluate.jsp". Similar to Sweave (Leisch,2002 ), Java

Server Pages support alternation between two lan-

guages: in this case, html and Java. The R session can be accessed using either language. With respect to Java, 'evaluate.jsp" defines a reference to an object calledRthat evaluates R code and returns a string result (with or withoutecho).

String directory = R.evaluate(

"writeLines(getwd())",false);

With respect to html, 'evaluate.jsp" includes

Sumo"s RTags library (a JSP Tag Library), which al- lows blocks of R code to be inserted directly within html-like tags. taglib prefix="r" uri="/WEB-INF/RTags.tld" library(lattice)

Theoph$all <- 1

  head(Theoph) 
	 

60 CONTRIBUTEDRESEARCHARTICLESSumo: An Authenticating Web

Application with an Embedded R Session

by Timothy T. Bergsma and Michael S. Smith

AbstractSumo is a web application intended

as a template for developers. It is distributed as a Java 'war" file that deploys automatically when placed in a Servlet container"s 'webapps" directory. If a user supplies proper credentials,

Sumo creates a session-specific Secure Shell con-

nection to the host and a user-specific R session over that connection. Developers may write dy- namic server pages that make use of the persis- tent R session and user-specific file space. The supplied example plots a data set conditional on preferencesindicatedby theuser; italsodisplays some static text. A companion server page al- lows the user to interact directly with the R ses- sion. Sumo"s novel feature set complements pre- vious efforts to supply R functionality over the internet. Despite longstanding interest in delivering R func- tionality over the internet (

Hornik

2011
), embed- ding R in a web application can still be technically challenging. Anonymity of internet users is a com- pounding problem, complicating the assignment of persistent sessions and file space. Sumo uses Java servlet technology to minimize administrative bur- den and requires authentication to allow unambigu- ous assignment of resources. Sumo has few depen- dencies and may be readily adapted to create other applications.

Deployment

Use of Sumo requires an internet server with the fol- lowing: users with passwor dedaccounts (Sumo defers to the server for all authentication) a system-wide installation of R ( http://cran. r-project.org) a r unninginstance of a Java servlet container , e.g. Tomcat 6 (http://tomcat.apache.org)

Secur eShell

1, e.g. OpenSSH (http://www.

openssh.com) or freeSSHd (http://www. freesshd.com) for Windows.

Tomcat, thereferenceimplementationfortheJava

Servlet and Java Server Pages (JSP) specifications,is widely available and surprisingly easy to install.

While frequently run behind Apache (http://www.

apache.org), it can function as a stand-alone web server. In our experience, it requires mere minutes to install under Linux (Ubuntu) or Mac OS X, and a little longer to install for Windows. Tomcat is open source.

Sumo is maintained athttp://sumo.googlecode.

comand is distributed under the GPL v3 open source license as a Java 'war" file. The current distribution, considered complete, is 'sumo-007.war" as of this writ- ing. It can be downloaded, optionally renamed (e.g. 'sumo.war"), and saved in Tomcat"s 'webapps" direc- tory. Tomcat discovers, installs, and launches the web application. By default, Tomcat listens on port

8080. The application can be accessed with a web

browser, e.g. athttp://localhost:8080/sumo.request authorize monitorevaluatelogoutlogin decorate linkinclude includeinclude linklinkfail form formredirectsucceedfailFigure 1: Sumo architecture: flow control among page requests. Solid boxes: visible JSPs. Dashed boxes: JSPs with no independent content.

Architecture

An http request for the web application Sumo de-

faults to the 'login.jsp" page (Figure1 ). Tomcat cre- ates a Java servlet session for the particular connec- tion. 'login.jsp" forwards the supplied credentials to a servlet (not shown) that tries to connect to the lo- cal host

2using Secure Shell. If successful, it immedi-

ately opens an R session usingR --vanilla3, stores pointers to the R session, and forwards the user to 'evaluate.jsp": the core of the application (see Fig- ure 2 ). The only other viewable page is 'monitor.jsp",1

OS X includes OpenSSH. Check the box: System Preferences|Sharing|remote login. In '/etc/sshd_config", add "PasswordAuthentica-

tion yes". With freeSSHd for Windows, uncheck: settings|SSH|Use new console engine.

2Host is configurable in the file 'sumo.xml".

3Command to start R is configurable in the file 'sumo.xml".

The R Journal Vol. 4/1, June 2012 ISSN 2073-4859

CONTRIBUTEDRESEARCHARTICLES61which allows direct interaction with the R command line (Figure 3 ).Figure 2: Sumo display: sample output of 'evaluate.jsp".Figure 3: Sumo display: sample output of 'monitor.jsp".Both 'evaluate.jsp" and 'monitor.jsp" use op- tional Sitemesh technology (http://www.sitemesh. org) to include 'decorate.jsp", which itself in- cludes the header, the footer, and navigation links to 'evaluate.jsp", 'monitor.jsp", and 'logout.jsp". 'decorate.jsp" also includes 'authorize.jsp", which redi- rects to 'login.jsp" for non-authenticated requests. Thus decorated, 'evaluate.jsp" and 'monitor.jsp" always include links to each other and are only available to authenticated users.

The key to embedding R in Sumo is the ex-

change of information between the Java session and the R session. The exchange occurs primarily in 'evaluate.jsp". Similar to Sweave (Leisch,2002 ), Java

Server Pages support alternation between two lan-

guages: in this case, html and Java. The R session can be accessed using either language. With respect to Java, 'evaluate.jsp" defines a reference to an object calledRthat evaluates R code and returns a string result (with or withoutecho).

String directory = R.evaluate(

"writeLines(getwd())",false);

With respect to html, 'evaluate.jsp" includes

Sumo"s RTags library (a JSP Tag Library), which al- lows blocks of R code to be inserted directly within html-like tags. taglib prefix="r" uri="/WEB-INF/RTags.tld" library(lattice)

Theoph$all <- 1

  head(Theoph)