3

I'm trying to determine the best way to organize our Maven / Spring web applications and have been looking around to see examples. Unfortunately, they seem to conflict at certain points.

How should the folders be organized in a Spring MVC webapp and what should they be called?

The big differences I see are:

  1. The folder for JSPs.
    • /src/main/webapp/WEB-INF/jsp/ or
    • /src/main/webapp/WEB-INF/views/
  2. The Spring configuration files.
    • /src/main/resources/META-INF/spring/context.xml or
    • /src/main/resources/spring/context.xml or
    • /src/main/webapp/WEB-INF/spring/context.xml
  3. Where assets/resources belong.
    • /src/main/webapp/WEB-INF/images/ or
    • /src/main/webapp/resources/images/ (with a urlrewriter)

The SpringSource samples in their SVN repo are not consistent, although their template for an MVC app uses the following:

  • /src/main/resources/META-INF/spring/
  • /src/main/webapp/resources/
  • /src/main/webapp/WEB-INF/views/

I know this sounds like a petty, possibly unimportant issue, but we have a large team of people who are going to be working independently and we need to make a decision to keep everything understandable. We'd like to follow any standards that exist so that Spring developers coming in can easily jump in.

Thank you.

P.S. Yes, I realize that anyone should be able to handle being told "The views are in the jsp folder." without much ado, but I'm going for standards here, people.

Buns of Aluminum
  • 2,439
  • 3
  • 26
  • 44
  • 1
    folder layouts are like code indenting... there are any number of ways to do it, and everyone has their own favorite. if you dont have a solid requirement for one method, maybe poll your team and come up with a solution that everyone likes (make the team feel involved)... – chrismh Oct 13 '10 at 15:34

1 Answers1

0

I'd go for:

  1. The folder for JSPs.

      * /src/main/webapp/WEB-INF/jsp/
    
  2. The Spring configuration files.

      * /src/main/resources/context.xml
    
  3. Where assets/resources belong.

      * /src/main/webapp/WEB-INF/images/
    

But it doesn't matter so much actually. Pick whichever you like.

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140