|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.http.WpdExtendlet
public class WpdExtendlet
The extendlet to handle WPD (Widget Package Descriptor).
Note: it assumes all JavaScript files are encoded in UTF-8.
In additions to loading, WPD allows to bootstrap a JavaScript codes by specifying a parameter called main. For example, the following link
<script type="text/javascript" src="/zkdemo/zkau/web/js/zk.wpd?main=foo.Go&what=12&more=xy" charset="UTF-8">
</script>
will cause the following to be executed
zk.load('foo', function() {foo.Go.main({what: '123', more: 'xy'})});
In other words, it loads the package called foo
, and then
invoke the main
method of the foo.Go
class.
Field Summary |
---|
Fields inherited from interface org.zkoss.web.util.resource.Extendlet |
---|
ALLOW_DIRECT_INCLUDE |
Constructor Summary | |
---|---|
WpdExtendlet()
|
Method Summary | |
---|---|
protected java.lang.String |
getDeviceType()
Returns the device type for this WpdExtendlet. |
boolean |
getFeature(int feature)
Returns if the specified feature is supported. |
void |
init(ExtendletConfig config)
Initializes the resource processor. |
boolean |
isDebugJS()
Returns whether to generate JS files that is easy to debug. |
protected byte[] |
mergeJavaScript(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String pkgTo,
byte[] data)
Merges the JavaScript code of the mergeable packages defined in LanguageDefinition.getMergedJavaScriptPackages(java.lang.String) . |
protected byte[] |
retrieve(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String path)
Retrieves the content of the given path. |
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String path)
Process the specified request. |
void |
setDebugJS(boolean debugJS)
Sets whether to generate JS files that is easy to debug. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WpdExtendlet()
Method Detail |
---|
public void init(ExtendletConfig config)
Extendlet
public void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String path) throws javax.servlet.ServletException, java.io.IOException
Extendlet
path
- the path mapped to this resource processor.
javax.servlet.ServletException
java.io.IOException
protected byte[] retrieve(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String path) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected java.lang.String getDeviceType()
Default: ajax. The derived class might override it to implement a Wpd extendlet for other devices.
protected byte[] mergeJavaScript(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String pkgTo, byte[] data) throws javax.servlet.ServletException, java.io.IOException
LanguageDefinition.getMergedJavaScriptPackages(java.lang.String)
.
javax.servlet.ServletException
java.io.IOException
public void setDebugJS(boolean debugJS)
public boolean isDebugJS()
public boolean getFeature(int feature)
Extendlet
getFeature
in interface Extendlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |