Correction - I just tried it again with the original CCProcess.jsp, and
intentionally left errors on the form, and the log DOES indicate that
control is being forwarded to Retry.jsp (as it should).  However, the  case
still holds that when the data is correct, upon hitting the submit button,
it is logged that the form has been validated, and control is being
forwarded to Verify.jsp, and then again, according to the log both jsp's are
being loaded, yet Retry.jsp is displayed in the browser.

Log file:
2003-01-05 23:45:15 jsp: Entering CCProcess
2003-01-05 23:45:15 jsp: Error on form - forwarding to Retry.jsp
2003-01-05 23:45:15 jsp: Entering Retry.jsp - error on form
2003-01-05 23:45:20 jsp: Entering CCProcess
2003-01-05 23:45:20 jsp: Form Has Been Validated - forwarding to Verify.jsp
2003-01-05 23:45:20 jsp: Entered Verify.jsp
2003-01-05 23:45:20 jsp: Entering Retry.jsp - error on form

Thanks.
Denise
-----Original Message-----
From: Denise Mangano [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 05, 2003 11:51 PM
To: 'Tomcat Users List'
Subject: RE: Changed file name now webapp not working right


Noel,

I did as you suggested, and the strangest things are happening!!  This is my
CCProcess.jsp:

<%@ page import="java.util.*" %>
<%@ page import="com.complusdata.beans.FormBean" %>

<% log("Entering CCProcess"); %>

<jsp:useBean id="formBean" class="com.complusdata.beans.FormBean"
scope="request">
  <jsp:setProperty name="formBean" property="*"/> </jsp:useBean>

<%
   if (formBean.validate())
   {
     log("Form Has Been Validated - forwarding to Verify.jsp"); 
%>
     <jsp:forward page="/CCPayments/28/Verify.jsp"/>
<%
   }
   else
   {
     log("Error on form - forwarding to Retry.jsp");
%>
     <jsp:forward page="/CCPayments/28/Retry.jsp"/>
<%
   }
%>

I also added code to Verify.jsp to log when "Entering Verify.jsp", and code
to Retry.jsp to log when "Entering Retry.jsp - error on form".

Here is the output of my log: 

2003-01-05 22:41:49 jsp: Entering CCProcess 
2003-01-05 22:41:49 jsp: Form Has Been Validated - forwarding to Verify.jsp 
2003-01-05 22:41:50 jsp: Entering Retry.jsp - error on form 
2003-01-05 22:41:57 jsp: Entering CCProcess 
2003-01-05 22:41:57 jsp: Form Has Been Validated - forwarding to Verify.jsp 
2003-01-05 22:41:57 jsp: Entering Retry.jsp - error on form 


Now this is what I did to test.  I called my form, left two fields blank,
then submitted (form action="CCProcess.jsp").  As it should, Retry.jsp was
displayed with the appropriate error messages.  If you notice in the log, on
the call to CCProcess.jsp, "entering CCProcess" is logged.  BUT - even
though there were errors on the page, it was still written to the log that
control is being forwarded to Verify.jsp (even though it technically wasn't)
AND it does not log that control is being forwarded to Retry.jsp AND
"Entering Retry.jsp - error on form" is logged.  Then after correcting the
errors, I hit submit, and Retry.jsp is loaded again (no error messages
displayed because all data is correct).  Now this is where control should
have been forwarded to Verify.jsp.  The log shows that it is getting
forwarded, but it never enters.


Now here is the STRANGEST thing.  In CCProcess.jsp I commented everything
below the </jsp:useBean> and left ONLY the <jsp:forward
page="/CCPayments/28/Verify.jsp"/> - this way not matter what Verify.jsp
should have been loaded.  Check out what is says in the log:

2003-01-05 23:21:05 jsp: Entering CCProcess
2003-01-05 23:21:05 jsp: Entered Verify.jsp
2003-01-05 23:21:05 jsp: Entering Retry.jsp - error on form 2003-01-05
23:21:08 jsp: Entering CCProcess 2003-01-05 23:21:08 jsp: Entered Verify.jsp
2003-01-05 23:21:08 jsp: Entering Retry.jsp - error on form

According to the log - both jsp pages are being loaded...?? I even tried
deleting everything in my work directory to make sure the new files were
being compiled.  This is all very strange and I am at a total loss :(  

Thanks so much for taking the time to look at all this.

Denise

-----Original Message-----
From: Noel J. Bergman [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 05, 2003 10:12 PM
To: Tomcat Users List
Subject: RE: Changed file name now webapp not working right


Denise,

Within your JSP page, you can put <% application.log("..."); %> anywhere you
want to put out a message to the log.

<% application.log("entering CCProcess"); %>

<html>
<head><title>CCProcess</title></head>
<body>
<% if (condition) { application.log("forwarding to verify"); %>

<jsp:forward page="/Verify.jsp" />

<% } else { application.log("forwarding to retry"); %>

<jsp:forward page="/Retry.jsp" />

<% } %>
</body>
</html>

I did that from the hip, and might have some typos.  Just trying to
illustrate logging within a context similar to what you are likely doing.

        --- Noel

-----Original Message-----
From: Denise Mangano [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 05, 2003 21:31
To: 'Noel J. Bergman '; 'Tomcat Users List '
Subject: RE: Changed file name now webapp not working right


Noel,

I even tried changing everything back to FormValidate.jsp and it still
doesn't work...

Yes, your scenario is correct, form action "was" FormValidate.jsp - and "is
now" CCProcess.jsp, and depending on outcome of form validation,
CCPRocess.jsp will forward to Verify.jsp or Retry.jsp.  But now after the
"rename" I never get to Verify.jsp.  The action of Retry.jsp is
CCProcess.jsp.  What is completely boggling my mind is that it was working
perfectly before I changed the file name :( Well I guess its true what they
say, if its not broke...

And I feel pretty dumb saying this, but I do not know how to trace using log
code. I am assuming you mean add some code in the jsp file (and/or
FormBean.java?) that will write to a log file to see what is happening.
Would you be able to recommend the code and the placement of that code so I
can trace this? Or maybe point me in the right direction to some
documentation?

Thanks :)
Denise

-----Original Message-----
From: Noel J. Bergman
To: Tomcat Users List
Sent: 1/5/2003 3:14 PM
Subject: RE: Changed file name now webapp not working right

Denise,

The front end is/was FormValidate.jsp/CCProcess.jsp, which forwards to
Verify.jsp or Retry.jsp?

You renamed it, and now when you submit the form you never get to
Verify.jsp?  You are saying that when Retry.jsp submits the form, the form
action is CCProcess.jsp?  Have you put any log code into CCProcess.jsp to
trace what is happening?

        --- Noel


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to