sidhartha75
Programmer
Hi there!!!
It would be very helpful if someone could tell me where do I need to put my JSP page error.jsp..I know when I am working with Personal Web server..but I am having problems with Sambar..I have a Java Server Page called "Error.jsp". A servlet called Membership.java calls this error.jsp when ever a user enters wrong information in the membership form.
Assuming that my "error.jsp" is in the server's root directory which is sambar51 and the servlet membership.java is in servlets directory, what should I give as the path in the code below in redURL.....
What is wrong in this code from Membership.java (this is the servlet)
public void sendError(HttpServlet request, HttpServletResponse response) throws ServletException,IOException{
String redURL="/error.jsp";
RequestDispatcher dispatch=getServletContext.getRequestDispatcher(redURL);
dispatch.forward(request,response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response){
LastName=request.getParameter(FDLname);
if(LastName=null || LastName.trim()=" "{
request.setAttribute("errmsg","Must enter Last name"
sendError(request,response);
}
Can someone tell me if the redURL string for accesing the JSP file error.jsp is correct and what is wrong with the setAttribute code snippet.
A detailed answer with code corrections will be very well appreciated and thanked.
Thanking you in all earnest
Regards
Sidhartha
Thanking you with regards
Sidhartha