This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

can an interface be implemented in jsp  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can an interface be implemented in jsp
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mintoo,
You can't directly implement interface in JSP but surely you can have a indirect implementation by extending user defined class which intern implements(empty impplenmentation will also do) Interface you want.

e.g
public class JSPBaseImpl implements .......,......,ILogin(user defined Interface dot indicates some predefined interfaces this class should implement )

{
//define all methods
}


use page direcive as follows
<%@page extends="JSPBaseImpl" %>

i hope this helps otherwise feel free to revert back.





Shrinivas
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can pls specify me why JSp specification impose a restriction behind
implementing Interface.
i mean why cannot we implement Interface in JSP


Thanks
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to?
Given the nature of a container managed JSP's lifecycle, I can't imagine a good reason to want to implement any other interfaces from one.
A JSP is not something you pass around.

There is the <%@ page extends=.... directive.
You could always implement your own JSP superclass and have it implement whatever you want.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!