|
Milyn-Tinak Version 0.6.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.milyn.servlet.ServletUAContext
Servlet useragent context.
/WEB-INF/lib.
The binaries are located in the "build" folder in the distribution./WEB-INF/lib.
The dependencies are located in the "lib" folder in the distribution./WEB-INF/device-ident.xml but this can be configured
in the deployment descriptor. A sample device-ident.xml can be found in the root
of the distribution/WEB-INF/device-profile.xml but this can be configured
in the deployment descriptor. A sample device-profile.xml can be found in the root
of the distribution<servlet> <servlet-name>aservlet</servlet-name> <servlet-class>org.milyn.some.AServlet</servlet-class> <init-param> <param-name>DeviceIdentUrl</param-name> <param-value>URL</param-value> </init-param> </servlet>or,
<context-param> <param-name>DeviceIdentUrl</param-name> <param-value>URL</param-value> </context-param>checked by Tinak in that order. URL can be a context relative URL or a URL to an external resource i.e. and absolute URL. The ability to define an external URL means that two or more web applications can share the same configuration. It also means that the device recognition data can be stored in a database (or some other format) and accessed as an XML stream via a HTTP request. See "Device Recognition" for more. The default deployment location of the profiling XML module can also be overridden in exactly the same fashion. The name of the parameter in this case is "DeviceProfileUrl".
try {
UAContext uaContext = ServletUAContext.getInstance(HttpServletRequest, ServletConfig);
} catch(UnknownDeviceException unknownDevice) {
// Handle Exception...
}
The UAContext instance can then be used to:
| Field Summary | |
protected static java.lang.String |
CONTEXT_KEY
ServletUAContext session key. |
static java.lang.String |
PROFILES_KEY
Profiles Servlet Context key. |
| Method Summary | |
java.lang.String |
getCommonName()
Get the useragent common name. |
static UAContext |
getInstance(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletConfig config)
Get the Useragent Context for the Servlet request. |
ProfileSet |
getProfileSet()
Get the ProfileSet for the device. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final java.lang.String CONTEXT_KEY
public static final java.lang.String PROFILES_KEY
| Method Detail |
public static UAContext getInstance(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletConfig config)
throws UnknownDeviceException
request - The HttpServletRequest instance associated with the request.config - The Servet Configuration.
UnknownDeviceException - Device match failure.public java.lang.String getCommonName()
getCommonName in interface UAContextpublic ProfileSet getProfileSet()
getProfileSet in interface UAContext
|
Milyn-Tinak Version 0.6.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||