cancel
Showing results for 
Search instead for 
Did you mean: 

Add jsp into wcmqs spring framework

mangar
Star Contributor
Star Contributor
I want to add a Spring Controller to the wcmqs framework.  so I add:

   <import resource="sammy-context.xml" />
to web-application-config.xml

then sammy-context.xml is:

  <bean name="hello" class="com.sammysblog.web.controller.HelloController">
     <property name="webSiteService">
         <ref bean="webSiteService" />
   </property>
  </bean>

how do I map this bean to say "hello.html"?

I can get it to work with a servlet-mapping in the web.xml,  but then of course I have no access to the webSiteService bean.

How is this done?
1 REPLY 1

mangar
Star Contributor
Star Contributor
The answer is:

  Just add a mapping in wcmqs-webapp-context.xml like this:

    <!– Handle assets retrieved by short URLs –>
    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="order" value="0" />

       <property name="mappings">
            <value>
                /asset/**=assetController
                /hello.htm=helloController
            </value>
        </property>

and /hello.htm  will be mapped to your bean.