Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is need of JspPage, HttpJspPage interfaces in JSP

 
Ravindranath Chowdary
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Why SUN has provided the interfaces JspPage, HttpJspPage for JSP? What is the necessity of going for these two additional interfaces instead of using Servlet interface directly?

Thanks,
Ravindranath
 
Anirvan Majumdar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm, if you go through the HttpJspPage interface's specification, it quite clearly mentions that it describes the interaction that a JSP Page Implementation Class must satisfy when using the HTTP protocol

More importantly, it mandates the implementation of the _jspService method, which plays a critical role in the lifecycle of a JSP. I believe the relationship is somewhat similar to what exists between GenericServlet and HttpServlet
 
Ravindranath Chowdary
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am not clear with the explanation provided in HttPJspPage interface. Can anyone please explain this clearly?

Thanks,
Ravindra
 
pankaj vijay
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JspPage & HttpJspPage interfaces are provided to make request object. Jsp is just a view while servlets doGet & doPost method take request object as a parameter & pass response to jsp page(view).
Ok now think servelt as a responser OR request processor, jsp cant pass request object itself thats why these 2 interfaces are provided, to take jsp parameter & make request object so that servlet can take that & process. HttpJspPage provide service method that process HTTP protocol & all. Servlet interface also provide service method But that decide which method to call either doGet OR doPost.
Your point is Sun can do same this from one interface ,Yes probably Sun can did but it will spoil oops concepts & also will lead to a Bad coding style. I think one of java's feature is abstraction.If they will do like that way then this oops concept will not be followed.
thats all up to my knowledge. Anyway good Question
 
A teeny tiny vulgar attempt to get you to buy our stuff
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!