Oracle® Globalization Development Kit Java API Reference
10g Release 1(10.1)

B10971-01

oracle.i18n.servlet
Class ServletHelper

java.lang.Object
  |
  +--oracle.i18n.servlet.ServletHelper

public class ServletHelper
extends Object

ServletHelper is a delegate class that provides a bridge between Java servlets and globalization objects. All operations that involve Java servlets are performed using this class.

Since:
10.1.0.2

Method Summary
static oracle.i18n.servlet.ApplicationContext getApplicationContextInstance(HttpServletRequest request)
          Returns an ApplicationContext object associated with the HTTP request object
static oracle.i18n.servlet.localesource.LocaleSource getLocaleSourceInstance(HttpServletRequest request)
          Returns a LocaleSource object associated with the HTTP request object
static oracle.i18n.servlet.Localizer getLocalizerInstance(HttpServletRequest request)
          Returns a Localizer object derived from the HTTP request object
static String rewriteURL(String baseURL, HttpServletRequest request)
          Rewrites a URL based on the rules specified in the application configuration file.This method is used to determine the URL where localized static contents exist.
static String rewriteURL(String baseURL, String name, HttpServletRequest request)
          Rewrites a URL based on the rules specified in the application configuration file.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getApplicationContextInstance

public static oracle.i18n.servlet.ApplicationContext getApplicationContextInstance(HttpServletRequest request)
Returns an ApplicationContext object associated with the HTTP request object
Parameters:
request - an HTTP request object
Returns:
an ApplicationContext object
Throws:
IllegalArgumentException - if ApplicationContext cannot be instantiated.

getLocaleSourceInstance

public static oracle.i18n.servlet.localesource.LocaleSource getLocaleSourceInstance(HttpServletRequest request)
Returns a LocaleSource object associated with the HTTP request object
Parameters:
request - an HTTP request object
Returns:
LocaleSource a LocaleSource object

getLocalizerInstance

public static oracle.i18n.servlet.Localizer getLocalizerInstance(HttpServletRequest request)
Returns a Localizer object derived from the HTTP request object
Parameters:
request - an HTTP request object
Returns:
Localizer object.

rewriteURL

public static String rewriteURL(String baseURL,
HttpServletRequest request)
Rewrites a URL based on the rules specified in the application configuration file.This method is used to determine the URL where localized static contents exist.
Parameters:
baseURL - a URL string
request - an HTTP request object
Returns:
a URL referencing to the localized content
See Also:
rewriteURL(String, String, HttpServletRequest)

rewriteURL

public static String rewriteURL(String baseURL,
String name,
HttpServletRequest request)
Rewrites a URL based on the rules specified in the application configuration file. This method is used to determine the URL where localized static contents exist. The name of rewrite URL rule can be specified when you use non-default multiple rules.

For example, if localized contents are supplied in /images/es/welcome.jpg for Spanish and /images/ja/welcome.jpg for Japanese locales, the baseURL would be /images/welcome.jpg, and the rule defined in the regular expression should be "(.*)/([^\/]+)$" in order that the URL be replaced with the string "$1/$A/$2".

Parameters:
baseURL - a URL string
name - the name of rewrite URL rule
request - an HTTP request object
Returns:
a URL referencing to the localized content

Oracle® Globalization Development Kit Java API Reference
10g Release 1(10.1)

B10971-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.