Mumps (A.K.A. "M") has been, and still is, the basis
for many data processing applications. M is well known, at least
amongst the "Mumpsters", as a rapid development and high performance
environment. Despite that, there is no standard way to develop web
applications over M, And this is where MJSP gets
MJSP is a custom JSP
tag library, that enables interaction between web interfaces, developed
tags can be used in a JSP page, to:
- Set M variables. All the HTTP request parameters are
accessible to the M code, as well.
- Print M expressions.
- Execute M code.
- Branch and loop (If and While) over M expressions.
- Get tabular data from M application and iterate over
- Manage user sessions, that are shared amongst JSP and
M, for stateful web applications.
more dynamic application. This is done using a client side invisible
Applet that communicates with a Servlet over HTTP(S). The M code that
are automatically passed to the M code.
The library was designed with two main considerations:
- Performance. Connection to M are
pooled with full control over the number of active, idle and maximum
connections. Pooling is done using Jakarta commons-pool.
code. Connections to M are made either by M-interpreter child process,
or by TELNETing to a machine with a user/password combination,
expecting the M-interpreter prompt.
- Portability. Written in Java, MJSP
can run on any J2EE implementation (We use Apache Tomcat). MJSP
was designed for maximal M portability, with a tiny and simple M code,
that can be easily run on any "standard" M.
The software requirements for MJSP are a servlet
container that supports the JavaServer Pages Specification, version 1.1
(We use Apache Tomcat
5.5.27), and M (We use Cache').
You can get the binary distribution, or the source
distribution from the project
page at Sourceforge. To build MJSP use Apache Ant. Run the command ant
in the top level directory.
Now, you can install MJSP:
- Import the routines in mumps/mumps.ro to M. MJSP uses
"%" routines, so use the %RI command (or whatever import utility you
use) to import them to the correct namespace (UCI, directory, ...).
- Deploy the examples WAR
file (mumps-examples.war, you can deploy it with another
the web applications directory ($CATALINA_HOME/webapps/ in Tomcat). You
can put your JSP files under the directory mumps-examples/ and remo the
images/ and jsp/ directories.
- To install these docs, deploy the docs WAR file: mumps-doc.war.
The configuration file is called mserver.properties,
and should be in the application's classpath; Put it in
WEB-INF/classes/ directory of the application. Use the template file
and edit it. The one thing you should probably change in the M
connection method. You have two options:
- M child process. Set the property child_proc.command
to the command line to run M interpreter that runs the routine ^%ZCAVJSP.
The Cache' Linux/UNIX command would be cache ^%ZCAVJSP. Use
this method if app server and M are on the same machine. It's faster
- Over TELNET. In this method M connections are
over TELNET with a user/password@machine combination. You should
arrange that once the user is logged in ^%ZCAVJSP will be
- In Linux/UNIX you should do it in a startup
script (e.g. put the line cache ^%ZCAVJSP in the .login
- In Cache' on Windows, create a user with a
startup routine ^%ZCAVJSP
To get started with MJSP, I suggest going through all
Note that you can read the source in each examples. You'll find useful
tips in the the comments.
For reference, use the taglib
API documentation .
TBD: Tips on correct MJSP programming, frequent mistakes
and problems, and perhaps a tutorial.
- Runs on Windows Cache'.
- Supports alpha-numeric session IDs.
- <m:serverExec> tag enhancements:
- Does not require JRE on client. It uses
- Can pass only the current form field (handy
in big forms).
- Support other form fields (radio
- Suppress client side caching of server
- Support line breaks in M commands.
- Filter out NULL characters (0) on stream read
- <m:getColumn> tag supports not setting M
side variable, for performance.
- <m:serverExec> tag bug fixes:
- Encode parameter using encodeURIComponent(),
to support '+' signs in field value.
- Don't pass values of nameless fields.
- Gracefully handle empty server response.
- Log the pool state when borrowing a session
- Works in Tomcat 5.5
- Added <m:get> tag.
- Added M sessions pool status servlet, called /mserverStatus
- Bug fixes:
- Pass request body to M array %BODY
- Fixed session leak in the case of unhandled
exception within the <m:session> tag body.
Q: I know Intersystem's
CSP and M/Gateway
m_php. Why does the world need another M web scripting interaction
A: I was expecting that one, so it's
gonna be easy:
- Portability: MJSP was designed to
different M implementations.The M code is slim and plain. MJSP
interacts with M interpreter directly, to avoid usage of M socket and
other non-standard features. Other solutions support Cache' only.
- Performance and scalability: With MJSP
you can set the number of active and idle M connection in a connection
pool. You can have one J2EE application server interacting with many M
servers, or many application servers interacting with one M server.
- Simplicity: MJSP taglib was designed
to keep the web development clean and minimal. Just take a a look at
the examples page.
- Open source: MJSP is open-source. It
that not only you can use it for free, you can see the code, learn from
it, and modify it to fit you needs.
Q: What do I need, in order to develop
A: Follow the installation notes, to
install it over J2EE appserver and M. To develop, use your favorite web
development tool ('vi' would qualify...) . Most of them support JSP. If
you tool support custom tag library import, import the MJSP
taglib file: mumps/taglibs-mumps.tld.
Cav Systems is an
Israeli enterprise software house (ERP, banking, tourism), established
in 1979. Throughout the years all the core data processing applications
were developed by Cav on M, and deployed on different M
implementations. Cav Systems has always strived to use cutting edge,
open standards, and in the past 10 years has adopted the Java
technology for the complementary software and infrastructure, such as
GUI clients, portals and Jumps - an automated migration tool from M to
Java and RDBMS.
MJSP was developed by Yishai Pinchover
and Uri Schor, two members of Cav's R&D team.