[opencms-dev] spring mvc / opencms integration

Sebastian Himberger sebastian.himberger at gmx.de
Tue Dec 4 11:07:28 CET 2007

Hi Andy,

it's possible. This is from my spring-<servlet>.xml:

        <property name="mappings">

    <bean id="opencmsViewResolver"
        <property name="viewClass"
        <property name="prefix" value="/opencms/views/"/>
        <property name="suffix" value=".jsp"/>

This is an example JSP inside the OpenCms VFS:

<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<cms:include property="template" element="head"/>


<div class="featureForm">

  <form:errors path="*" cssClass="errorBox" />

  <cms:include file="base-info.jsp"/>

    <legend>Your data</legend>
    <label>Firstname</label><form:input path="firstname"/><br/>
    <label>Lastname</label><form:input path="lastname"/><br/>

    <cms:include file="/views/commons/address-form.jsp"/>


  <p>... privacy statements ...</p>

  <button type="submit">Send</button>


<cms:include property="template" element="foot"/>

I'm currently doing an EJB3/Acegi/Spring/OpenCms 7 project. If you have
further questions don't bother to ask. I'm a bit busy these weeks but it
is my plan to write an article about this as soon as the project is

best regards,

Andy Thompson schrieb:
> anybody have pointers on how to accomplish this?
> currently we have a single web application.  but the view portion of
> the application is divided up into springmvc and opencms.  what i'd
> like to do is to migrate the jsps currently being used by spring mvc
> into opencms.  but i want to continue to use elements that we're
> currently using (spring:bind). 
> i'm relatively confident that i could put the jsps inside opencms -
> and then just point the spring mvc application to where opencms
> exports it's jsps.  but what i'd really like is to be able to reuse
> the header/footer templates inside opencms in my jsps.
> -- 
> Andrew R. Thompson
> Currently in N.Y *not* Consulting
> ------------------------------------------------------------------------
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev

More information about the opencms-dev mailing list