• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Retrive data using usebean

Kaustav Khan
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to fetch the data from the database & show in a jsp page using jsp:usebean in MVC model 2 architecture. Suppose after login a user can view his/her details which he entered at the time of registration & these data will be fetched using bean property.

This is Bean class--Reg.java

This is the Business Logic class---RegBS.java

This is the Servlet--ViewControl.java

This is the Registraion page where the user give their detail at the time of registration-------registration.jsp

This is the final view Page where I getting the null value--view.jsp

How can I display the Id & respective Password of the member in the view.jsp page..?
Junilu Lacar
Posts: 16597
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not giving you an answer to your question but I will give you the reasons why, even though I might know what the problem is, I'm not going to give it to you :

1. Resentment - that you made me read code and constantly try to interpret those short names you have used all over your code. You are not doing anyone else a favor by using short, cryptic names like "rg", "rgg", "reg", "Reg", "RegBS". They make your code difficult to read and if you want people to review your code and help you find problems, you shouldn't make them work any harder than they should.

2. Agitation - I get agitated when I see bad names. There is a reason for separating the View and the Controller layers in MVC. You seem to want to combine them again in your "ViewControl" class. Also, what is "BS" in "RegBS"? Do you realize that "BS" is a very well-known acronym for "crap"? Another indication that you're mixing layers: "Model.BS.RegBS". From all appearances, RegBS is a Data Access Object. This IS NOT an object that is in the Model layer. This is an infrastructure service: it's responsibility is ORM of Reg objects to/from a database. The good thing is that you have kept that responsibility well separated, so far.

So fix these problems first then maybe I'd be inclined to go through that code again and help you find your bug.

Edit: Just so you don't get the wrong impression, I'm not really very upset or anything like that. It's hard to convey a playful "mad" tone but that's how you should read this post. Seriously, though, please make an effort to spell names out. Unreadable names really do bug me when I read code, especially when a little effort on the programmer's part to type out words would really go a long way to help improve readability.
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
useBean was famous in model 1 architecture(jsp), not now. and operating *List of Bean* in useBean is not a good idea...
    Bookmark Topic Watch Topic
  • New Topic