This app uses Form login and is still using a version 2.3 web.xml with the Tomcat 5.5.x container and Java 1.5. The behavior under Tomcat 4.1 and Java 1.4 is normal. The app's login portion, along with the image references, were designed around early year 2000 or thereabouts. It does not use any includes. Assuming the context is named "sample", under both versions (when the login is named login.jsp versus login.html) the context displays as /sample. Images will only show if they are prefaced with <%= contextPath %>/images/sample.jpg versus "images/sample.jpg" under Tomcat 4.1. In the latter case, the image appears in the Dreamweaver environment...when using contextPath, it does not...although it does resolve correctly under both versions of Tomcat in the browser.
When login is completed, the first page it takes you to is
http://localhost/sample/home/user/images/menu_processes_over.gif (of which it informs you that the image does not exist. If you do copy the images to that directory, you merely see the image and not the page that the user should be directed to...under Tomcat 4.1 it takes you to /sample/home/user/index.js
p
Below is a snippet from the code of the login screen. With this example, the second image (menu_processes) does not display properly under Tomcat 5.1, and whether or not I have the contextPath included it takes you to the same wrong page after logging in.
<td width="90"><a href="programs" onMouseOut="MM_swapImgRest
ore()" onMouseOver="MM_swapImage(
'menu_prog
rams','','
<%= contextPath %>/images/menu_programs_ov
er.gif',1)
"><img src="<%= contextPath %>/images/menu_programs.gi
f" name="menu_programs" width="90" height="72" border="0"></a></td>
<td width="90"><a href="processes" onMouseOut="MM_swapImgRest
ore()" onMouseOver="MM_swapImage(
'menu_proc
esses','',
'images/me
nu_process
es_over.gi
f',1)"><im
g src="images/menu_processes
.gif" name="menu_processes" width="90" height="72" border="0"></a></td>
</tr>
</table>
<!-- #EndLibraryItem -->
The form is as follows:
<form name="login" method="post" action="j_security_check">
<table>
<tr>
<td width="250" valign="middle">
<table cellpadding="0" cellspacing="0" border="0" width="250">
<tr>
<th width="100" align="right">Username:&nb
sp;</th>
<td width="150" align="right">
<input type="text" name="j_username" size="16" maxlength="16" style="width: 100%;">
</td>
</tr>
<tr>
<th width="100" align="right">Password:&nb
sp;</th>
<td width="150" align="right">
<input type="password" name="j_password" size="16" maxlength="16" style="width: 100%;">
</td>
</tr>
<tr><td colspan="2" align="right"><input type="submit" value="Login"></td></tr>
</table>
</td>
<td width="300" valign="top" style="padding: 0px 18px;">
You must login to access this site. If you would like to request access, please go to
the <a href="register.jsp">New User Sign Up</a> page.
</td>
</tr>
</table>
</form>
I would appreciate any help, as I have tried numerous permutations and workarounds short of upgrading the web.xml to the 2.4 spec. Also, /home/user/* is constrained as follows in web.xml:
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"
http://java.sun.com/dtd/web-app_2_3.dtd">
<security-constraint>
<web-resource-collection>
<web-resource-name>Ingalls
Personalized User Pages</web-resource-name>
<url-pattern>/home/user/*<
/url-patte
rn>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name
>
</auth-constraint>
<login-config>
<auth-method>FORM</auth-me
thod>
<realm-name>Sample DB Application</realm-name>
<form-login-config>
<form-login-page>/login.js
p</form-lo
gin-page>
<form-error-page>/loginErr
or.html</f
orm-error-
page>
</form-login-config>
</login-config>
<security-role>
<description>Standard User</description>
<role-name>user</role-name
>
</security-role>
(** note that the login was originally login.html and it thus had no scriptlets in that version. However, the image issue is consistent whether it is login.jsp or login.html for the lines not using the scriptlet for contextPath **)
Thanks,
Ross