|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--examples.i18n.logging.message.UserSMessagesServlet
UserSMessagesServlet is a simple servlet which shows how to use WebLogic i18n to log your own application's info and error messages to the server log. There is a similar example showing how to do the same thing from a startup class instead of a servlet.
After running the example once, change your host computer's locale from "English" to "German" or "French" and reboot the WebLogic server. Run the example again and note that the example's log messages are displayed in either "German" or "French" depending upon your settings.
The following section describes how to build and run the examples:
Note: Before you build the example add the following entry in your web.xml file located at %WL_HOME%/samples/server/stage/examples/examplesWebApp/WEB-INF/ directory.
where:
<servlet>
<servlet-name>UserSMessagesServlet</servlet-name>
<servlet-class>examples.i18n.logging.message.UserSMessagesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UserSMessagesServlet</servlet-name>
<url-pattern>/UserSMessagesServlet/*</url-pattern>
</servlet-mapping>
We provide a build script for you to build the example, called build.xml.
The script builds the example and places the files in the samples\examples\i18n\logging directory of your WebLogic Server installation.
This script will compile the servlet, process the UserServerSVExample.xml catalog, and produce the logging class. This class contains static methods for logging messages to the WebLogic Server error log.
http://localhost:7001/examplesWebApp/UserSMessagesServlet
First message was logged at 1/5/01. The servlet request was a GET and the number is 32,767. This is not really an error, the example has finished normally.
Copyright (c) 2000-2002 by BEA Systems, Inc. All Rights Reserved.
| Constructor Summary | |
UserSMessagesServlet()
|
|
| Method Summary | |
void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
service() method. |
| Methods inherited from class javax.servlet.http.HttpServlet |
|
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UserSMessagesServlet()
| Method Detail |
public void service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws java.io.IOException,
javax.servlet.ServletException
service in class javax.servlet.http.HttpServletreq - HTTP servlet requestres - HTTP servlet responsejava.io.IOException - if problem occurs with an I/O operationjavax.servlet.ServletException - if problem occurs with servlet operation
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||