Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to implement @RequestMapping custom properties
    primarykey
    data
    text
    <p>As an <strong>example</strong>, take <strong>subdomain mapping</strong>.</p> <p>This article: <a href="http://techsravi.blogspot.com/2011/05/managing-multiple-domain-and-sub-domain.html" rel="nofollow noreferrer">Managing multiple Domain and Sub Domain on Google App Engine for Same Application</a> recommends to resolve subdomain on Filter and assign variable to ServletRequest headers.</p> <p>Then the mapping will look like this:</p> <pre><code>@RequestMapping(value = "/path", headers="subdomain=www") public String subsiteIndexPage(Model model,HttpServletRequest request) { ... } </code></pre> <p>If we'd like to create custom @RequestMapping property, such as subdomain, eg. to create mapping like this:</p> <pre><code>@RequestMapping(value = "/some/action", subdomain = "www") public String handlerFunction(){ ... } </code></pre> <p>we should override <code>@RequestMapping @interface</code> definition and <strong>override RequestMappingHandlerMapping</strong> protected methods, with our own implementation<br> (as stated on JIRA: "<a href="https://jira.springsource.org/browse/SPR-7812" rel="nofollow noreferrer">Allow custom request mapping conditions SPR-7812</a>").</p> <p>Is it right? Can anybody provide a hint, how to achieve this functionality?</p> <hr> <p><strong>Idea 1</strong>:<br> As suggested on original jira thread, is to create own implementation of <code>RequestCondition</code></p> <p>There is an project which uses this solution available on github: <a href="https://github.com/rstoyanchev/spring-mvc-31-demo/" rel="nofollow noreferrer">https://github.com/rstoyanchev/spring-mvc-31-demo/</a></p> <p>And related SO question: <a href="https://stackoverflow.com/questions/10073695/adding-custom-requestconditions-in-spring-mvc-3-1">Adding custom RequestCondition&#39;s in Spring mvc 3.1</a></p> <p>Maybe mapping like <code>@Subdomain("www")</code> for both Type and Method, is possible solution?</p> <hr> <p><a href="http://forum.springsource.org/showthread.php?125780-RequestMapping-custom-properties&amp;p=410574" rel="nofollow noreferrer">Link to same question on forum.springsource.com</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload