• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsp as a controller ?

 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I am a newbie in J2EE technology,

1.)Can anybody explain me why JSP are not considered as good controllers than servlets.


2.)How to debug an error in a JSP code.



Thanx in advance
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Because JSP have built in assumptions that they will be writing HTML text and open the response stream for text output. Avoiding this is reallllllly cumbersome so dont try.
2. Naturally this depends on the kind of error - there are so many ways to go wrong with JSP.
a. make your error page informative
b. check variables for null before trying to use them
c. examine the Java code that the JSP compiler creates to see what is really trying to execute - you may be surprised.
Bill
 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx William, really appreciate your prompt respone .
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!