Your suggestions are ok for processing requests but are not to write urls (how to determine correct url) in jsps or other presentation layer output. To handle both sides a more sophisticated solution is needed.
2017. dec. 28. 10:19 ezt írta ("Yasser Zamani" <yasserzam...@apache.org>): > > > On 12/28/2017 12:21 AM, Tamás Barta wrote: > > For example there is a web application which has a LoginAction action. On > > one site it is needed to access it via /login, on the other site > /user/log. > > > > It is just an example. The urls shouldn't be hard-coded in action > > annotations as I don't want to clone the web application just to change > > urls. > > I think you can do these in several layers. At web server layer [1]. > Simpler, at Servlet layer [2] or more harder, at Struts layer like [3]. > It seems you just need rewriting url before Struts and if I were you, I > tried [2], a Servlet filter before Struts filter. > > [1] https://en.wikipedia.org/wiki/Rewrite_engine#Web_frameworks > [2] http://tuckey.org/urlrewrite/ > [3] > https://github.com/apache/struts/blob/master/plugins/ > rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java#L188 >