Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Status page without login
Status page without login [message #1752248] Fri, 20 January 2017 04:51 Go to next message
Eclipse UserFriend
We'd like to implement a simple page with some status information (e.g. Scout version, JDK version, LIB/JAR versions etc.) which should be accessed without any login/authentication. Is it possible, to display such a page for any anonymous user?
Re: Status page without login [message #1752251 is a reply to message #1752248] Fri, 20 January 2017 05:03 Go to previous messageGo to next message
Eclipse UserFriend
Typically this is done in the web.xml where some or all of the /res/ resources are excluded from access restrictions. The code below is from the scout demo app.

<filter>
    <filter-name>AuthFilter</filter-name>
    <filter-class>org.eclipse.scout.widgets.ui.html.WidgetsUiServletFilter</filter-class>
    <init-param>
      <param-name>filter-exclude</param-name>
      <param-value>
        /res/*
        /path-to-your-status-page
      </param-value>
    </init-param>
  </filter>


This param is interpreted by the WidgetsUiServletFilter that covers the full /* servlet range.

In order to have your status page, simply implement the Bean interface org.eclipse.scout.rt.ui.html.IUiServletRequestHandler.

public class StatusPageUiServletRequestHandler extends AbstractUiServletRequestHandler {

  private final HttpCacheControl m_httpCacheControl = BEANS.get(HttpCacheControl.class);

  @Override
  public boolean handleGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    // serve only /path-to-your-status-page
    String pathInfo = req.getPathInfo();
    if (ObjectUtility.notEquals(pathInfo, "/path-to-your-status-page")) {
      //not handled
      return false;
    }

    // disable caching
    m_httpCacheControl.checkAndSetCacheHeaders(req, resp, null, null);

    // return calculated status page to servlet response...
      
    //handled
    return true;
  }
}
Re: Status page without login [message #1755226 is a reply to message #1752251] Wed, 01 March 2017 05:27 Go to previous message
Eclipse UserFriend
No Message Body

[Updated on: Wed, 01 March 2017 06:26] by Moderator

Previous Topic:Container Menu with Children & Single/MultiSelection
Next Topic:[neon] Problems with server unit test -> @BeforeClass called too late
Goto Forum:
  


Current Time: Fri Jun 13 07:33:27 EDT 2025

Powered by FUDForum. Page generated in 0.27417 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top