Creating Spring MVC Template Project
I am trying to create a Spring MVC template project according to the Spring Pro 3 book, chpt 16. It indicates to create a Spring Template Project, then select Spring MVC project then enter the name and base package. This is supposed to create a basic project with a hello world jsp page. I don't even get the webapp directory.
As per the book, I added the following dependencies to the POM for the JPA backend:
HTML Code:
<!-- JPA backend -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.8.Final</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.160</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>10.0.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time-hibernate</artifactId>
<version>1.3</version>
</dependency>
<!-- JMS
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms-api</artifactId>
<version>1.1-rev-1</version>
</dependency>
-->
I set the server to VMware vFabric tc Server Developer Edition v2.7
I am using STS 3.1.RELEASE. As I said, there is no webapp directory created and no automatically created home.jsp file which print a Hello World message with the date and time.
Thanks
Mike
Spring MVC tempate project
Quote:
Originally Posted by
srujana
Hi,
I am also facing the same issue. In my case, instead of getting the project name it is adding the base package name.
That is , my project name is LoginProject and base package is com.sample.login.
if I give the URL like "http://localhost:8080/login, then it is able to display home.jsp content on browser.
if I give URL like "http://localhost:8080/LoginProject, I am getting 404 error.
I am not able to find, how it is happening. Could anybody help me on this?
I can't even get the home page if I put in the correct URL.
Creating MVC template project
So I am going to proceed with this project via Eclipse since no one has yet provided a solution as to why it won't work in SpringSource. One thing I noticed in doing this in both Eclipse and SpringSource is that when I define my base package, it only seems to take 3 components, i.e. if I define my base as com.apress.prospring3.ch17 I get a base package of com.apress.prospring3. So to try to stay in synch with the book, I've used a base package of com.prospring3.ch17 so the hello.jsp page is displayed at http://localhost:8080/ch17 instead of http://localhost:8080/prospring3 when I use the base package of com.apress.prospring3.ch17. I wish SpringSource 2.7 were till available as this is what the book used. Does STS 3.1 limit your base package to 3 levels?
Thanks
Mike