Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Status page without login
Status page without login [message #1752248] Fri, 20 January 2017 09:51 Go to next message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
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 10:03 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan MotschFriend
Messages: 154
Registered: March 2010
Senior Member
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 10:27 Go to previous message
Andreas Christ is currently offline Andreas ChristFriend
Messages: 32
Registered: April 2016
Member
No Message Body

[Updated on: Wed, 01 March 2017 11:26]

Report message to a 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: Sat Jan 25 07:10:55 GMT 2025

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

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

Back to the top