Spring MVC how to display static pages
I am using spring 2.5.6 with MVC. The new site I am working on has static pages, such as home page, simple landing pages etc, along with other CRUD type of pages.
I am having a heck of a time to get the two to work together, so obviously I am doing something very wrong cause it can not be that hard.
So first I started off with the following as an example:
<bean name="/account-landing.html" class="com.account.web.AccountLandingController">
<property name="commandClass" value="com.account.web.AccountLandingCommand"/>
<property name="formView" value="account-landing"/>
<property name="successView" value="account-landing"/>
</bean>
and several others and that worked fine.
Now, I want to introduce the static pages
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mapping">
<props>
<prop key="/home.html">urlFilenameViewController</prop>
[snip]
</props>
</property>
</bean>
<bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewControl开发者_如何学编程ler"/>
and there is a view resolver. All the pages in my application have been converted over to .jsp.
I have looked over the documentation but still not clicking.
Thanks
if you want static pages don't map. put it in a separate folder and access it. after all this is a web app
like http://<ip>/appname/htmls/test.html
精彩评论