Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Servlet usage  RSS feed

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Could/Should) a servlet be called from a startup page when no information is passed to it.
for example I am using a logon form which displays information from the database (no user intervention required) would I retrieve it with a servlet or bean?
 
Author
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
personally i would love to help but I would need more specifics. Let me reword what you just said and see if we agree:
you have a logon form - this is likely to be the first page that a user sees when entering your site or a section of you site - and it includes dynamic information from the database which does not depend on the user but is generic - possibly its a welcome message which is stored in the db.
in this case I would recommend using a servlet and forwarding to the jsp - so the link people follow is a servlet link.
Alternatively, if people might come across the jsp accidentally or this suits your purpose better you can check for the bean in session and if it doesnt exist forward to the servlet which will forward back or.. just load the bean using a factory method as appropriate.
 
Roger Gazdzicki
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is exactly what I am asking. I did not know if a bean or servlet would be better. I will user a servlet as the information is a one time only thing. The page will not be accessed more then that.
Thanks
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!