• Register
0 votes

Problem :

I am trying to run my registration jsp page with the servlet. But it is throwing following error:

The server encountered an internal error that prevented it from fulfilling this request.


com.java.task11.webapp. RegistrServlet.processRegistration(RegistrServlet.java:77)
com.java.task11.webapp. RegistrServlet.doPost(RegistrServlet.java:49)

I am unable to figure out why this is happening?

Any clues?

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

Please find the solution for your error as follows:

if (ValidateUtil.isNullOrEmpty(lastName)) {
if (!ValidateUtil.isEmailValid(email)) {

I have gone through your problem in above code snippet you are checking for null or empty value on only lastname, but not on isEmailValid for empty value. So you will need something like below code change that will help you.

if (ValidateUtil.isNullOrEmpty(email) || ! ValidateUtil.isEmailValid(email)) {


you can fix your ValidateUtil.isEmailValid() to just cope up with the null email values. It will not crash but it will only return false.


There is one more way to fix your issue.

It will work when you will throw away next line from your form:


And you will pass all parameters at the request ok:

 <form action="/registrationform" method="post">
   <%-- error messages --%>
   <div class="form-group">
    <c:forEach items="${registrationError}" var="error">
    <p class="error">${error}</p>
9 7 4
38,600 points

Related questions

0 votes
1 answer 755 views
Problem : I am trying to display Data from DB.But facing error as followsthe server encountered an unexpected condition that prevented it from fulfilling the request.
asked Nov 15, 2019 peterlaw 6.9k points
0 votes
1 answer 68 views
Problem : Hi I am trying to develop the web application its working fine but since yesterday I had the problem when I try to click the link it gives me below error The length of the query string for this request exceeds the configured maxQueryStringLength value. ... to auto generate I am trying to use asp dotnet4 Ajax control toolkit and also using the update panel. Any suggestions on this ?
asked Feb 2, 2020 jwilliam 3.9k points
0 votes
1 answer 57 views
Problem : I have my newly created website. First time I was able to succesfully login. The default address: www.abc.com I typed above address on browser and it redirected me to my login page: www.abc.com/pages/landingpage.aspx When I entered my login credential and tried to log ... open my site number of tabs and the browsers but as soon as I am logged in to my site, I am getting the above error.
asked Jan 31, 2020 jwilliam 3.9k points
0 votes
1 answer 20 views
Problem: I am a na&iuml;ve to Java, Jsp, Servlet and trying to make a very small registration program with the database. But while trying to run this I am facing below errors: HTTP Status 405 - HTTP method GET is not supported by this URL type Status report message HTTP ... </welcome-file>     </welcome-file-list> </web-app> I am looking for Java expert who can help me in fixing above error.
asked Jul 29, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 103 views
Problem : I am getting bellow error repeatedly exception in thread "awt-eventqueue-0" java.lang.nullpointerexception
asked Oct 31, 2019 peterlaw 6.9k points
0 votes
1 answer 437 views
Problem : Everytime we compile the GUI , we get bellow error exception in thread "javafx application thread" java.lang.nullpointerexception
asked Oct 19, 2019 peterlaw 6.9k points
0 votes
1 answer 12 views
We are retrieving data from database and displaying it in table in a JSP however we don't have any idea about how to display it on text fields. Can anyone here help us with coding ?
asked Sep 26, 2020 Daniel Anderson 4k points
0 votes
1 answer 8 views
0 votes
1 answer 13 views
0 votes
1 answer 393 views
Problem : I am trying to do the file upload & enter the data task into my MongoDB using a flask but I had below error when I filled my form & upload my image: &ldquo;Bad Request The browser (or proxy) sent a request that this server could ... mypassword, 'email': myemail, 'img_name': file_name})         return render_template('index.html')     else:         return render_template('index.html')
asked Jan 22, 2020 jwilliam 3.9k points