• Post Reply Bookmark Topic Watch Topic
  • New Topic

Spring  RSS feed

kate pal
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All ,

I am trying very basic spring application
below is the xml files

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<bean name="/home.htm" class="com.test.controller.testController">
<property name="greeting">
<value>Welcome to Spring Training!</value>

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<property name="suffix">

this is training-servlet.xml

and below is web.xml
<?xml version="1.0" encoding="UTF-8"?>
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"






package com.test.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class testController implements Controller{

public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
return new ModelAndView("home", "message", greeting);
private String greeting;
public void setGreeting(String greeting) {
this.greeting = greeting;

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<% out.println(" ==> home" ); %>

I kept all neccessary .jar in my classpath

when I deploy this application I got
HTTP Status 404 - /springMvc/home.htm


type Status report

message /springMvc/home.htm

description The requested resource (/springMvc/home.htm) is not available.


Apache Tomcat/5.5.26
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at any of the Tomcat logs to see what, if anything, is going wrong? and what is the directory structure of your web app and where, exactly is it located on your machine?
and also check into your tomcat manager to check the status of your application.
[ October 11, 2008: Message edited by: Muhammad Saifuddin ]
Mark Spritzler
Posts: 17309
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the servlet mapping in your web.xml. Maybe it just needs a "/" in from of the URL mapping. That is where I always make my mistakes.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!