org.enhydra.barracuda.core.view
Class ViewUtil

java.lang.Object
  extended byorg.enhydra.barracuda.core.view.ViewUtil

public class ViewUtil
extends Object

This class provides utility functions for determining the ViewCapabilities.

Note that currently only the HTML related logic is fully implemented. If you need support for specific versions of WML, CHTML, etc, you may have to add some code here to examine the appropriate headers and map it to the proper types. If you have expertise working with these other flavors of markup and would like to help flesh out support for these languages, email the list and we'll be glad to give you pointers...


Constructor Summary
ViewUtil()
           
 
Method Summary
static ClientType getClientType(javax.servlet.http.HttpServletRequest req)
          Determine the client type by looking at the User-Agent header in the request
static FormatType getFormatType(javax.servlet.http.HttpServletRequest req)
          Determine the format type by looking at the Accept header in the request
static ScriptingType getScriptingType(javax.servlet.http.HttpServletRequest req)
          Determine the what type of scripting is supported by figuring out what kind of browser we're dealing with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewUtil

public ViewUtil()
Method Detail

getFormatType

public static FormatType getFormatType(javax.servlet.http.HttpServletRequest req)
Determine the format type by looking at the Accept header in the request

Parameters:
req - an HttpServletRequest object
Returns:
the appropriate client type (defaults to FormatType.UNKNOWN_FORMAT if we are unable to make a positive match)

getScriptingType

public static ScriptingType getScriptingType(javax.servlet.http.HttpServletRequest req)
Determine the what type of scripting is supported by figuring out what kind of browser we're dealing with. Note that this method does NOT determine whether or not the browser actually has scripting enabled.

Parameters:
req - an HttpServletRequest object
Returns:
the appropriate client type (defaults to ScriptingType.NONE if we are unable to make a positive match)

getClientType

public static ClientType getClientType(javax.servlet.http.HttpServletRequest req)
Determine the client type by looking at the User-Agent header in the request

Parameters:
req - an HttpServletRequest object
Returns:
the appropriate client type (defaults to ClientType.UNKNOWN_BROWSER if we are unable to make a positive match)


Copyright © 2003 BarracudaMVC.org All Rights Reserved.