}
protected Template handleRequest(HttpServletRequest request, HttpServletResponse response, Context context) throws Exception
{
final HttpSession httpSession = request.getSession();
final Session session = new Session(httpSession);
//<todo>this should definitely not be placed here
if(session.getLocale() == null || session.getLocale().getLanguage() == null || session.getLocale().getLanguage().equalsIgnoreCase(""))
{
session.setLocale(java.util.Locale.ENGLISH);
}
else
{
try
{
ResourceBundle sk = ResourceBundle.getBundle("org.infoglue.cms.applications.PresentationStrings", session.getLocale());
if(!sk.getLocale().equals(session.getLocale()))
{
session.setLocale(java.util.Locale.ENGLISH);
}
}
catch (Throwable e)
{
logger.error("Error:" + e.getMessage() + " - setting locale to english");
session.setLocale(java.util.Locale.ENGLISH);
}
}
//</todo>
if(session.getLocale() == null || session.getLocale().getLanguage() == null || session.getLocale().getLanguage().equalsIgnoreCase(""))
{
context.put("ui", LabelController.getController(java.util.Locale.ENGLISH));
//context.put("ui", getStringManagerChain(java.util.Locale.ENGLISH));
}
else
{
context.put("ui", LabelController.getController(session.getLocale()));
//context.put("ui", getStringManagerChain(session.getLocale()));
}
context.put("formatter", new VisualFormatter());
context.put("converter", new ValueConverter());