• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

URL mapping by ActionServletRequest not correct if contexturl is long

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I've been facing a "404 The requested resource () is not available." error when I request the forum list. At first I thought it was the problem described in https://coderanch.com/t/575930 , but it seems to be something different.

The reason why JForum outputs the message is because I did not install JForum in the root - is what I found after quite some research. JForum seems not to be able to handle that?

I've extended the 404 error message with the urlpattern that it is trying to match with, and it seems that it tries the request:
http://localhost:8080/oh/hoihoi/blablabla/forums/list.page
with a url pattern "oh.hoihoi.3". I think it would be very easy to strip of context path including subdirectories... What's the best way to do it? Shall I edit ActionServletRequest or is there somewhere hidden support for this?
[originally posted on jforum.net by anoko]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JForum will not work in any other place but the root context. In order to work in any directory, we have to change all templates and some parts of the code.

Not a hard task, just longer and boring.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx for your answer! Is it not possible to make a configuration setting that tells where the root is, instead of using the server context, and stripping the length of the value of that setting from the uri, instead of stripping the length of the server context?

Disadvantage is that you cannot just move the forum to another server, but that's not possible currently anyway, since you'll have to change the forumlinks.

You can even use the currently available forum.link setting for this, however I can imagine that you want to seperate forum root and forum link and two different settings.
[originally posted on jforum.net by anoko]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm it was actually quite easy to fix. You don't even need a custom setting for it. I have now a jforum version that works in the root, in one subdirectory below and any other number of subdirectories below. The changes I made are below (it's the output of a diff between my version and the 2.1.6 version.. I assume you'll be able to parse it).

I also added the pattern string to the 404 error. This changes the "The requested resource () is not available." message to "The requested resource (forums.error) is not available", which is a little bit more comprehendable and easier to debug.

Below are the changes to ActionServletRequest.java :

Changes to JForum.java:


(edit: little changes that make it somewhat more robust and gives a better description in case of 404)

PS: As you can see, the code even got a bit simpler ;)
[originally posted on jforum.net by anoko]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Err the above post shows another bug:

In the "code" block, there is a link in a comment that says:
"http://server.bla/path/to/jforumcontext/forums/list.page"

jforum changed this into:
http://server.bla/path/to/jforumcontext/forums/list.page
[originally posted on jforum.net by anoko]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So has this patch been applied?
[originally posted on jforum.net by anoko]
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic