Skip to content

Commit

Permalink
IVIS-46: - Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanPopenko committed Nov 1, 2016
1 parent 472d24f commit 47b178c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 0 additions & 2 deletions docs/sdk/routines/access_to_protected_resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ XML config
You need write in web.xml following.

.. code-block:: xml
:linenos:
<filter>
<filter-name>ivisAuthorizedFilter</filter-name>
Expand All @@ -53,7 +52,6 @@ Tag
To know if user login on JSP you can invoke special tag <ivis:authorized> with optional parameter role.

.. code-block:: jsp
:linenos:
<%@taglib prefix="ivis" uri="ivis.sdk" %>
Expand Down
12 changes: 12 additions & 0 deletions docs/sdk/routines/code/BeansContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import javax.servlet.Filter;
import com.imcode.imcms.addon.ivisclient.oauth2.IvisAuthorizationCodeResourceDetails;
import imcode.services.utils.builders.CollectionBuilder;
Expand Down Expand Up @@ -53,4 +54,15 @@ public Filter ivisAuthorizedFilter() {
return new IvisAuthorizedFilter();
}

@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
return (container -> {
ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/unauthorize");
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404.html");
ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500.html");

container.addErrorPages(error401Page, error404Page, error500Page);
});
}

}

0 comments on commit 47b178c

Please sign in to comment.