Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet usage  RSS feed

 
Roger Gazdzicki
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?
 
chanoch wiggers
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!