Purpose

This webapp demonstrates creating web applications with ooRexx programs using the Java Server Page (JSP) technology with the help of Java Taglib library "ScriptTagLibs.jar". Each "helloworld" example utilizes a different attribute of that taglib library to demonstrate its purpose. Just click on the links below to run them on this Apache Tomcat server and get the program's output served to your browser.

In addition there are three ooRexx utility scripts contained together with a demonstration of its usage that could be useful in other webapps as well.

If you want to run these samples on your own computer or your own server you would need to have installed the proper software on your computer (e.g. the Apache Tomcat server and the ooRexx support, cf. Appendix: Related Resources below, and deploy the webapp archive "demoRexx.war").

Sample "Hello, World" Application to Demonstrate "ooRexx Server Pages" Using JSP

These samples demonstrate how to use the tag libraries in ScriptTagLibs.jar to run server code written in the ooRexx language. Each script will be invoked with the following three arguments: "request", "response" and "out". These arguments are also made available as implicit objects pre-registered by the script taglib.

The JSP files linked from this page excercise the scripting tag libraries in various forms. Check out the source together with the tag's attribute values and compare their behaviour and resulting HTML page.

Java Scripting Framework (JSR-223) Nutshell Samples

Press any of the below links to run the samples. In this case the standard Java scripting framework (cf. the Java package "javax.script", a.k.a. "JSR-223") gets used to execute the Rexx scripts.

Utilities

This webapp includes three Rexx programs, that can be seen as utilities that could be useful for developing webapps in general.

Utility Invocation Samples (JSR-223)

These are the three utilities meant for developing and serving webapps:

  1. code/showSource.jsp: this Rexx utility program allows to display any textfile within a jsp file.
    The link to this program was defined in HTML as <a href="code/showSource.jsp?src=code/showSource.jsp">code/showSource.jsp</a>.
  2. "code/BSF4ooRexxSetupInformation.rex": this Rexx utility program creates BSF4ooRexx related (ooRexx, BSF4ooRexx, Java settings) server setup information (useful e.g. for debugging).
  3. "code/invocationInformation.rex": this Rexx utility program queries the JSP-related implicit objects and documents each in a table. In case there are getter methods, they get run and the result is displayed. This utility may be helpful for debugging and application development. The slot argument can be used to explicitly document only those implicit objects (by supplying blank delimited names), that the developer is interested in.


Appendices

Apache BSF Versions of the Samples

Appendix: Apache Bean Scripting Framework (BSF) Nutshell Samples

Press any of the below links to run the samples. In this case the Apache "Bean Scripting Framework (BSF)" gets used to execute the Rexx scripts. (Apache BSF predates the standard Java scripting framework and has a different architecture. BSF4ooRexx can be invoked using the Apache BSF as well.)


Appendix: Apache Bean Scripting Framework (BSF) Utility Invocation Samples



Appendix: Install ooRexx Support

ooRexx (open object Rexx) is an open-source, dynamically typed, caseless, message based programming language, originally developed by IBM which handed the code over to the non-profit special interest group Rexx Language Association which open-sourced ooRexx and has been maintaining it.

Installation instructions:

  1. In order to allow JavaEE/JakartaEE servlet containers to use other languages than Java, download the ScriptTagLibs Java archive from https://sourceforge.net/projects/bsf4oorexx/files/Sandbox/rgf/taglibs/ (as of 2021-04-18 use the latest, stable beta version from https://sourceforge.net/projects/bsf4oorexx/files/Sandbox/rgf/taglibs/beta/). For JavaEE (e.g. Tomcat 9 or earlier, javax. namespace) download javax.ScriptTagLibs.jar, for JakartaEE (e.g. Tomcat 10 or later, jakarta. namespace) download jakarta.ScriptTagLibs.jar; place the Java archive in the shared library directory, e.g. in CATALINA_HOME/lib for Tomcat, then stop and restart Tomcat; alternatively in the webapp's directory WEB-INF/lib.

  2. ooRexx can be downloaded from https://sourceforge.net/projects/oorexx/ (as of 2021-04-18 use the latest, stable ooRexx 5.0 beta version which can be downloaded from https://sourceforge.net/projects/oorexx/files/oorexx/5.0.0beta/).

  3. In order to use ooRexx from Java the ooRexx/Java bridge BSF4ooRexx needs to be installed (as of 2021-04-18 get the latest, stable BSF4ooRexx beta version which can be downloaded from https://sourceforge.net/projects/bsf4oorexx/files/beta/20200928/). After installation locate the file BSF4ooRexx\bsf4ooRexx-v641-yyyymmdd-bin.jar from your CLASSPATH environment variable and copy it to the shared library directory, e.g. CATALINA_HOME/lib, then stop and restart the Web container, e.g. Tomcat. This jar file allows the Java scripting framework and Apache BSF to use ooRexx as a Java scripting language.


Rony G. Flatscher, 2020-10-29 - 2021-04-22 (Vienna/Austria, Europe)