Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ocpsoft/rewrite
OCPsoft URL-Rewriting Framework
https://github.com/ocpsoft/rewrite
Last synced: 13 days ago
JSON representation
OCPsoft URL-Rewriting Framework
- Host: GitHub
- URL: https://github.com/ocpsoft/rewrite
- Owner: ocpsoft
- License: apache-2.0
- Created: 2011-06-24T08:51:19.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2024-07-10T15:59:04.000Z (4 months ago)
- Last Synced: 2024-08-01T16:27:45.891Z (3 months ago)
- Language: Java
- Homepage: http://ocpsoft.org/rewrite/
- Size: 8.8 MB
- Stars: 187
- Watchers: 22
- Forks: 86
- Open Issues: 58
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: security-integration-shiro/pom.xml
Awesome Lists containing this project
README
Rewrite [![Build Status](https://travis-ci.org/ocpsoft/rewrite.svg?branch=master)](https://travis-ci.org/ocpsoft/rewrite)
=================================================[![Join the chat at https://gitter.im/ocpsoft/rewrite](https://badges.gitter.im/ocpsoft/rewrite.svg)](https://gitter.im/ocpsoft/rewrite?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A highly configurable URL-rewriting tool for Java EE 6+ and Servlet 2.5+ applications, supporting integration with:
* CDI
* Spring DI
* JodaTime configuration
* Tuckey.org URLRewriteFilter configuration
* JavaServer Faces (JSF)
* JavaServer Pages (JSP)
* Struts
* Wicket
* Grails
* Spring Roo
* Spring Web Flow
* Any servlet & web framework!
* All major servlet containers and application serversGet Help
==========
* Support forum: http://ocpsoft.org/support/forum/rewrite-users/
* Documentation: http://ocpsoft.org/rewrite/docs/Get Started
==========1. It is recommended but not required to remove other URL-rewriting tools from your application before using Rewrite. If you choose to leave them in place, weird things may happen, be warned.
2. Include OCPSoft Rewrite in your application's POM file:
org.ocpsoft.rewrite
rewrite-servlet
${rewrite.version}
Version Reference Table:
-------------------------------------
Jakarta EE 10 | Rewrite 10.x
Jakarta EE 9 | Rewrite 9.x
Jakarta EE 8 | Rewrite 8.x
Java EE <= 7 | Rewrite 3.x3. Add a configuration provider implementing the 'org.ocpsoft.rewrite.config.ConfigurationProvider' interface, or extending from the abstract HttpConfigurationProvider class for convenience:
package com.example;
@RewriteConfiguration
public class ExampleConfigurationProvider extends HttpConfigurationProvider
{
@Override
public int priority()
{
return 10;
}
@Override
public Configuration getConfiguration(final ServletContext context)
{
return ConfigurationBuilder.begin()
.addRule()
.when(Direction.isInbound().and(Path.matches("/some/page/{p}/")))
.perform(Forward.to("/new-page/{p}.html"));
}
}4. You must either annotate your `ConfigurationProvider` class with the @RewriteConfiguration annotation, OR create a file named: '/META-INF/services/org.ocpsoft.rewrite.config.ConfigurationProvider' which contains the fully qualified name of your `ConfigurationProvider` implementation:
/META-INF/services/org.ocpsoft.rewrite.config.ConfigurationProvider
---
com.example.ExampleConfigurationProviderNote that your annotated class won't be found, by default, if your ConfigurationProvider is in a jar inside a war. You can either set the servlet parameter `org.ocpsoft.rewrite.annotation.SCAN_LIB_DIRECTORY` to `true`, or use the ServiceLoader approach instead.
5. Add rules to your configuration. Condition objects such as 'Direction.isInbound()' and 'Path.matches(...)' can be found in the 'org.ocpsoft.rewrite.config.*' and 'org.ocpsoft.rewrite.servlet.config.*' packages.
6. Consider using Rewrite extensions for extra power:
* [JodaTime Integration](https://github.com/ocpsoft/rewrite/tree/master/config-jodatime)
* [Tuckey URLRewriteFilter Integration](https://github.com/ocpsoft/rewrite/tree/master/config-tuckey)
* [CDI Integration](https://github.com/ocpsoft/rewrite/tree/master/integration-cdi)
* And more... read the [Documentation](http://ocpsoft.org/rewrite/docs/)7. Run your application!
BUILDING
========
```
mvn package -PWILDFLY_MANAGED_8
```
(Or use any of the other profiles in pom.xml - Note, most seem to be failing right now due to stale maven packages. Pull requests fixing test proviles are appreciated!)RELEASING
========
See https://github.com/ocpsoft/rewrite/wiki/Releasing#current-processFEEDBACK
========This project is looking for your feedback! What would make your task easier? How can we simplify this experience?
TODO's
======* Continue simplification of Configuration objects and convenience APIs.
* Implement additional xml & file-based configuration support.
* Implement http://localhost:8080/rewrite-status monitoring tool