why servlet is used as controller not JSP?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Answer / sarathchandra t
Html is used in jsp and http is used in servlet.
Is This Answer Correct ? | 1 Yes | 0 No |
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 |
Answer / sarathchandra t
Servlet is used in http server and jsp is used in html server.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sarathchandra t
Motor is not present.
Controller is present in the chip binarycodes are present.
Is This Answer Correct ? | 0 Yes | 1 No |
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 |
Which design pattern is implemented by Struts2 interceptors?
What is the life cycle of actionform?
What happens when Two users requests for same action class? How the threads are controlled?
How you will enable front-end validation based on the xml in validation.xml?
how does request processor relates to action mapping?
What are the aware interfaces in struts2?
What is struts2 in java?
how to write uploadphoto in the insert update delete using struts? write code struts and jsp jdbc
can anyone help me to send the code for Jasper Reporting in java?plz
What is role of action class?
What is the use of jsonvalidation in struts?
Explain about struts relation to html tags?