Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Plugin Interface

 
abhishek paul
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Ranchers...hope to find clarifications for the below mentioned topics...

(1)A method in an Interface cannot have a body...but in case of the Interface org.apache.struts.action.Plugin the methods destroy() and init() have bodies..Please provide an explaination for this.The class org.apache.struts.tiles.TilesPlugin which implements Plugin does however override the above mentioned methods.

(2)The class org.apache.struts.tiles.TilesRequestProcessor extends RequestProcessor but does not override the processPreprocess(HttpServletRequest p1,HttpServletResponse p2){} method.Can anyone provide the steps how the steps takes place while using Tiles framework.
 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by abhishek paul:

(1)A method in an Interface cannot have a body...but in case of the Interface org.apache.struts.action.Plugin the methods destroy() and init() have bodies..Please provide an explaination for this.The class org.apache.struts.tiles.TilesPlugin which implements Plugin does however override the above mentioned methods.



Where did you find the source for Plugin interface ? I just checked the source and found only method declarations.

Regards,
Reghu
 
abhishek paul
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The package content is as given below....let me know in case i have skipped something here.. !!The methods should end with semi colons and without curly braces...if not i need to revisit Kathy Sierra javascript: x()
Eek!

package org.apache.struts.action;

public interface PlugIn
{
//
// Methods
//
void destroy() { }

void init(org.apache.struts.action.ActionServlet p1, org.apache.struts.config.ModuleConfig p2) { }
}


[ April 29, 2008: Message edited by: abhishek paul ]
[ April 29, 2008: Message edited by: abhishek paul ]
 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the link i found from the web

Plugin source

Here, there is no method body. Could you provide the link from where you got this strange source
 
abhishek paul
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
..thanks Reghu this is exactly what i had intended it should be..while checking the "Go to Declaration" in the IDE (Jdeveloper) the Plugin Interface displayed the above code....anyways this clarifies the first point.

Please provide suggestions for the second one as well.


Thanks,
Abhishek.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic