aspose file tools*
The moose likes JForum and the fly likes How do the modulesMapping, templatesMapping, and urlPattern properties work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "How do the modulesMapping, templatesMapping, and urlPattern properties work?" Watch "How do the modulesMapping, templatesMapping, and urlPattern properties work?" New topic
Author

How do the modulesMapping, templatesMapping, and urlPattern properties work?

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Does anyone know where I could get more information about how the modulesMapping, templatesMapping, and urlPattern properties files all work together?

I'm looking to add a couple new pages and I'm not sure how to formulate the entries in the properties files.

Thanks,
Jason
[originally posted on jforum.net by marlingj]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Take a look at:

http://www.jforum.net/posts/list/4159.page#17143

As for the urlPattern.properties, this is a way of mapping module/action arguments to names.

For example, let's look at the URL: http://www.jforum.net/posts/list/4159.page

The module is "posts" and the action is "list" and there is only one argument between the action and the .page servlet extension. So, the urlPattern that is used is posts.list.1. Since the ServletRequest is wrapped in an ActionServletRequest class, the "4159" part of the url can be retrieved by code like:

int topicId = this.request.getIntParameter("topic_id");

FWIW, this also defines the parameter tags to use if you want to use the older parameter syntax. E.g.:

http://www.jforum.net/jForumServlet?module=posts&action=list&topic_id=4159


[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Thanks for the quick reply, that was impressive. Your comments pretty much confirm what I was understanding from looking through the code.

Actually, the comments in the code were also very helpful in piecing it all together, so if anyone else is confused like I was I would suggest looking there. The net.jforum.UrlPattern class has some particularly useful info regarding how the modules, actions, and urlPatterns all tie together.
[originally posted on jforum.net by marlingj]
 
wood burning stoves
 
subject: How do the modulesMapping, templatesMapping, and urlPattern properties work?