Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why can't we make jsp as a controller and action
servlet in struts?

Answers were Sorted based on User's Feedback



Why can't we make jsp as a controller and action servlet in struts?..

Answer / aditya sinha

JSP is a part of presentation layer(View in MVC pattern)
which should be decoupled from controller or model, because
of its benifits of flexibility and modularity and focussed
responsibility.

By having the controller separate, we allow to choose the
presentations dynamically. But having them integrated
implies, change in presentation logic may also fiddle with
the controller segment embedded. Any new presentation would
attract unnecessary controller code repetition into it.

More over, if its(the controller segment) only an include
in JSP, then the overhead of JSP parsing to servlet is not
worth doing it.

Is This Answer Correct ?    2 Yes 0 No

Why can't we make jsp as a controller and action servlet in struts?..

Answer / punna

Aording to industry standards Jsp must be "Java ode Less
Jsp". But when it taken controller it must contain java
code to communicate with model components,So we try to take
the java class servlet to plae integration logic

Is This Answer Correct ?    4 Yes 3 No

Why can't we make jsp as a controller and action servlet in struts?..

Answer / altaffur

because of MVC2 pattern

Is This Answer Correct ?    3 Yes 2 No

Why can't we make jsp as a controller and action servlet in struts?..

Answer / srinu

Jsp means "LESS JAVA CODE" and also tag based program.Their
is no tag intigriate with other logic.so jsp is not
suitable for controller.when we take ActionServlet or
Servlet as contoller for suitable.This class contain pure
java code and also intigrate with other logic and follows
oops priniciple,MVC principle.

Is This Answer Correct ?    1 Yes 1 No

Why can't we make jsp as a controller and action servlet in struts?..

Answer / raghu

When JSP compiles, internally the jsp compiler converts the
servlets and compiles servlets java and generartes the
class file. Every time it will do the same thing, so it may
take several time. It may cause performance issue.

Is This Answer Correct ?    1 Yes 2 No

Why can't we make jsp as a controller and action servlet in struts?..

Answer / guest

beans are object and object can act as component

Is This Answer Correct ?    0 Yes 1 No

Why can't we make jsp as a controller and action servlet in struts?..

Answer / sivadasan

Most of the applications are created in MVC design pattern
to seperate the functions of differnet components and
handle the complexity of applications.

JSP and Servlets are the server side components which can
respond to the client request.

Servlets are the basic components for request handling in
Web Server. They contains pure Java code.

Everything that needs to be done to generate the proper
user response (which is genarally HTML code) needs to be
done through coding. As a single servlet cannot respond
each and every request by itself as client request varies
in type (e.g. enquiry update request add etc) the request
and response object is passed onto different servlets with
little task completed by each servlet.

This controlling part is easier to write in java. So
Servlet is used as controller.

Is This Answer Correct ?    0 Yes 2 No

Why can't we make jsp as a controller and action servlet in struts?..

Answer / amareshara

Becoz in the JSP all only our business logic is described.
but MVC we can all the logic (i.e. B.L.,P.L.) are separated
asap.

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More Core Java Interview Questions

Can the garbage collection be forced by any means?

0 Answers  


Is char a method in java?

0 Answers  


What is the use of accept () method in java?

0 Answers  


What are desktop procedures?

0 Answers  


From the two, which would be easier to write: synchronization code for ten threads or two threads?

0 Answers  


How to store image in arraylist in java?

0 Answers  


What is fail fast in java?

0 Answers  


How does multithreading take place on a computer with a single cpu?

0 Answers  


who was the founder of java

32 Answers   CTS, HCL, ProKarma,


How do you represent a space in regex java?

0 Answers  


When we serialize an object does the serialization mechanism saves its references too?

0 Answers  


Can we have a method name same as class name in java?

0 Answers  


Categories