Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Need help regarding a Spring MVC application

 
Ranch Hand
Posts: 33
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to create a simple Spring MVC application in netbeans IDE. However I got 404 error while I clicked the click hyperlink, please help me. The codes are as follows...

index.jsp
-----------
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">;

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Spring Web MVC Sample</title>
</head>

<body>
<a href="hello.html">click</a>
</body>
</html>

hellopage.jsp
---------------------
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Message is : ${message}</h1>
</body>
</html>

redirect.jsp
------------------
<%@page contentType="text/html" pageEncoding="UTF-8"%>


HelloWorldController.java
-------------------------------


dispatcher-servlet.xml
------------------------------------


web.xml
---------------
 
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where is hello.html page? I suppose you are trying to call "hello" resource on controller through index.jsp page. I think this is not right way to call. You need to call controller on the action of something.

may be like:


also your controller should have mapping to hello.html instead of hello.
 
    Bookmark Topic Watch Topic
  • New Topic