• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

retrieving database items using jsp:useBean

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For more info the type of structure Greg so excellently described, see this article.
 
Ranch Hand
Posts: 72
Hibernate Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic