How to use SMS FoxBox messages inside your JSP application

Learn how to develop a JSP script that read messages from XML file of SMS FoxBox

 

As explained in the tutorial "How to perform custom actions on

incoming or outgoing SMS messages" the XML transformation script is an action activated by uncommenting the following lines from Event Handler.

#Save messages in XML format
#if [ "$1" = "RECEIVED" ]; then
#/etc/sms/scripts/sms2xml $1 $2 $3
#fi

To activate de-activate the module you have always to remember to remove/add the # sharp character.

In this example we are going to use the standard library of JSP, the jstl 1.1 and jstl 1.2 library

The JSP page will be like this:



With this script we "import" sms.xml and sms.xsl and we apply the XSL style on XML.



XSL transformation



The script is working from Tomcat 4 (jsp 1.1) and later with standad jsp library.