why servlet is used as controller not JSP?

Answers were Sorted based on User's Feedback



why servlet is used as controller not JSP?..

Answer / javasheavenforu

JSP can be used as controller because it is converted into
servlet ultimately.But this is a violation of MVC pattern.
If you want to follow the pattern then you need to seperate
your presentation part and controller part.

Is This Answer Correct ?    31 Yes 1 No

why servlet is used as controller not JSP?..

Answer / xxx

while using in mvc1 architechture jsp is used as the
request and the response so that the presentation and
apllication logic are the same component but in case of
using servlets in mvc2 the advantage over this is that the
request is handled using jsp but the response and the
overall manipulation is done by using the servelet so that
the presentation and application logic are the same...ie
the difference

Is This Answer Correct ?    10 Yes 5 No

why servlet is used as controller not JSP?..

Answer / gopikrishna

JSP is a scripting language flexible for webdesigners to
undersatnd the tags with java language and this is
espicially for presentation, as in this struts scenario,
Servlet is a component which is responsible for taking the
contents of incomming http requests and decode and process
for furthur forwarding rather than presenation...So this is
genaral way of thinking to understand y they had chossen
servlet instead of jsp. if we are having a beeter
understaning of jsp and servlets then, we ourself can
decide which one is more better if your way of thinking
also considering the load balancing issues.

Is This Answer Correct ?    10 Yes 6 No

why servlet is used as controller not JSP?..

Answer / sri

servlet only communicate with container. if suppose any java
class can communicate with container no need to servlet.

jsp is also internally conerted to servlet...

Is This Answer Correct ?    1 Yes 0 No

why servlet is used as controller not JSP?..

Answer / sarathchandra t

Html is used in jsp and http is used in servlet.

Is This Answer Correct ?    1 Yes 0 No

why servlet is used as controller not JSP?..

Answer / zesan

Because when ever request is come then servlet is handle and
communicate to model and model process data and send back to
servlet . servlet those process data store into reositry area
then servlet can communicate to jsp and jsp response to
client . so every thing is done by servlet that is reason
servlet is used as controller.

Is This Answer Correct ?    0 Yes 0 No

why servlet is used as controller not JSP?..

Answer / sarathchandra t

Servlet is used in http server and jsp is used in html server.

Is This Answer Correct ?    0 Yes 0 No

why servlet is used as controller not JSP?..

Answer / sarathchandra t

Motor is not present.
Controller is present in the chip binarycodes are present.

Is This Answer Correct ?    0 Yes 1 No

why servlet is used as controller not JSP?..

Answer / anonymous

There is NO difference between servlet and jsp page.
Since Jsp should be converted into Servlet, there is
virtually no difference. These type of questins are being
used to trap the candidates.
Thats about it.

Is This Answer Correct ?    8 Yes 18 No

Post New Answer

More Struts Interview Questions

why servlet is used as controller not JSP?

9 Answers   MCS,


What does params interceptor?

0 Answers  


What is MVC Architecture?

21 Answers   HCL, Hexaware, Infosys, Infrascape, Tech Mahindra,


What is value stack?

0 Answers  


What is the forward action utilized for?

0 Answers  






How to handle exceptions in structs?

0 Answers  


How tag libraries are defined in Struts?

0 Answers  


How properties of a form are validated in Struts?

0 Answers  


What is apache struts used for?

0 Answers  


How do you find the struts version being used in a project?

0 Answers  


What is request processor and how does it relates to action mapping?

0 Answers  


What is the purpose of @results annotation?

0 Answers  


Categories