Wow I think I deseerve the "tomcat list schmuck of the year award"... (thank
got the year just started ;) )

The way you worded that ... once I read "Verify is forwarding to Retry" a
light bulb went off...

As you know (and helped greatly with) I was working out previous problems I
was having with form validation.  While I was waiting for a response to a
post,  I was playing with Verify.jsp to add a button to give the user the
option to go back and make changes.  I left it non-fucntional.  So, when my
form validation problems got worked out everything was running smoothly.  I
had the urge to program that button, I was editing the file but then seconds
later decided to wait on that until I knew for sure how to do it and I could
swear that I quit without saving.  Ummm...after checking the file again it
appears that I actually did save that change... :(

The way I was trying to program the button (which I am certain is incorrect)
is onClick="<jsp:forward page="Retry.jsp>".  Looking at it again, I can see
that this jsp tag would be executed regardless of whether or not the button
was clicked to invoke it.  I have removed this code, but my servers are down
for routine maintenance so I will not be able to test until the morning to
see if whether or not this solves the problem.

I truly feel like a dope, and I hope you'll accept my deepest apologies for
wasting your time with this :(

Denise

-----Original Message-----
From: Noel J. Bergman
To: Tomcat Users List
Sent: 1/6/2003 12:34 AM
Subject: RE: Changed file name now webapp not working right

Denise,

That almost looks like either Verify is forwarding to Retry or both
forward
actions are being invoked.  Neither should be the case.

For kicks, I tried my own version (didn't write a fake bean or form):

CCProcess.jsp:

<%@ page import="java.util.*" %>

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

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

Retry.jsp:

<%@ page import="java.util.*" %>

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

<html>
<head><title>Retry</title></head>
<body>Not verified</body>
</html>

Verify.jsp:

<%@ page import="java.util.*" %>

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

<html>
<head><title>Verify</title></head>
<body>Verified</body>
</html>

Entering "//localhost:8080/test/CCProcess.jsp" resulted in the Retry
page
being invoked, as verified by browser content and log:

2003-01-06 00:19:24 jsp: Entering CCProcess
2003-01-06 00:19:24 jsp: Error on form - forwarding to Retry.jsp
2003-01-06 00:19:27 jsp: Entering Retry

Entering "//localhost:8080/test/CCProcess.jsp?validate=1" resulted in
the
Verify page being invoked, again verified by browser content and log:

2003-01-06 00:22:37 jsp: Entering CCProcess
2003-01-06 00:22:37 jsp: Form Has Been Validated - forwarding to
Verify.jsp
2003-01-06 00:22:40 jsp: Entering Verify

Obviously something is not right on your end.  If you want, send me the
files and I'll play.  I will be in transit all day tomorrow, but if I
get
them before I leave, I can run on my laptop.

        --- Noel

-----Original Message-----
From: Denise Mangano [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 06, 2003 0:05
To: 'Tomcat Users List'
Subject: RE: Changed file name now webapp not working right

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]>


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