12a13,14
> import org.infohazard.maverick.util.XML;
> 
35a38,59
>  * <p>Choosing mode from a request attribute "language" is done by
>  * setting  * request attribute.</p>
>  *
>  * <p>E.g. request.setAttribute("language", "en");</p>
>  *
>  * <p>Default mode can be provided using ShuntingFactory attribute
>  * "default-language".</p>
>  *
>  * <pre>
>  * <maverick version="2.0" default-view-type="document">
>  * <modules>
>  *   <shunt-factory provider="org.infohazard.maverick.shunt.LanguageShuntFactory" default-language="en"/>
>  * </modules>
>  * </maverick>
>  * </pre>
>  *
>  * <p>It is not required to user to supply "default-language" attribute
>  * or to set request attribute "language". If these are not supplied then
>  * the procedure follows as described below. Accept-Language headers are
>  * also used if request attribute "language" or "default-language" does
>  * not give a proper View.</p>
>  *
60a85,92
>     /**
>      * This is used to provide default language for web application
>      */
>     protected final static String ATTR_DEFAULT_LANGUAGE = "default-language";
>     protected String defaultLanguage;
> 
>     public final static String KEY_REQUEST_LANGUAGE = "language";
> 
108a141,163
>             String requestedLanguage;
> 
>             // At first try to find a mode for requested language
>             if (request.getAttribute(KEY_REQUEST_LANGUAGE) != null) {
>                 requestedLanguage = request.getAttribute(KEY_REQUEST_LANGUAGE).toString();
>                 View theView = (View) modes.get(requestedLanguage);
>                 if (theView != null) {
>                     log.debug("Using mode:  " + requestedLanguage);
>                     return theView;
>                 }
>             }
> 
>             // Next we try to determine if there exist mode for default language
>             if (defaultLanguage != null) {
>                 View theView = (View) modes.get(defaultLanguage);
>                 if (theView != null) {
>                     log.debug("Using mode:  " + defaultLanguage);
>                     return theView;
>                 }
>             }
> 
>             // And finally we try to find mode based on Accept-Language header
> 
179c234
< 	 * Does nothing.
---
> 	 * Provides default language to web application.
182a238
>         this.defaultLanguage = XML.getValue(factoryNode, ATTR_DEFAULT_LANGUAGE);
