Magnus Haraldsen Amundsen wrote:
Hi,
Using the REST-plugin (Struts 2.1.1) and with a requirement for i18n URLs. Is it possible to have a single action that maps to different URLs using the REST-plugin?
Ie.
OrdersController.index() kicks in on both the english and the norwegian word in the URL:
/orders --> OrdersController.index() --> /orders-index.jsp
/bestillinger --> OrdersController.index() --> /orders-index.jsp
Or do I have to implement BestillingerController.index() and bestillinger-index.jsp also?
The REST plugin doesn't support this. Your suggestion of creating a
BestillingerController would work.
Thinking about it a little further, is the requirement that:
- a controller should allow multiple names (eg. with the @Action
annotation); or
- the ActionMapper should support a resource bundle to match the URL
to an action name?
In the next few weeks I'll be sharing a new ActionMapper on GoogleCode
that allows the latter case as the algorithm to select the
action/controller can be plugged-in. In the meantime your only other
option is to create a custom ActionMapper based on the RestActionMapper
though.
regards,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]