• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
 
reply
    Bookmark Topic Watch Topic
  • New Topic