• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP or servlet  RSS feed

 
sam liya
Ranch Hand
Posts: 1246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I foud in some book says

JSP pages are meant for visual presentation.
Business logic is deferred to servlets.
and servlet for authentication, authorization, database validation;

But my question: is it possible to use jsp as suissness logic and servlet for visual representation.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Aruna,

JSPs and servlet arent so different and arent so same .. so its possbile to use business logic , presentation logic in both. having said that its always better to do the logic for they are intended to (jsp for presentation logic)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this with regards to posting in all uppercase. I have edited the text for you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aruna sameera wrote:But my question: is it possible to use jsp as suissness logic and servlet for visual representation.

Sure! In the same way that you can use the back of a stapler to bang in a nail, or use the blade of a saw to cut your birthday cake.

Tools can always be mis-used.

The question is: why would you willingly use the wrong tool for a job when the proper tool is readily available?

P.S. "suissness logic"? Do you not proofread your posts?
 
sam liya
Ranch Hand
Posts: 1246
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not suissness logic
it should be Buissness logic
sorry for inconvenience
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, yeah, I know what you meant. My point was that you should be more careful when posting. You can use the Preview button to see your post before it is committed, and you can also edit your posts to fix errors afterwards.

This helps you in that your posts are less likely to be misunderstood, and therefore get more and better responses.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aruna sameera wrote:I foud in some book says

JSP pages are meant for visual presentation.
Business logic is deferred to servlets.
and servlet for authentication, authorization, database validation;

But my question: is it possible to use jsp as suissness logic and servlet for visual representation.


This question was asked to me by the CEO in a final round of interview . (I think he had byhardened the answer somewhere)

In reply to this question i said that the view will be changing continuously as the client wishes , so its best to keep it in jsp as it requires no compilation .

He said it is becuase its difficult to use out.println statements in servlets for view purpose.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!