To configure iASP with Tomcat on Mac OS 8.x or 9.x, follow the instructions below:
- Make sure Tomcat can run on Mac OS 8.x or 9.x. For information on
setting up a Tomcat server on OS 8.x or 9.x, please see
http://www.rainwatersoft.com/java4u/tomcat_on_macintosh/index.html
- Open <tomcat_home>/conf/server.xml
file, and change
<Context path=""
docBase=="webapps/ROOT"
debug="0"
reloadable="true" >
</Context>
into
<Context path=""
docBase=<iasp_home>
debug="0"
reloadable="true" >
</Context>
Note: The context path must be empty. In other words, iASP must
work with document-root, otherwise, iASP can't work, because the
org.apache.tomcat.core.Context.getRealPath can't work on Mac OS
8.x or 9.x.
- Create a directory named WEB-INF under <iasp_home>, and copy
web.xml to WEB-INF directory from <Tomcat>/webapp/examples/WEB-INF/.
The web.xml should contain the following context:
<web-app>
<servlet>
<servlet-name>
Dispatcher.DispatcherServlet
</servlet-name>
<servlet-class>
Dispatcher.DispatcherServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
Dispatcher.DispatcherServlet
</servlet-name>
<url-pattern>
*.asp
</url-pattern>
</servlet-mapping>
</web-app>
for example: there is a web.xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>
Dispatcher.DispatcherServlet
</servlet-name>
<servlet-class>
Dispatcher.DispatcherServlet
</servlet-class>
<servlet-name>
snoop
</servlet-name>
<servlet-class>
SnoopServlet
</servlet-class>
<!--
<init-param>
<param-name>foo</param-name>
<param-value>bar</param-value>
</init-param>
-->
</servlet>
<servlet>
<servlet-name>
servletToJsp
</servlet-name>
<servlet-class>
servletToJsp
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
Dispatcher.DispatcherServlet
</servlet-name>
<url-pattern>
*.asp
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>
snoop
</servlet-name>
<url-pattern>
/snoop
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>
snoop
</servlet-name>
<url-pattern>
*.snp
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>
servletToJsp
</servlet-name>
<url-pattern>
/servletToJsp
</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>
http://java.apache.org/tomcat/examples-taglib
</taglib-uri>
<taglib-location>
/WEB-INF/jsp/example-taglib.tld
</taglib-location>
</taglib>
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
<url-pattern>/jsp/security/protected/*</url-pattern>
<!-- If you list http methods, only those methods are protected
-->
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<!-- Anyone with one of the listed roles may access this area
-->
<role-name>tomcat</role-name>
<role-name>role1</role-name>
</auth-constraint>
</security-constraint>
<!-- Default login configuration uses BASIC authentication -->
<!--
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Example Basic Authentication Area</realm-name>
</login-config>
-->
<!-- Form-based login is enabled by default. If you wish to
try Basic authentication, comment out the <login-config>
section below and uncomment the one above. -->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Example Form-Based Authentication
Area</realm-name>
<form-login-config>
<form-login-page>/jsp/security/login/login.jsp</form-login-page>
<form-error-page>/jsp/security/login/error.jsp</form-error-page>
</form-login-config>
</login-config>
</web-app>
- Set the all jars of iASP to the classpath panel of 'JBindery' which
run the Tomcat.
- Start Tomcat and verify iASP with http://host-ip:tomcat-port/.
If you encounter any problems or errors, please contact support@halcyonsoft.com
|