Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a way to map an URL to another URL in Spring?
    primarykey
    data
    text
    <p>In Struts 1 you could have, in struts-config.xml, a declaration like:</p> <pre><code>&lt;action path="/first" forward="/second.do"&gt; </code></pre> <p>Is something similar also possible in Spring, or can I map an URL only to a controller? I am using Spring 2.5.x.</p> <p>I could off course map the URL to the same controller as:</p> <pre><code>&lt;bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt; &lt;property name="mappings"&gt; &lt;props&gt; &lt;prop key="/first.do"&gt;theController&lt;/prop&gt; &lt;prop key="/second.do"&gt;theController&lt;/prop&gt; ... </code></pre> <p>Or maybe use the <code>org.springframework.web.servlet.mvc.ParameterizableViewController</code> and have something like:</p> <pre><code>&lt;bean id="theDummyController" class="org.springframework.web.servlet.mvc.ParameterizableViewController"&gt; &lt;property name="viewName" value="forward:second.do"/&gt; &lt;/bean&gt; &lt;bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt; &lt;property name="mappings"&gt; &lt;props&gt; &lt;prop key="/first.do"&gt;theDummyController&lt;/prop&gt; &lt;prop key="/second.do"&gt;theController&lt;/prop&gt; ... </code></pre> <p>I know I could be complicating things and I should just stick to the simple stuff that gets the job done, but I would like this to be more like a statement of the kind: "this URL is in fact a shortcut (or alias) to this other URL" (don't ask why... long story...) which is somehow visible with the <code>ParameterizableViewController</code> but not completely.</p> <p>So, is this possible?</p> <p>Thank you!</p>
    singulars
    1. This table or related slice is empty.
    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.
    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