Home > Back-end >  The JSP code in the try block of code executed repeatedly several times what reason be?
The JSP code in the try block of code executed repeatedly several times what reason be?

Time:01-11

 
<% @ page import="com. Alex. DBC. DatabaseConnection" % & gt;
<% @ page import="Java. SQL. *" % & gt;
<% @ page import="Java. Util. ArrayList" % & gt;
<% @ page contentType="text/HTML. Charset=utf-8 "language=" Java "% & gt;


$Title $& lt;/title> <br/></head> <br/><body> <br/><% <br/>ArrayList<String> ArrayList=new ArrayList<String> (a); <br/>Try {<br/>The Statement Statement=DatabaseConnection. GetConnection (). CreateStatement (); <br/>String SQL="SELECT * FROM the userinfo"; <br/>The ResultSet res=statement. ExecuteQuery (SQL); <br/>System. Out.println (" executing the try block... "); <br/>While (res), next ()) {<br/>System. Out.println (" [" + res. Get string (1) + "] get the from while... "); <br/>ArrayList. Add (res) get string (1)); <br/>}<br/>} the catch (Exception e) {<br/>e.printStackTrace(); <br/>} the finally {<br/>DatabaseConnection. Close (); <br/>}<br/>For (String s: arrayList) {<br/>Out.println (s); <br/>}<br/>Out.println (arrayList. The size ()); <br/>% & gt; <br/></body> <br/></html> <br/></pre> <br/>In the console output <br/><img SRC="https://img.codepudding.com/202101/181016110048351.png" Alt=""/> <br/>In the browser to display <br/><img SRC="https://img.codepudding.com/202101/181016110048352.png" Alt=""/> <br/>I want to ask why is Tomcat9, will perform so many times? </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/Backend/98182.html" target="_blank" style="color:#999">https//www.codepudding.com/Backend/98182.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/Backend/98181.html'>Springboot custom annotations and @ valid annotations, why @ valid perform first?</a></div> <div class="detail-arr-right">Next:<a href='/Backend/98237.html'>Weblogic12C launched an error</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=Web+development' target='_blank'>Web development</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>