Remote servlets can be loaded by:
NOTE: Remote servlets can have security implications. For more
information, see Servlet Sandbox.
Identifying Servlets
Servlets are identified by <servletName> which is either:
Servlets can be invoked by a client in the following ways:
The server gets a request for a document, looks up the configuration parameters, finds out that the document is not a static document residing on the disk, but a live document generated by a servlet object, and forwards the request to the servlet which services the request by generating the output. This method is the same as used by traditional web servers for invoking CGI scripts.
The client invokes the servlet with a URL of the form:
http://server_host_name/servlet/<servlet URL>where the <servlet URL> is a regular URL that points to the location of the servlet. The host where the servlet resides might be different from the host where the server is running. In this case the servlet class will be dynamically downloaded to the server, instantiated, and then run. The reason this invocation is useful is that it does not need any special understanding of servlets on the part of the browser.
Any file ending with .shtml is a server parsed file. In .shtml, if a servlet tag or server-insert tag is present, then the server will run the servlet and insert the output generated by the servlet in the place of the insert tag.
Servlets can be dropped in to the servlets/ directory relative to the root of the server. Servlets placed in this directory can be invoked using their class names. (For example, if HelloWorld.class was placed in the server_root/servlets directory):
http://server_host_name:8080/servlet/HelloWorld
A class_file.initArgs file can be placed in the same directory for passing init args to the servlet in question. For example, to pass two initial arguments A=B and C=D to the HelloWorld servlet, a HelloWorld.initArgs file must be created in the extensions directory whose syntax would be:
A=B
C=D
When Servlets are recompiled in this directory, the new version will be
automatically loaded by the server.
This happens when a servlet is configured to be invoked when a particular mime type is set as the response. See the Filters and Servlet Chaining section for more on this topic.
Top java-server-feedback@java.sun.com |
Copyright © 1997
Sun Microsystems, Inc. All Rights Reserved. |