Search in sources :

Example 1 with ServletWebRequest

use of org.apache.wicket.protocol.http.servlet.ServletWebRequest in project midpoint by Evolveum.

the class PageLogin method onConfigure.

@Override
protected void onConfigure() {
    super.onConfigure();
    ServletWebRequest req = (ServletWebRequest) RequestCycle.get().getRequest();
    HttpServletRequest httpReq = req.getContainerRequest();
    HttpSession httpSession = httpReq.getSession();
    Exception ex = (Exception) httpSession.getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
    if (ex == null) {
        return;
    }
    String key = ex.getMessage() != null ? ex.getMessage() : "web.security.provider.unavailable";
    error(getString(key));
    httpSession.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
    clearBreadcrumbs();
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) HttpSession(javax.servlet.http.HttpSession) ServletWebRequest(org.apache.wicket.protocol.http.servlet.ServletWebRequest) ObjectNotFoundException(com.evolveum.midpoint.util.exception.ObjectNotFoundException) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) RestartResponseException(org.apache.wicket.RestartResponseException)

Example 2 with ServletWebRequest

use of org.apache.wicket.protocol.http.servlet.ServletWebRequest in project gitblit by gitblit.

the class BasePage method getServerName.

protected String getServerName() {
    ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();
    HttpServletRequest req = servletWebRequest.getHttpServletRequest();
    return req.getServerName();
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletWebRequest(org.apache.wicket.protocol.http.servlet.ServletWebRequest)

Aggregations

HttpServletRequest (javax.servlet.http.HttpServletRequest)2 ServletWebRequest (org.apache.wicket.protocol.http.servlet.ServletWebRequest)2 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 HttpSession (javax.servlet.http.HttpSession)1 RestartResponseException (org.apache.wicket.RestartResponseException)1