I am writing following code:
<%@page errorPage="Error.jsp"%>
<%
String user = (String)request.getParameter("uname");
String password = (String) request.getParameter("password");
try{
if(user.equals("Prathamesh") && password.equals("India")){
out.println("Welcome");
out.flush();
RequestDispatcher rd = request.getRequestDispatcher("/Welcome.jsp");
rd.include(request, response);
}else{
throw new Exception();
}
}catch(Exception e){
throw new Exception("Servlet Error");
}
%>
Whenever i enter wrong password it should go to Error.jsp which is as follows:
<%@page isErrorPage="true" %>
Error Welcome !
<%= exception.getMessage() %>
But it gives Http 500
The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.
Help will be much appriciated.
Regards,
Prathamesh.
<%@page errorPage="Error.jsp"%>
<%
String user = (String)request.getParameter("uname");
String password = (String) request.getParameter("password");
try{
if(user.equals("Prathamesh") && password.equals("India")){
out.println("Welcome");
out.flush();
RequestDispatcher rd = request.getRequestDispatcher("/Welcome.jsp");
rd.include(request, response);
}else{
throw new Exception();
}
}catch(Exception e){
throw new Exception("Servlet Error");
}
%>
Whenever i enter wrong password it should go to Error.jsp which is as follows:
<%@page isErrorPage="true" %>
Error Welcome !
<%= exception.getMessage() %>
But it gives Http 500
The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.
Help will be much appriciated.
Regards,
Prathamesh.