GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Certification  >  Sun
Go To First  |  Previous Question  |  Next Question 
 Sun  |  Question 6 of 38    Print  
can we implement an interface in jsp?if yes how ?if no why?

  
Total Answers and Comments: 8 Last Update: November 29, 2007     Asked by: vijay 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 04, 2005 05:03:39   #1  
Navaladi        

RE: can we implement an interface in jsp?if yes how ?i...
No we cant implement interface in jsp
 
Is this answer useful? Yes | No
December 14, 2005 01:36:31   #2  
ajitamitavdas Member Since: December 2005   Contribution: 8    

RE: can we implement an interface in jsp?if yes how ?i...

Hi

i think only a class or interface can implement an interface and should implements all the methods defined in that interface but incase of  jsp the webcontainer is creating the instances and call the respective methods that is defined in that container.So we cant implement interfaces in jsp. 


 
Is this answer useful? Yes | No
January 12, 2006 04:47:56   #3  
lakshmi        

RE: can we implement an interface in jsp?if yes how ?i...

hi

page directive does have only a import attribute and it is not have implements.

So also jsp cannot implement an interface

<%@ page
          [ language="java" ]
          [ extends="package.class" ]
          [ import="{package.class | package.*}, ..." ]
          [ session="true | false" ]
          [ buffer="none | 8kb | sizekb" ]
          [ autoFlush="true | false" ]
          [ isThreadSafe="true | false" ]
          [ info="text" ]
          [ errorPage="relativeURL" ]
          [ contentType="mimeType [ ;charset=characterSet ]"   |   "text/html ; charset=ISO-8859-1" ]
          [ isErrorPage="true | false" ]
%>


 
Is this answer useful? Yes | No
May 25, 2006 02:44:55   #4  
Nitin        

RE: can we implement an interface in jsp?if yes how ?i...
Write a class  which emplement the interface and than use it
 
Is this answer useful? Yes | No
May 26, 2006 02:55:34   #5  
sowjanya        

RE: can we implement an interface in jsp?if yes how ?i...
here a class is implementing a interface but how can a jsp directly implement a interface..................................
 
Is this answer useful? Yes | No
May 26, 2007 02:28:51   #6  
deepak        

RE: can we implement an interface in jsp?if yes how ?i...

In "Page" directive you have "extends" attribute which allows you to extend you class by jsp.
They why i can not implement my interface......??????
First solution::     i can do it by implementing my interface by my class and then i can use "Page" directive which have "extends" attribute which allows me to extend my class by jsp.

But i want only to implement my interface, don't want to extend a class then what will i do??????????????


 
Is this answer useful? Yes | No
July 29, 2007 15:16:26   #7  
dsmanyam Member Since: June 2007   Contribution: 3    

RE: can we implement an interface in jsp?if yes how ?i...
You can actually extend a class within a JSP right.

Now take a template class make that class implement all your required interfaces and then make your JSP extend that template class and provide the functionalitywithin the JSP for all the interface methods.

Try this way. I havent tried it but it should work this way.

 
Is this answer useful? Yes | No
November 29, 2007 05:54:54   #8  
like_ashish Member Since: November 2007   Contribution: 1    

RE: can we implement an interface in jsp?if yes how ?if no why?
No we can't .
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape