public class HTMLServlet extends HTMLTagAttributes implements java.io.Serializable
This example creates a HTMLServlet tag:
// Create an HTMLServlet. HTMLServlet servlet = new HTMLServlet("myServlet", "http://server:port/dir"); // Create a parameter, then add it to the servlet. HTMLParameter param = new HTMLParameter("parm1", "value1"); servlet.addParameter(param); // Create and add second parameter HTMLParameter param2 = servlet.add("parm2", "value2"); System.out.println(servlet);
Here is the output of the HTMLServlet tag:
<servlet name="myServlet" codebase="http://server:port/dir"> <param name="parm1" value="value1"> <param name="parm2" value="value2"> If you see this text, the web server providing this page does not support the SERVLET tag. </servlet>
HTMLServlet objects generate the following events:
Constructor and Description |
---|
HTMLServlet()
Constructs a default HTMLServlet object.
|
HTMLServlet(java.lang.String name)
Constructs an HTMLServlet object with the specified servlet name.
|
HTMLServlet(java.lang.String name,
java.lang.String location)
Constructs an HTMLServlet object with the specified servlet name and location.
|
Modifier and Type | Method and Description |
---|---|
void |
addElementListener(ElementListener listener)
Adds an addElementListener.
|
void |
addParameter(HTMLParameter param)
Adds an HTMLparameter to the servlet tag.
|
HTMLParameter |
addParameter(java.lang.String name,
java.lang.String value)
Adds an HTMLParameter to the servlet.
|
java.lang.String |
getFOTag()
Returns a comment tag.
|
java.lang.String |
getLocation()
Returns the location of the servlet.
|
java.lang.String |
getName()
Returns the name of the servlet.
|
java.lang.String |
getTag()
Returns the tag for the HTML servlet.
|
java.lang.String |
getText()
Returns the alternate text of the servlet.
|
void |
removeElementListener(ElementListener listener)
Removes this ElementListener from the internal list.
|
void |
removeParameter(HTMLParameter param)
Removes an HTMLParameter from the servlet tag.
|
void |
setLocation(java.lang.String location)
Sets the location for the servlet source.
|
void |
setName(java.lang.String name)
Sets the class name of the servlet.
|
void |
setText(java.lang.String text)
Set the alternate text for the servlet, which will be displayed if
the web server does not support the servlet tag.
|
java.lang.String |
toString()
Returns a String representation for the HTMLServlet tag.
|
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
public HTMLServlet()
public HTMLServlet(java.lang.String name)
name
- The servlet name.public HTMLServlet(java.lang.String name, java.lang.String location)
name
- The servlet name.location
- The servlet location (http://server:port/dir).public void addParameter(HTMLParameter param)
param
- The parameter.public HTMLParameter addParameter(java.lang.String name, java.lang.String value)
name
- The parameter name.value
- The parameter value.public void addElementListener(ElementListener listener)
listener
- The ElementListener.removeElementListener(com.ibm.as400.util.html.ElementListener)
public java.lang.String getLocation()
public java.lang.String getName()
public java.lang.String getText()
public java.lang.String getFOTag()
getFOTag
in interface HTMLTagElement
public java.lang.String getTag()
getTag
in interface HTMLTagElement
public void removeParameter(HTMLParameter param)
param
- The parameter.public void removeElementListener(ElementListener listener)
listener
- The ElementListener.addElementListener(com.ibm.as400.util.html.ElementListener)
public void setLocation(java.lang.String location)
location
- The location.public void setName(java.lang.String name)
name
- The name.public void setText(java.lang.String text)
text
- The alternate text.public java.lang.String toString()
toString
in class java.lang.Object