[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Images from a JSP and Tomcat 4.1 app not appearing at login screen when taken to Tomcat 5.5.x

Asked by rosspg in Java Server Pages (JSP)

Tags: tomcat

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.jsp

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_swapImgRestore()" onMouseOver="MM_swapImage('menu_programs','','<%= contextPath %>/images/menu_programs_over.gif',1)"><img src="<%= contextPath %>/images/menu_programs.gif" name="menu_programs" width="90" height="72" border="0"></a></td>
    <td width="90"><a href="processes" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('menu_processes','','images/menu_processes_over.gif',1)"><img 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:&nbsp;</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:&nbsp;</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-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>user</role-name>
    </auth-constraint>

  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Sample DB Application</realm-name>
    <form-login-config>
      <form-login-page>/login.jsp</form-login-page>              
      <form-error-page>/loginError.html</form-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
[+][-]05/20/05 12:40 PM, ID: 14048376Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05/20/05 12:52 PM, ID: 14048471Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/20/05 03:40 PM, ID: 14049584Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05/22/05 12:01 PM, ID: 14056223Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05/23/05 03:13 AM, ID: 14058910Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/23/05 07:36 AM, ID: 14060528Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/23/05 08:16 AM, ID: 14060901Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Java Server Pages (JSP)
Tags: tomcat
Sign Up Now!
Solution Provided By: bloodredsun
Participating Experts: 3
Solution Grade: A
 
[+][-]05/23/05 08:47 AM, ID: 14061226Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/23/05 01:33 PM, ID: 14063562Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/24/05 07:34 AM, ID: 14068751Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/25/05 08:19 AM, ID: 14078299Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89