This is what I would like to do,
(host)/(appname)/(extra URL element for namespacing)/jforumURLelements)
e.g.
http://localhost:8080/myApp/forum/forums/list.page
/forum/ being the extra namespacing element. JForum seems to have plenty of configuration on board to do something like this (though I do not know if that is the intention of these options). Here's what I have so far (with notes),
- web.xml
<filter-mapping>
<filter-name>clickstream-jforum</filter-name>
<!--
<url-pattern>*.page</url-pattern>
-->
<url-pattern>/forum/*</url-pattern>
</filter-mapping>
<servlet-mapping>
<servlet-name>jforum</servlet-name>
<!--
<url-pattern>*.page</url-pattern>
-->
<url-pattern>/forum/*</url-pattern>
</servlet-mapping>
(if JForum URLs are revised in this way, then this is a nice mapping. Though it may affect code elsewhere?)
- System Globals
forum.link =
http://localhost:8080/forum/jforum
(in simpler configurations I found this affected the links, and does change them as I wish)
homepage.link =
http://localhost:8080/forum/
(seemed deductive?)
# If "true", all redirect URLs will include the value of "redirect.base.url" as prefix
#redirect.absolute.paths = false
redirect.absolute.paths = true
(wouldn't have touched this to start with, tried without, but here as reference)
# This property is only used when redirect.absolute.paths = true. You can use
# it to force a redirect prefix other than forum.link. It is specially useful
# when using proxied.context.path
#redirect.base.url = ${forum.link}
redirect.base.url =
http://localhost:8080/forum/jforum
(wouldn't have touched this to start with, tried without, but here as reference)
# In case you're using mod_proxy or something similar, you can set this
# property to force JForum to use a specific context path.
#
# Leave it blank if you don't need to use it.
#
# Note that if you set this property, you will also want to properly
# set "forum.link" to use the same context path.
proxied.context.path =
http://localhost:8080/forum/jforum
(this one seems key. Looking at code, this configuaration option seems to be a complete substitution for any path derived from
servlet data)
I've also tinkered with the templates path, but simpler configurations suggest this is not the problem.
I'm also aware that these changes may affect directory structure but, being new to
Java, I don't have those effects to hand. I found a post elsewhere on CodeRanch which explained
Tomcat, failing to find a sevlet at an expected location, would look, before giving up, in web root too. This gives me some hope this is possible, by a combination of configuration and directory organisation...
(Why not use a rewriter? I'm using
http://tuckey.org/urlrewrite/ at the moment, but this would be nice and robust)