Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet linking and requestdispatcher

 
Cynthia Yao
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a project, most stuffs are form validation, send email, and update database. Because I do not want to write a servlet for every single form, I am thinking about write several small servlets, changable information store in property files and link them together using the property file.
However, my coworker says this is not a good idea. Well anyone has any suggestions?
Finally, after I use RequestDispatcher.forward, the page's javascript got messed up. Is it because of tomcat? Anyone had similiar experience?
Thanks
 
Alex Kravets
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course whenever possible it is better to have one servlet to do all you stuff. Besides, form checking and database updates are pretty forward routines. Have you considered using JavaBeans and JSP?
 
Cynthia Yao
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I need very strict seperation between presentation and logic, all content will go through another process for update. That is why I choose servlet. If could, I would rather use jsp which I am more familiar with.
All databse access will use bean, I wrote two small servlet to handle form validation and email. If the client decide to add more similiar stuff, I would just change the property file.
Well, maybe client would not make that much changes, maybe I should wrote singel servlet to handle one process.
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic