aspose file tools*
The moose likes JSP and the fly likes How to make the server stop the page for evaluation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to make the server stop the page for evaluation" Watch "How to make the server stop the page for evaluation" New topic
Author

How to make the server stop the page for evaluation

Savitra Sapre
Greenhorn

Joined: Jun 02, 2009
Posts: 4






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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61205
    
  66

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61205
    
  66

You should not be putting any Java code in your JSP. That is a practice that was discredited over 6 years ago.

And you should never attempt a redirect after you have already sent output to the browser.
Savitra Sapre
Greenhorn

Joined: Jun 02, 2009
Posts: 4
please tell me what should i do now as im just trying to learn JSP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61205
    
  66

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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61205
    
  66

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:

The Secret Life of JSPs

The Front Man
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make the server stop the page for evaluation