• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JForum nice urls (as on Java Ranch)

 
Lyndon Smith
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I see that Java Ranch is using JForum...

I want to use JForum for my sites too.

I see that Java Ranch has nice SEO friendly urls. My question is:

How is this done, I don't think it is a standard JForum feature.

Any ideas/advice would be appreciated.

BTW, I have made JForum work with Firebird 2 database so if any one is interested I can help there.

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lyndon,

Welcome to JavaRanch!

Our forums are running on a heavily modified version of JForum 2. The pretty URLs are just one of the many features that were added in-house.

At this point we don't think the JForum team is interested in our changes, because they've moved on to JForum 3 with a rather different architecture, and we have not yet decided whether to share our version as a fork. If we choose to do so, we'll announce it here.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33700
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lyndon Smith wrote:How is this done, I don't think it is a standard JForum feature.

Any ideas/advice would be appreciated.

I wrote a filter that delegates to a bunch of classes that do convert to/from the URLs. The idea was to not have to change the JForum core code - it still deals with the original URLs. It's 9 classes of "real" code and just under 100 unit tests. The point being that it's nuisance code to write. It's also very JavaRanch specific, so sharing the code won't help you much. It also depends on some other changes we made to JForum (and no, I don't know which ones), so you couldn't use it anyway.

On a high level, the filter calls an implementation of HtmlParser's (open source library) NodeVisitor. For the URLs that we want to change, it delegates to a UrlPatterns classes that converts into/from the desired format. The catch is that you can't change all URLs because you need to leave user posts, ads, etc alone.

HUGE CAVEAT: If I was implementing this feature again, I would not do it this way. It isn't the easiest code to maintain and has a lurking issue that when you add certain features, you need to remember to add the reg exps. The only reason I did it this way was because we thought we might want to upgrade JForum 2.X since it was such a long term project. Turns out we changed too much to do that easily anyway and JForum 3 is completely different. Our fork is now our own and only based on JForum. If I was doing this again, I'd change the URLs in the source code - at least on the outgoing side. Doing the regexp transformation on the incoming side is *much* easier.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow. I was not aware that there were many modifications. Hats off.

If I was implementing this feature again, I would not do it this way


I find myself saying that everytime (well almost) I finish writing code. Hind sight indeed has 20/20 vision
 
Lyndon Smith
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help guys.

It sort of looks like Jforum 2.1.8 is a final version for JForum 2 does it not?

Maybe I should just add a url column to each table I want to have SEO friendly urls...

I did this on my ebook site that I am writing. I originally wrote the ecommerce software in 2002, it uses Struts 1.

I hold the url on the database and it works a treat. Take a look at http://www.ebookshot.com (it's NOT live yet).

Or maybe I'll just live with the standard urls, they're not so bad...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33700
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lyndon Smith wrote:It sort of looks like Jforum 2.1.8 is a final version for JForum 2 does it not?

Correct
 
ankur rathi
Ranch Hand
Posts: 3830
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friendly URLs can be configured in Web Server. I just heard it. I have no more information. Sorry.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friendly URLs can be configured in Web Server.

JForum creates its own URLs - neither any web server nor the servlet container can do anything about them.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic