pak
Sep 2nd, 2004, 03:02 AM
Hi,
How do I configure views via the xxx-servlet.xml file?
For example, say I am making a web-app for inventory control of a store which sells "books", "magazines", and "music CDs". Each of these items has its own set of controllers and its own views (JSPs). I want the JSPs to be in a sub-directory structure under WEB-INF, with the "book" views, and the "magazine" views in separate sub-directories etc.
But the only example "view resolver" configuration I have seen allows only for the JSPs to all sit in the same directory - and I can't work out how to configure resolving to different locations.
Eg. I have seen this sort of view resolver configuration for InternalResourceViewResolver. But all the JSPs need to sit in "/WEB-INF/jsp/", and I can't see how to have some views in subdirectories of this.
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
Thanks for any help,
Peter
How do I configure views via the xxx-servlet.xml file?
For example, say I am making a web-app for inventory control of a store which sells "books", "magazines", and "music CDs". Each of these items has its own set of controllers and its own views (JSPs). I want the JSPs to be in a sub-directory structure under WEB-INF, with the "book" views, and the "magazine" views in separate sub-directories etc.
But the only example "view resolver" configuration I have seen allows only for the JSPs to all sit in the same directory - and I can't work out how to configure resolving to different locations.
Eg. I have seen this sort of view resolver configuration for InternalResourceViewResolver. But all the JSPs need to sit in "/WEB-INF/jsp/", and I can't see how to have some views in subdirectories of this.
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
Thanks for any help,
Peter