The server encountered an internal error that prevented it from fulfilling this request的一种解决办法

这是我在编写服务器响应判断用户数据时遇到的问题

这只是   The server encountered an internal error that prevented it from fulfilling this request  问题的一种情况,

        具体错误如下图所示:

    

The server encountered an internal error that prevented it from fulfilling this request的一种解决办法_第1张图片

现问题已解决。

问题描述:

        我在设置某一属性  grade  时,设置为  int<11>  

      在测试数据时,提交对应该属性得数据为 8213322222222222222222211111111111111111111111133333333333333 

      数据超出原设定范围,出错。所引起的异常。

问题解决的方法:

        修改抛出异常处理  try{}catch(SQLException e){e.printStackTrace()} 为  try{}catch(Exception e){e.printStackTrace()}

问题出现与解决:

    在输入信息栏输入正确的信息,会给出已经正确的提示

    The server encountered an internal error that prevented it from fulfilling this request的一种解决办法_第2张图片    //////////给出的处理是右图所示/The server encountered an internal error that prevented it from fulfilling this request的一种解决办法_第3张图片

     当输入信息错误时,给出了不是我所写的错误处理办法,(我的错误处理办法是,给出提示:系统繁忙,稍后操作!)

     输入超出原定范围的数据

         ///////////////////////////点击确定后出现的错误如下:

    The server encountered an internal error that prevented it from fulfilling this request的一种解决办法_第4张图片

     回去检查文件代码,多次修改,发现该问题的解决办法:


     原先的代码:                                                                                                               修改后的代码:(红线已标出)

     The server encountered an internal error that prevented it from fulfilling this request的一种解决办法_第5张图片////////////////////////////////

     保存修改,重新运行程序,

     输入错误的数据,给出了我所设定的处理方法:(下图所示)                          

     The server encountered an internal error that prevented it from fulfilling this request的一种解决办法_第6张图片///   点击确定后    /////

当出现异常时,认真检查代码的正确性,

或许就是一个字符,单词的大小写或拼写错误,都够你调试一下午的。

养成良好的代码风格,也是必须的。

你可能感兴趣的:(tomcat,exception,server,status,input,500_For)