All Examples
 
You will need to copy the extra "Survey.html" file to the document root of your WebLogic Server, and request it from the web browser, instead of the virtual servlet name directly.
Note that this servlet requires an initArg registration that specifies where to store the survey results. This is set to "/weblogic/myserver" in the example registrations below. You will need to make sure this directory exists and that the WebLogic Server has write permissions to this directory.
With WebLogic, your servlets can take advantage of all of WebLogic's services. For servlets that use databases via JDBC, check out the servlet examples in the examples/htmlkona directory.
$ javac -d %SERVLET_CLASSES% *.javawhere %SERVLET_CLASSES is an environment variable that is set when you set up your development environment. It points to a directory in the servlet classpath.
weblogic.httpd.servlet.classpath=c:/weblogic/myserver/servletclasses(Where c:/weblogic is the directory containing your WebLogic Server installation.)
weblogic.httpd.register.virtualName=fullPackageName
For example, this is how you would register the PhoneServlet. In addition to the servlet itself, we also register an initialization parameter for the PhoneServlet, which gives a path to its data file. (Not all the servlets use initialization parameters)
  weblogic.httpd.register.phone=examples.servlets.PhoneServlet
  weblogic.httpd.register.phone=\
      phonelist=c:/weblogic/src/examples/servlets/phonelist
(Where c:/weblogic is the directory containing your WebLogic
Server installation.)
You should find a similar section to the listing below in your weblogic.properties file, where the example servlets are registered.
weblogic.httpd.register.phone=examples.servlets.PhoneServlet
weblogic.httpd.initArgs.phone=\
        phonelist=/weblogic/examples/servlets/phonelist
weblogic.httpd.register.snoop=examples.servlets.SnoopServlet
weblogic.httpd.register.cookies=examples.servlets.CookieCounter
weblogic.httpd.register.error=examples.servlets.ErrorServlet
weblogic.httpd.register.applet=examples.servlets.AppletServlet
weblogic.httpd.register.helloWorld=examples.servlets.HelloWorldServlet
weblogic.httpd.register.helloKona=examples.servlets.HelloKonaServlet
weblogic.httpd.register.page=examples.servlets.PageEvent
weblogic.httpd.initArgs.page=\
        imageurl=/weblogic/examples/images/trans.gif
weblogic.httpd.register.session=examples.servlets.SessionServlet
weblogic.httpd.register.simple=examples.servlets.SimpleServlet
weblogic.httpd.register.simpleFormServlet=examples.servlets.SimpleFormServlet
weblogic.httpd.register.survey=examples.servlets.SurveyServlet
weblogic.httpd.initArgs.survey=\
        resultsDir=/weblogic/myserver
For more help with registering servlets, see the WebLogic Administrators Guide document, Setting WebLogic properties.
http://WebLogicURL:WebLogicPort/virtualNameFor example, here's how you load the PhoneServlet in a browser running on the same NT host as your WebLogic Server, on port 7001:
http://localhost:7001/phoneThere's more information about running the examples in some of the related class documentation, linked to at the top of this page.