aspose file tools*
The moose likes JDBC and the fly likes Data Not displayed in JSP Page , just want to display data  in a jsp from Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Data Not displayed in JSP Page , just want to display data  in a jsp from Database" Watch "Data Not displayed in JSP Page , just want to display data  in a jsp from Database" New topic
Author

Data Not displayed in JSP Page , just want to display data in a jsp from Database

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1056




http://www.lifesbizzare.blogspot.com || OCJP:81%
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

The time to be putting Java code into a JSP is long, long passed. 10 years in fact. 10 years! It's high time to come up to speed with the JSTL and EL and to stop writing JSP pages like it is still 2001.

Move all the Java code to a servlet and other Java classes where it belongs. Capture the DB data in Java constructs that you place into request scope, and use the JSTL and EL on the JSP page to display the data.

Read this article.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Your post demonstrates one of the problems inherent in scriptlets: you have some Java code and you have some HTML code, and it's mashed together in one place. The Java code should be indented one way, and the HTML should be indented another way. However not only have you not attempted to do that, you haven't got any meaningful indentation at all, so it's very hard to see if your Java braces match or your HTML tags match. (Hint: they don't.)

And your code at lines 36 to 38:

indicate that you haven't quite understood how JSPs work. They can be replaced by this simpler code:

because all of your JSP code except the scriptlets is automatically written to the response.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data Not displayed in JSP Page , just want to display data in a jsp from Database