From: Matthew B. <mat...@ou...> - 2006-03-23 13:32:48
|
Jon Maber wrote: > Alistair Young wrote: >> if it can't then I'd argue not to bother implementing it as we're >> back to the same thing. The plugin is neither a facility nor a servlet. > > > It is a servlet in the sense that it is invoked, gets information from a > request object and outputs HTML via a response object. The only unusual > feature is that it never outputs a whole page of HTML and is only used > to insert output in the output of another servlet. > >> However, the plugin can't be accessed outwith it's context - it means >> nothing until it's invoked by a template and it can get access to >> current user environment. > > > It _does_ have context. The request object provides the link to the user > environment - since it is the request object built by the Bodington > system. Also, the BuldingContext is available since it is stored against > the thread ID and the thread that calls your *servlet* is the same > thread that called the template. Also as you normally pass through the request object it should have all the stuff setup by BuildingServlet although you will need to cast it back to a Bodington request. > >> My only concern is exposing functionality to the world - that's a lot >> of security updates to maintain as every plugin is accessible via >> it's servlet. Each parallel servlet will have access to the bod >> environment but the difference will be they're publicly accessible >> and attackable. A plugin isn't. > > The servlet does _not_ need to be exposed on its own URL. The servlet > knows if it is being called directly or via an include and can refuse to > deliver content. It can even tell if the include is coming from > Bodington or from another servlet. > >> I don't think you can get a "private" servlet but I haven't looked >> into it enough. > > Yes you can! If you 'include' a servlet only the security constraints of > the URL that was originally accessed apply. So, you simply put your > servlet in the web app with a 'noone can access ever' constraint. You just need to define it by name but place no mappings on the servlet and that way you can only access it through the RequestDispatcher.include() for JSPs you just dump them inside WEB-INF/ as then only included/forwarded requests can get at them. -- -- Matthew Buckett, VLE Developer -- Learning Technologies Group, Oxford University Computing Services -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ |