2012-05-05 51 views
1

我想將xslt視圖添加到我的spring web應用程序中。但是我的web應用程序使用spring註釋進行配置,因此它沒有任何明確聲明的視圖解析器。我試圖添加一個專門用於xslt的視圖解析器,但我的應用程序的其餘部分變得無法解析。它只能使用註釋來配置xslt視圖嗎?或者可能有另一種解決方案?spring xslt視圖

謝謝。

回答

0

我猜想只要在xml上下文中有<mvc:annotation-driven />就可以編寫ViewResolver類並將其註釋爲@Component

+0

謝謝你的回覆。我找到更好的解決方案爲了保持視圖的註解配置,我爲xslt視圖顯式聲明瞭InternalResourceViewResolver和resolver。 InternalResourceViewResolver的配置在這裏[link](http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-viewresolver-chaining)。所有視圖都被正確解析。作爲一項規則,我應該在提問之前三思考:) – Alberto