Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Thanx a bunch...I tried that but It

Status
Not open for further replies.

sidhartha75

Programmer
Apr 25, 2002
2
US
Thanx a bunch...I tried that but It doesnot work either. I guess the problem lies in the setAttribute method. When I enter a blank last name (pls refer code above) it should set the attribute for "errmsg". but when I printed the request.getAttribute("errmsg") it displays it as NULL when I tried outputting it on the fly through the servlet.
Also once the attribute is assigned the JSP should display error message with the setAttributes for the errmsg to the user.
The JSP code is as follows

<%
String msg = (String) request.getAttribute(&quot;errMsg&quot;);
%>
<html>
<B><%=msg%></B></BR></BR>
Please use the back button on your browser to return to the previous page(s) and try again.
</html>

So if you look at the code above entering a blank Last Name should call set the attribute and call the sendError method which in turn forwards the request to JSP.

But now when I submit the form with a blank Last Name instead of JSP page being exceuted it displays a blank page.

Can you help me further
Wishes and Thanks

Sidhartha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top