m


Standard Syntax:
     <%@ taglib prefix="m" uri="http://cav.co.il/taglibs/mumps" %>

XML Syntax:
     <anyxmlelement xmlns:m="http://cav.co.il/taglibs/mumps" />

        A tag library for interacting with MUMPS
  

Tag Library Information
Display NameNone
Version1.0
Short Namem
URIhttp://cav.co.il/taglibs/mumps
 

Tag Summary
session Open a Mumps session. This tag should enclode any other MJSP tag. While inside this tag, an M connection is used to run all the enclosed MJSP tags, in the same M context, i.e. variables and locks are available between different tags. Upon closing the session tag, all locks and variables are cleared, and the M connection is released.
The following variable are set in the M context in the beggining of the session:
  • %REM - Remote address
  • %NAM - HTTP referrer (TBD)
  • %FORW - HTTP forwarded for (TBD)
  • %HTIP - Host IP
  • %RMAD - Remote address (again, for backward compatability)
  • %RMHT - Remote host
  • %COOK - Cookie
  • %PAID - TBD
  • JB - The user session id, set by m:setSessionId, if used before.
  • %ARG() - A map us the request parameters, passed in the request
setSessionId Set the user session ID into the M session. Use this tag to maintain a user sesssion between different requests. After calling it it will set the M variable "JB" and the JSP variable "_sessid" to the session ID.
set Set an M variable.
out Print an M expression.
get Get the value of an M expression into variable.
exec Execute M code.
serverExec Execute M code from javascript, on the server. The code is run in a fresh context. If in a user session (setSessionId was called before) The M variable "JB" is set in the context. This code is run through a Servlet in a secure way: Upon handling the page request the M code to run is saved in a temporary global by a long-one-time-key, which allows executing it.
if Perform body if M condition is true (non zero).
while Perform body repeatedly while M condition is true (non zero).
query Perform M query. This is the way to get tabular data from M and iterate over it (e.g. parse it into an HTML table). The output expacted from the M code is in the following format:
  • List of columns, each one in a line of the format: NAME=column_name,TYPE=column_type (type can be "E" for English, "N" for number, and "H" for Hebrew).
  • >>>DATA
  • A line for each table row with the column values separated by underscore ('_') character.
For example, to print a table with 4 columns, generate this output from the M code:
NAME=id,TYPE=N
NAME=first,TYPE=E
NAME=last,TYPE=E
NAME=address,TYPE=E
>>>DATA
1_sidney_Levy_Rechasim
2_Yishai_Pinchover_Haifa
3_Uri_Schor_Zichron Ya'akov
foreachRow Iterate M query. Must be nested within m:query tag. Whatever is enclosed in this tag will be executed repeatdly for each row.
getColumn Get a column value from the current row, in M query. This tag must be enclosed by a forechRow tag.
foreachCol Iterate M query's metadata (columns).
getHeader get a header's column, in M query. Must be enclosed by foreachCol tag.
wasEmpty Perform body if the nesting M query returned empty result set. Must be enclosed by query tag.
wasNotEmpty perform body if the nesting M query returned non empty result set. Must be enclosed by query tag.
rowCount Print the number of rows in the nesting M query. Must be enclosed by query tag.
ShowSource Copy the text specified within tag to a Writer.
 


Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-3 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.