Excerpt | ||
---|---|---|
| ||
JAR Libraries |
The two MIT custom created/maintained JARs are:
- mortar
- sap2java
Occasionally problems are found within the code associated with one of these JARs and it must be replaced. This is often done by simply deleting the jar from your applications WebContent/WEB-INF/lib folder and copying the corrected jar from the dist folder of either mortar or sap2java and placing it into your project's WebContent/WEB-INF/lib folder.
...
mortar
Mortar contains common code needed by our SAP web apps. All of your actions should be subclasses of SAPBaseAction whose code you can access via Open Declaration -> Attach Source... (see attach source).
A number of useful session attributes are set via mortar. Your actions can access these session attributes with the following code:
String usefulAttribute = (String)request.getSession().getAttribute(GlobalKeys.xxx);
where xxx is one of the following constants:
- CERT (base64EncodedCert)
- USERNAME (Users Full Name taken from their certificate)
- KERBID (Users Kerberos Principle taken from their certificate)
- SAP_SYSTEM_ID (e.g., SF2, SF5, etc)
- WAS_SYSTEM_ID (e.g., J02?)
- WAS_HOST (e.g., insidemit-apps-dev)
- USER_HOME (Where restart should go to)
Mortar 4.10 and above also handles search help which means search help can be implemented on any web page using the tag library searchhelp.tld without any additional code. See the Search Help section on the Development Framework page.
Mortar also handles all the SAP connections and, in particular, any RFC error messages.
sap2java
See sap2java under tools for a definition of what it is. See FAQ for how to use it to generate proxies.Sap2java provides a developer-friendly API for working with SAP Java Connector (JCo). It is also the wizard we use to build proxies based on the SAP RFCs (see tools). Occasionally we find problems with this open source project which require coding changes which means this JAR must be replaced if your project needs to coding change. When the change is to the data mapping, it affects both the API code used by the baseAction (edu.mit.mortar.controller.action.SAPBaseAction) and the wizard that creates the proxies.