Re: Jar for download from the page (same as prettyfaces).

Splash Forums Rewrite Users Jar for download from the page (same as prettyfaces). Re: Jar for download from the page (same as prettyfaces).


Tony Herstell

To finish the puzzle…

package com.entermyevents.configurationProvider;

import javax.inject.Inject;
import javax.servlet.ServletContext;

import org.ocpsoft.rewrite.config.Configuration;
import org.ocpsoft.rewrite.config.ConfigurationBuilder;
import org.ocpsoft.rewrite.servlet.config.HttpConfigurationProvider;
import org.ocpsoft.rewrite.servlet.config.rule.Join;

import com.entermyevents.userManagement.Identity;

public class EnterMyEventsConfigurationProvider extends HttpConfigurationProvider implements NonEnriching {

private Identity identity;

public int priority() {
return 10;

public Configuration getConfiguration(final ServletContext context) {

// The standard annotations on my pages will provide
// "pretty re-write rules".
// e.g.

ConfigurationBuilder config = ConfigurationBuilder.begin();
if (identity.isLoggedIn()) {
// For now I am happy to allow access to all pages...

// config.defineRule().when(Direction.isInbound().and(Path.matches("/some/{page}/.*/"))).perform(Redirect.permanent("/new-{page}/"));

else {
// Check if they are going to one of these "allowed" pages:
// Allowed pages when not logged in
// /entermyevents/users/register
// /entermyevents/error
// /entermyevents/viewExpired
// and if not then force them to the Home (landing) page (where they
// can login)

return config;