|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectechopointng.ui.util.JavaScriptSnippetService
public class JavaScriptSnippetService
JavaScriptSnippetService allows for dynamic snippets of
JavaScript to be sent to the broweser. And because this class has a setter
for the content, you can "re-used" instances of this Service and change the
content servered.
It is designed to give you a "per component instance" of some JavaScript
snippet, as opposed to the standard JavaScriptService which is
designed for static JS content.
Use the getId() to lookup and place the service into the ContainerInstance service registry.
| Field Summary |
|---|
| Fields inherited from interface nextapp.echo2.webrender.Service |
|---|
DO_NOT_CACHE |
| Constructor Summary | |
|---|---|
JavaScriptSnippetService(Component associatedComponent)
Constructs a JavaScriptSnippetService that serves the
NO specified JS content. |
|
JavaScriptSnippetService(Component associatedComponent,
java.lang.String content)
Constructs a JavaScriptSnippetService that serves the
specified JS content. |
|
| Method Summary | |
|---|---|
static JavaScriptSnippetService |
forComponent(ContainerInstance ci,
Component component)
This will look inside the ContainerInstance's service registry and finds a JavaScriptSnippetService that has previously been created for the component. |
java.lang.String |
getContent()
Returns the content of the JavaScript snippet, which may have been compressed. |
java.lang.String |
getId()
Returns the unique identifier of this service. |
int |
getVersion()
Returns the version of the service to be retrieved. |
void |
service(Connection conn)
Services an HTTP request. |
void |
setContent(java.lang.String content)
Sets the content of the JavaScript snippet, which may been compressed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaScriptSnippetService(Component associatedComponent,
java.lang.String content)
JavaScriptSnippetService that serves the
specified JS content. The component's identifier is used to help name the
Service.
associatedComponent - -
the associated Component for this snippest of JS.content - -
the code of the JS snippetpublic JavaScriptSnippetService(Component associatedComponent)
JavaScriptSnippetService that serves the
NO specified JS content. The component's identifier is used to help name the
Service.
associatedComponent - -
the associated Component for this snippest of JS.| Method Detail |
|---|
public static JavaScriptSnippetService forComponent(ContainerInstance ci,
Component component)
This is designed to allow re-use of the Service.
ci - - the ContainerInstance which may contain the Servicecomponent - - the associated component
public java.lang.String getId()
Service
getId in interface Servicenextapp.echo2.webrender.server.Service#getId()public int getVersion()
ServicegetVersion() should return distinct values whenever the
service's content may have changed.
getVersion in interface Servicenextapp.echo2.webrender.server.Service#getVersion()
public void service(Connection conn)
throws java.io.IOException
Service
service in interface Serviceconn - A Connection object which wraps
HttpServletRequest and
HttpServletResponse objects and provides
access to the facilities of the Echo application container.
java.io.IOException - in the event of errors related to processing the
HTTP request or producing a response.nextapp.echo2.webrender.server.Service#service(nextapp.echo2.webrender.server.Connection)public java.lang.String getContent()
public void setContent(java.lang.String content)
content- - the JavaScript snippest to be sent to the browser.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||