If you are using Tomcat and an exploded WAR deployment, you can try this: I believe Tomcat will choose classes from the WEB-INF/classes subdir before it picks one from a jar in WEB-INF/lib. Put your replacement .class file in a subdir of WEB-INF/classes corresponding to the package.
I'm not sure if even closer to the ideal world this would have been one of the functions which we would have anticipated the need to be replaceable and would have thought to define an interface and injection point for. --a. On Fri, 2007-06-22 at 13:00 -0700, Sam Neth wrote: > I want to describe the one customization I have applied to Roller, and > ask if there's a better way to accomplish it, either in 3.1 or 4.0. > > The "anchor" generated for blog posts (which appears in the url) is not > to my liking. I don't want extra words stripped out, I want dashes > rather than underscores (widely regarded as preferable for Google SEO), > and I'd like to apply some special rules (e.g. replace ampersand with > the word 'and'). Basically I want better-looking URLs. > > To accomplish this, I modified > org.apache.roller.pojos.WeblogEntryData.createAnchorBase to do things my > way, and patched roller-business.jar. It's an embarassing hack. I > think I tried using a patch jar and ran into classloader security > problems, but it's been a little while. I think maybe I could fix that > if I put my patch jar in a dark place it doesn't belong. > > Anyway, in an ideal world I'd like to compile a single subclass against > the Roller jars, run a patch jar over the release build, and make a > single configuration change to tell Roller to use my new class. > Scratch that. In an ideal world I'd like something as arbitrary as > createAnchorBase to be explicitly implemented as a customization point. > > Any thoughts?
