The browser is directly going to the failed page.....can anyone explain how? and why?
if i try to print "success" or "failure" using out.println() then it is printing but with null written on the page...please help
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.
You can go back and change your post to add code tags by clicking the button on your post.
If you are just learning JSP, you need to use tutorials and other resources that emphasize modern JSP -- not how it was used in the early 2000's. That means no Java scriptlets in the JSPs -- rather, they should concentrate on the use of the JSTL and EL, and proper web application structure.
You also need to understand the HTTP cycle. From your first post, it looks as if you are trying to read the user input in the same JSP that is used to send the form to the user. How can you read the data before the user even sees the form in the browser?
Perhaps these two articles might help you get started: