Additions:
J2EE Session variables can be accessed and set within the invoked xmlsh script by using the [[CommandHttpsession httpsession]] command.
----
----
Deletions:
Session, page and request variables are unaccessible. In a future version I expect to add support for at least session variables.
Additions:
xslt -f /test/spl.xsl
Deletions:
Additions:
====Session Variables====
Starting with release 1.0.3 J2EE Session variables are supported via the [[CommandHttpsession httpsession]] command.
Starting with release 1.0.3 J2EE Session variables are supported via the [[CommandHttpsession httpsession]] command.
Additions:
Starting with version 1.0.3 of xmlsh all HTTP headers are passed as an XML variable "HTTP_HEADERS"
Deletions:
Additions:
<servlet-mapping>
<servlet-name>XmlshServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-name>XmlshServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Deletions:
Additions:
<security-role>
<description>xmlsh users</description>
<role-name>xmlsh</role-name>
<description>xmlsh users</description>
<role-name>xmlsh</role-name>
Deletions:
<description>xmlsh users</description>
<role-name>xmlsh</role-name>
Additions:
<security-role>
<description>xmlsh users</description>
<role-name>xmlsh</role-name>
</security-role>
<description>xmlsh users</description>
<role-name>xmlsh</role-name>
</security-role>
Additions:
Session, page and request variables are unaccessible. In a future version I expect to add support for at least session variables.
Deletions:
Additions:
<param name="keyname">
Starting with version 1.0.4 of xmlsh all HTTP headers are passed as an XML variable "HTTP_HEADERS"
<headers>
<header name="host">
<value>localhost:8280</value>
</header>
<header name="connection">
<value>keep-alive</value>
</header>
<header name="user-agent">
<value>Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1036 Safari/532.5</value>
</header>
<header name="cache-control">
<value>max-age=0</value>
</header>
<header name="authorization">
<value>Basic eG1sc2g6eG1sc2g=</value>
</header>
<header name="accept">
<value>application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</value>
</header>
<header name="accept-encoding">
<value>gzip,deflate,sdch</value>
</header>
<header name="accept-language">
<value>en-US,en;q=0.8</value>
</header>
<header name="accept-charset">
<value>ISO-8859-1,utf-8;q=0.7,*;q=0.3</value>
</header>
</headers>
<param name="foo">
<param name="spam">
For servlets hosted in Tomcat you can use tomcat's authentication like any other servlet.
For example, adding the following to the web.xml will request BASIC authentication.
<security-constraint>
<web-resource-collection>
<web-resource-name>
Entire Application
</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>xmlsh</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>XMLSH Realm</realm-name>
</login-config>
You must edit the tomcat-users.xml file to add a user for the specified realm.
Starting with version 1.0.4 of xmlsh all HTTP headers are passed as an XML variable "HTTP_HEADERS"
<headers>
<header name="host">
<value>localhost:8280</value>
</header>
<header name="connection">
<value>keep-alive</value>
</header>
<header name="user-agent">
<value>Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1036 Safari/532.5</value>
</header>
<header name="cache-control">
<value>max-age=0</value>
</header>
<header name="authorization">
<value>Basic eG1sc2g6eG1sc2g=</value>
</header>
<header name="accept">
<value>application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</value>
</header>
<header name="accept-encoding">
<value>gzip,deflate,sdch</value>
</header>
<header name="accept-language">
<value>en-US,en;q=0.8</value>
</header>
<header name="accept-charset">
<value>ISO-8859-1,utf-8;q=0.7,*;q=0.3</value>
</header>
</headers>
<param name="foo">
<param name="spam">
For servlets hosted in Tomcat you can use tomcat's authentication like any other servlet.
For example, adding the following to the web.xml will request BASIC authentication.
<security-constraint>
<web-resource-collection>
<web-resource-name>
Entire Application
</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>xmlsh</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>XMLSH Realm</realm-name>
</login-config>
You must edit the tomcat-users.xml file to add a user for the specified realm.
Deletions:
<param key="foo">
<param key="spam">
Additions:
Starting with version 1.0.3 of xmlsh any POST or QUERY parameters are passed as an XML variable "HTTP_PARAMETERS"
The format of the variable is an XML document of the form
<parameters>
<param key="keyname">
<value>value 1</value>
<value>value 2</value>
</param>
</parameters>
For example the following script for "index.xsh" in the "xmlsh" servlet
xecho $HTTP_PARAMETERS
Given the following URL
http://host:port/xmlsh?foo=bar&spam=value1&spam=value2
Results in
<parameters>
<param key="foo">
<value>bar</value>
</param>
<param key="spam">
<value>value1</value>
<value>value2</value>
</param>
</parameters>
You can configure a default index page "index.xsh" by adding this servlet mapping
<url-pattern>/</url-pattern>
This maps the root directory to the xmlsh servlet, which then looks for "index.xsh" as the default welcome file.
The format of the variable is an XML document of the form
<parameters>
<param key="keyname">
<value>value 1</value>
<value>value 2</value>
</param>
</parameters>
For example the following script for "index.xsh" in the "xmlsh" servlet
xecho $HTTP_PARAMETERS
Given the following URL
http://host:port/xmlsh?foo=bar&spam=value1&spam=value2
Results in
<parameters>
<param key="foo">
<value>bar</value>
</param>
<param key="spam">
<value>value1</value>
<value>value2</value>
</param>
</parameters>
You can configure a default index page "index.xsh" by adding this servlet mapping
<url-pattern>/</url-pattern>
This maps the root directory to the xmlsh servlet, which then looks for "index.xsh" as the default welcome file.
Additions:
The Servlet is registered using the standard WAR file structure which you must create youself.
Deletions:
Additions:
The servlet class is ""<b>org.xmlsh.servlet.XmlshServlet</b>""
There is a required servlet parameter *root* which specifies the directory where xmlsh scripts are located.
There is a required servlet parameter *root* which specifies the directory where xmlsh scripts are located.
Deletions:
Additions:
====Set up the WAR====
To create a working xmlsh servlet, a standard WAR structure needs to be created. Above is a sample web.xml, although the servlet can be configured in an existing WAR application, it need not be its own application.
The servlet class is *org.xmlsh.servlet.XmlshServlet*
All libraries (jars) required by xmlsh need to be available in the classpath for the servlet. Recommended that these get put into the WEB-INF/lib directory.
To create a working xmlsh servlet, a standard WAR structure needs to be created. Above is a sample web.xml, although the servlet can be configured in an existing WAR application, it need not be its own application.
The servlet class is *org.xmlsh.servlet.XmlshServlet*
All libraries (jars) required by xmlsh need to be available in the classpath for the servlet. Recommended that these get put into the WEB-INF/lib directory.
Additions:
====Examples====
====To Do====
Currently no arguments are passed to the servlet script. I am considering passing query args from the request as arguments to the script.
====To Do====
Currently no arguments are passed to the servlet script. I am considering passing query args from the request as arguments to the script.