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

What is meant by distributed application? Why are we using that in our application?

0 Answers  


Does unicode support all languages?

0 Answers  


What causes memory leak in java?

0 Answers  


What is a map in java?

0 Answers  


What does null mean in java?

0 Answers  


Differentiate Vector and ArrayList?

6 Answers   Max Telecom, Wipro,


What is io stream in java?

0 Answers  


What is static and final keyword in java?

0 Answers  


Which class is extended by all other classes?

4 Answers  


What do you mean by inner class in java?

0 Answers  


Can an integer be null java?

0 Answers  


suppose we have an interface & that interface contains five methods. if a class implements that interface then we have to bound that to give tha definition of all five methods in that class. If we declare that class as abstract then can we call only two methods to give the deinition of that method & i don't want to give the definition of all the methods? can it possible

6 Answers   HP, Wipro,


Categories