c++webcppcms

cppcms url dispather with over 4 parameter


I started using cppcms to make a simple website + "service" that gets its input from the path like: /maindb/2012/11/2/finalists/....

now i noticed that the nice url handling has only a regex dispatcher up to 4 parameters that will be given to the called function and a function without regex gets nothing at all not even the path.

Now what is the most feasible way to realize more than 4 parameters / subfolders. Do I have to write my own url handling and if so where do i get the url from?

Is the url class public enough to iherit it and just extend it easiely for longer functions?

Or is there some other way how I am supposed to do it? (because 4 parameters seems kinda very less)


Solution

  • Two points:

    1. If you have subfolders you are probably looking for organizing your URLs into hierarchy. See

      http://cppcms.com/wikipp/en/page/cppcms_1x_tut_hierarchy

    2. If you need more then 4 parameters you should:

      • Check if you really organize your application right (see above)
      • Combine several cases into single regex and split them afterwards in a parameters

        For example (/\d\d\d\d/\d\d/\d\d)/(\w+) where the first would mach the data and not separatly year, month day.

    P.S.: Url dispatcher is not designed to be derived from.