Announcement Announcement Module
Collapse
No announcement yet.
RequestMapping value attribute as string array Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RequestMapping value attribute as string array

    Hi, is it possible to pass mapping paths as array? I tried this, but with no success:

    Code:
    private static final String[] COMMISSION_LIST =
    {"commissionList.htm", "openCommissionList.htm", "closeCommissionList.htm", "stornoCommissionList.htm"};
    
    ...
    
    @RequestMapping(value=COMMISSION_LIST, method=RequestMethod.GET)
    ... compiler says: incompatible types - found: String[], required: String

    but this works:

    Code:
    @RequestMapping(value={"commissionList.htm", "openCommissionList.htm", "closeCommissionList.htm", "stornoCommissionList.htm"}, method=RequestMethod.GET)
    Any idea how to get it work, please? (I know that I can use the latter code, but I need to use COMMISSION_LIST on few other places, so it should be less error prone if I can use array constant).

    Best regards, Pavla Novakova

  • #2
    afaik, you can't include variables in an annotation

    http://darkforge.blogspot.com/2008/0...t-default.html

    but it would come in handy at times, perhaps someone has an example with a custom annotation?

    Comment

    Working...
    X