Announcement Announcement Module
No announcement yet.
Sitemesh and Spring MVC Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sitemesh and Spring MVC

    Just currious if there are any good step by step exampls on how to implement sitemesh and spring. I seen some on freemaker and velosity, but i dont want to use any of those (for now), only confuse me more. I'm a sitemesh newbee, and i done a simple try, but i keep getting a blank page.

    Here are some config:
    <decorators defaultdir="/decorator">
    	<decorator name="default" page="/mydec.jsp">
    <?xml version="1.0" encoding="UTF-8" ?>
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <%@ taglib uri="" prefix="decorator" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">
    		<title>My Site - <decorator:title default="Welcome" /></title>
    		<decorator:head />
    		<decorator:body />
    And my pages worked before i applied the filter


  • #2
    Have a look at the project by Matt Raible. He also uses sitemesh. I found it very easy to use his create new project scripts. You get acegi etc for free :-)


    • #3
      As for blank page, do you have anything in your logs?


      • #4
        I do noet see anything in the log that would point to sitemesh being used.

        There is one thing that grabs my attention, where is your file mydec.jsp. I take it, you placed it in the decorator directory like you write above the pice of code. Then my best bet is that you must be using this line in your decoratos.xml file:

        <decorators defaultdir="/decorator">
        	<decorator name="default" page="mydec.jsp">
        do mind the / in front of te jsp.

        hope that helps


        • #5
          Thanks a million Jettro!

          Just removed the / and it worked.

          Now i can start focus on how to use it the best way