Home > Back-end >  JSP page add auth certification, after joining tip server error
JSP page add auth certification, after joining tip server error

Time:09-16


The JSP page to add the auth certification directly responsible for the content (the inside of the body to the new JSP) inside, join after prompt server error, is there any player to know why, thank you,
Start found no problem, then the server to do some changes, they became so, specific changes is:


The code is as follows:

<% @ page import="Java. SQL. *, javax.mail. SQL. *, javax.mail. Naming. *, com. Maxcard. Util. *" % & gt;


The New Document & lt;/title> <br/><br/></head> <br/><br/><body> <br/><% <br/>If (request. GetHeader (" Authorization ")==null) {<br/>The response. The setStatus (401); <br/>Response. SetHeader (" WWW - authenticate ", "Basic realm=/" www.maxcard.com/""); <br/>} else {<br/><br/>//input information <br/>String encoded=(request. GetHeader (" Authorization ")); <br/><br/>//Base64 is used as the encoded into <br/>String up=StringUtil. DecodeBase64 (encoded); <br/><br/>String user=""; <br/>String password=""; <br/><br/><br/>If (the up!=null) {<br/><br/>//remove the user name and password <br/><br/><br/>User=up. The substring (0, the up indexOf (" : ")); <br/>Password=up. The substring (up. IndexOf (" : ") + 1); <br/>} <br/><br/><br/>If (user. Equals (" David ") & amp; & Password. Equals (" maxcard ")) {<br/>Out. Print (" certification success "); <br/>} else {<br/>Out. Print (" authentication failed "); <br/>} <br/>} <br/>%> <br/></body> <br/></html><p class="article - content rp"> CodePudding user response: </p>What is your error message<p class="article - content rp"> CodePudding user response: </p>Title is a server error, detailed tips, I'm sorry, the page you visit server error,<p class="article - content rp"> CodePudding user response: </p>Check the tomcat error log, see detailed error information </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/Backend/3181.html" target="_blank" style="color:#999">https//www.codepudding.com/Backend/3181.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/Backend/3180.html'>Of new help, path problem for springMVC?</a></div> <div class="detail-arr-right">Next:<a href='/Backend/3437.html'>[new turn] XE10.2.3 android SdkVersion has been 14 can you tell me how to modify</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>