开发者

How to mix different types of views in spring configuration?

开发者 https://www.devze.com 2023-01-27 15:04 出处:网络
greetings all i am using jsp as a view technology in my web app <bean class=\"org.sp开发者_如何转开发ringframework.web.servlet.view.InternalResourceViewResolver\">

greetings all i am using jsp as a view technology in my web app

<bean class="org.sp开发者_如何转开发ringframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/views/"/>
        <property name="suffix" value=".jsp"/>
</bean>

and i want to use velocity too as a view technology in sending emails and i want to configure this in the xml file, but i don't know how ?

any ideas how to do this ?


If you want to use Velocity to construct emails, then this is not a "view", as far as Spring MVC is concerned. Views and ViewResolvers are used to render output to the browser.

Spring MVC does provide support for using Velocity as a view layer, but this isn't relevant to what you're trying to do.

However, Spring also provides some support classes to make the clunky Velocity API a bit less awkward to use (see javadocs). These have no relation to the Spring MVC view layer, though. Just use them directly from your code, building the emails and sending them.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号