|
org.netbeans.api.web.webmodule 1.9 | |||||||||
PREV NEXT | FRAMES NO FRAMES |
See:
Description
Web APIs | |
---|---|
org.netbeans.modules.web.api.webmodule | API to access the properties of J2EE web modules. |
org.netbeans.modules.web.spi.webmodule | SPI for providers of J2EE web modules and frameworks. |
WebModuleAPI The API part provides access to web module properties and defines constants for use web module projects (such as action commands or source types). The SPI part can be implemented by modules that provide web module "project" support. It can be implemented with project APIs but other implementations are also possible. There is also an SPI which allows implementors to provides support for web frameworks such as Struts and JSF.
Made the WebModuleAPI public.
WebFrameworkProvider.extend()
and WebFrameworkProvider.getConfigurationPanel()
Deprecated methods WebFrameworkProvider.extend()
and WebFrameworkProvider.getConfigurationPanel()
.
Class WebConfigurationPanel
has been deprecated too.
Introduced a WebModuleExtender
class and a WebModule.createWebModuleExtender()
method returning it.
This allows for better encapsulation of the web module extending process.
WebModule.getJavaSources
Deprecated WebModule.getJavaSources
because its return value is not generic enough.
WebFrameworkProvider.getServletPath()
Added method WebFrameworkProvider.getServletPath()
for obtaining the servlet path for a JSP.
There are some frameworks like Struts, JSF, Spring etc., which extend the web applications. This change introduces the concept of a web framework provider to the Web Module API/SPI which allows to implement supporting these frameworks.
The WebModule
class, which encapsulates a web module, has methods
for retrieving the module's properties:
FileObject myServlet = ...; WebModule wm1 = WebModule.getWebModule (myServlet); String version = wm1.getJ2eePlatformVersion (); System.out.println ("Servlet is in version:" + version + " web module");
Most often the web module is implemented inside a project:
public class MyProjectType implements Project { Lookup getLookup () { return Lookups.fixed(new Object[] { new MyProvider (), ... } } private class MyProvider implements WebModuleProvider { WebModule findWebModule(FileObject file) { if (isMyFile (file)) { WebModule wm; synchronized (this) { wm = cachedWebModule (file); if (wm == null) { wm = WebModuleFactory.createWebModule (new WebModuleImpl ()); cache (file, wm); } } return wm; } } boolean isMyFile (FileObject file) {...} WebModule cachedWebModule (FileObject file) {...} cache (FileObject file, WebModule wm) {...} } private class WebModuleImpl implements WebModuleImplementation { ... } }
It is also possible to implement web modules backed by other means than
a project by implementing a WebModuleProvider
and registering
it in the default lookup.
Support for web frameworks, such as Struts and JSF, can
extend a WebModule
with framework-specific features, such as configuration files. An implementor
wanting to provide such support implements WebFrameworkProvider
and registers it in the
j2ee/webtier/framework
in the default file system.
The sources for the module are in NetBeans CVS in web/webapi directory.
Nothing.
Read more about the implementation in the answers to architecture questions.
|
org.netbeans.api.web.webmodule 1.9 | |||||||||
PREV NEXT | FRAMES NO FRAMES |