• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieving database items using jsp:useBean

 
Henry Nnonyelu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For more info the type of structure Greg so excellently described, see this article.
 
Gopakumar Naryanan
Ranch Hand
Posts: 72
Eclipse IDE Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic