As of now I'm writing the following tutorials:
- Apache DS step-by-step guide
- Spring Security - LDAP integration
- Spring WS - WSS4J
- Spring Security - Multiple Entry Points
Stay tune! Share the fun :)
|
Share the joy:
|
|
Share the joy:
blogger tutorials
Social Bookmarking Blogger Widget
|
Apache Tiles is a templating framework built to simplify the development of web application user interfaces.
Tiles allows authors to define page fragments which can be assembled into a complete page at runtime. These fragments, or tiles, can be used as simple includes in order to reduce the duplication of common page elements or embedded within other tiles to develop a series of reusable templates. These templates streamline the development of a consistent look and feel across an entire application.
Source: Apache Tiles 2
/notiles/pets - for displaying the pets page /notiles/dogs - for displaying the dogs page /notiles/cats - for displaying the cats pageTo load the pets page, enter the following url:
http://localhost:8080/spring-tiles/krams/notiles/petsTo load the dogs page, enter the following url:
http://localhost:8080/spring-tiles/krams/notiles/dogsTo load the cats page, enter the following url:
http://localhost:8080/spring-tiles/krams/notiles/catsThat's it. We've developed a simple Spring MVC 3 application using standard JSPs.
cats.jsp - a standard JSP dogs.jsp - a standard JSP pets.jsp - a standard JSP detail.jsp - a Tiles JSP main.jsp - a Tiles JSPTo use these templates we need to activate Apache Tiles by declaring the required XML configurations. To do that we need to declare the required Spring configurations as well.
/kramsIn the web.xml we declared a servlet-name spring. By convention, we must declare a spring-servlet.xml as well.
/tiles/pets - for displaying the pets page /tiles/dogs - for displaying the dogs page /tiles/cats - for displaying the cats pageTo load the pets page, enter the following url:
http://localhost:8080/spring-tiles/krams/tiles/petsTo load the dogs page, enter the following url:
http://localhost:8080/spring-tiles/krams/tiles/dogsTo load the cats page, enter the following url:
http://localhost:8080/spring-tiles/krams/tiles/cats
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
|
Share the joy:
blogger tutorials
Social Bookmarking Blogger Widget
|
if user has logged-in for the first time
flag the session that the user has logged-in
if the user tries to log-in again
check if there's a protected URL
if yes, redirect user to a custom page
if no, then proceed with the remaining filters
And here's the actual implementation for this filter.Filter base class that guarantees to be just executed once per request, on any servlet container. It provides a doFilterInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) method with HttpServletRequest and HttpServletResponse arguments.How did we came up with this implementation? I'm sure it didn't just came out from thin air. Actually, I had to study how the CONCURRENT_SESSION_FILTER alias is implemented. It's filter class is based on ConcurrentSessionFilter.
The getAlreadyFilteredAttributeName() method determines how to identify that a request is already filtered. The default implementation is based on the configured name of the concrete filter instance.
Source: Spring Reference 3 for OncePerRequestFilter
Filter required by concurrent session handling package.Let's examine the doFilter() method of this class.
This filter performs two functions. First, it calls SessionRegistry.refreshLastRequest(String) for each request so that registered sessions always have a correct "last update" date/time. Second, it retrieves a SessionInformation from the SessionRegistry for each request and checks if the session has been marked as expired. If it has been marked as expired, the configured logout handlers will be called (as happens with LogoutFilter), typically to invalidate the session. A redirect to the expiredURL specified will be performed, and the session invalidation will cause an HttpSessionDestroyedEvent to be published via the HttpSessionEventPublisher registered in web.xml.
Source: Spring Security 3 Reference for ConcurrentSessionFilter
http://localhost:8080/spring-security-single-login-filter/krams/auth/loginThen access the following URL:
http://localhost:8080/spring-security-single-login-filter/krams/main/commonYou can only access the URL once! Here's what you'll get if you try again:
|
Share the joy:
blogger tutorials
Social Bookmarking Blogger Widget
|