@Override
 public Session newSession(Request request, Response response) {
   SandboxSession session = new SandboxSession(request);
   WebClientInfo info = new WebClientInfo(RequestCycle.get());
   info.getProperties().setTimeZone(TimeZone.getDefault());
   session.setClientInfo(info);
   return session;
 }
Ejemplo n.º 2
0
 /** @see org.apache.wicket.protocol.http.WebRequestCycle#newClientInfo() */
 @Override
 protected ClientInfo newClientInfo() {
   // We will always do a redirect here. The servoy browser info has to make one.
   WebClientInfo webClientInfo = new WebClientInfo(this);
   ClientProperties cp = webClientInfo.getProperties();
   if (cp.isBrowserInternetExplorer()
       || cp.isBrowserMozilla()
       || cp.isBrowserKonqueror()
       || cp.isBrowserOpera()
       || cp.isBrowserSafari()
       || cp.isBrowserChrome()) {
     if (cp.isBrowserInternetExplorer()
         && cp.getBrowserVersionMajor() != -1
         && cp.getBrowserVersionMajor() < 7) {
       // IE6 is no longer supported when anchoring is enabled.
       boolean enableAnchoring =
           Utils.getAsBoolean(
               Settings.getInstance()
                   .getProperty(
                       "servoy.webclient.enableAnchors", Boolean.TRUE.toString())); // $NON-NLS-1$
       if (enableAnchoring) {
         throw new RestartResponseException(
             new UnsupportedBrowserPage("Internet Explorer 6")); // $NON-NLS-1$
       }
     }
     Page page = getResponsePage();
     if (page != null) {
       throw new RestartResponseAtInterceptPageException(
           new ServoyBrowserInfoPage(
               urlFor(page).toString().replaceAll("../", ""))); // $NON-NLS-1$ //$NON-NLS-2$
     } else {
       throw new RestartResponseAtInterceptPageException(
           new ServoyBrowserInfoPage(getRequest().getURL()));
     }
   }
   return webClientInfo;
 }