JSP loading twice

K

kevin

Hello All,

I have a java/jsp web application that uses servlets and runs New
Atlanta's Servlet Exec version 4.2. I'm finding something really odd is
happening on the dev box. When a JSP page loads, its loading twice. By
that I mean I see that the debug statements are being logged twice, as
if the page was submitted twice in a row or something. The first time
through all the request.getParameter variables are there. The second
time through they are empty. Also of note is that if I click refresh in
the browser, the page only loads once. But when the page is navigated
to or submitted to, it loads twice. I haven't been able to spot any
redirects or javascript location changes, or anything like that. And
this doesn't happen in production.
Any thoughts would be appreciated, and I'd be happy to try and answer
any clarifying questions. Thanks!

Kevin
 
G

gimme_this_gimme_that

More than likely it has to do with the code seen in the client
browser....

<script>
function validate(aform) {
aForm.submit;
/// forgot to put in return true;
}
</script>
</head>
<html>
There is no return in the validate method so clicking submits and the
validate function submits as well.
<p>
Perhaps it doesn't happen in production because the container there
doesn't do the submit
associated with the form - only the submit associated with validate.

<form name=aform action=POST>
<input type=submit name=Submit valuie=Submit onclick="return
Validate(this);" >
</form>


Another thing to check is that your servlet controller returns
immediately after doing
the dispatch.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,186
Latest member
vinaykumar_nevatia

Latest Threads

Top