Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One probably not a good solution that I can think of is to not provide a suffix, and to explicitly specify the .jsp or .jspx suffix when returning a view name.</p> <pre><code>&lt;bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="order" value="2"/&gt; &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /&gt; &lt;property name="prefix" value="/WEB-INF/views/" /&gt; &lt;property name="suffix" value="" /&gt; &lt;/bean&gt; </code></pre> <p>and when returning a view name:</p> <pre><code>return "myview.jsp"; return "myview.jspx"; </code></pre> <p>OR</p> <p>Another solution if you know the name pattern for your jsp and jspx views names will be to provide the view names as one more parameter to one of the resolvers:</p> <pre><code>&lt;bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="order" value="2"/&gt; &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /&gt; &lt;property name="prefix" value="/WEB-INF/views/" /&gt; &lt;property name="suffix" value="jsp" /&gt; &lt;property name="viewNames"&gt; &lt;list&gt; &lt;value&gt;view1*&lt;/view&gt; &lt;value&gt;view2*&lt;/view&gt; &lt;value&gt;view3*&lt;/view&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>If this viewresolver returns a null if it does not match any of the view patterns it would then go to your jspx view resolver.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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