aspose file tools*
The moose likes JSP and the fly likes retrieving database items using jsp:useBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "retrieving database items using jsp:useBean " Watch "retrieving database items using jsp:useBean " New topic
Author

retrieving database items using jsp:useBean

Henry Nnonyelu
Greenhorn

Joined: Jan 08, 2013
Posts: 1
hi guys!am new here.I am developing a hospital management system and part of the requirements is that users should be able to retrieve their password when they supply their date of birth.The password should be displayed on the screen therein,no sending to email or phone.i have my bean class,my servlet and
the jsp page.Each time i supply a dateofbirth get an instantiationException saying that the bean is not found in the scope.Please any heads up?i will appreciate.thank you
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2851
    
  11

Hi Henry, welcome to JavaRanch!

This is a question about JSPs, so I'm moving it to our JSP forum. The Ranch Office is for questions about the site itself.

I believe jsp:useBean is an outdated tag. At least, I haven't seen it used for many years now. It's been replaced with Expression Language (EL) and JSTL. Also, generally speaking, you don't want to access database objects directly through JSPs. Even in the simplest web application, you would want a servlet to retrieve elements from the database, put them into request attributes, and then forward the request to a JSP, which would handle presentation (i.e., render it into HTML). Updates would be handled the same way. The values would be collected on an HTML form (also rendered from a JSP) and submitted to a servlet for saving to the database. The servlet would then forward to another JSP for presenting the result status.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

For more info the type of structure Greg so excellently described, see this article.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gopakumar Naryanan
Ranch Hand

Joined: Jan 15, 2011
Posts: 72

Henry Nnonyelu wrote:Each time i supply a dateofbirth get an instantiationException saying that the bean is not found in the scope.Please any heads up?i will appreciate.thank you


Please provide the code, so that anyone can help you


Thanks & Regards
Gopakumar
 
Consider Paul's rocket mass heater.
 
subject: retrieving database items using jsp:useBean