• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying Static content in JSP page in Spring MVC

 
meera harikrishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to display static contents in the Webpage: But getting the error as below: Can any one of you please help me out?
I got this error especially after adding the <annotation driven > in application-context.xml


1) web.xml



2) Application Context.xml


3) Folder structure:

Webcontent
meta-inf
resources
images
sample.jsp

web-inf

[b]4)Homepage.jsp


<body>
<img src="<c:url value="/resources/images/sribala.jpg" />"/>

<table class="ex" cellspacing=10 cellpadding=10 width="100%">
<tr>
<td width="40%">
:
:
</body>


[/b]
 
meera harikrishna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Additional Information:

if i remove the <annotation-driven> tag, then i get the 404 error



Folder structure: ( was not properly aligned in the previous message)



Thanks in advance!
 
Craig Walls
author
Ranch Hand
Posts: 363
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with displaying static content in a page. It has everything to do with the fact that <mvc:annotation-driven> turns on, among other things, JSR-303 validation support in Spring MVC. To support that, you need a JSR-303 implementation such as Hibernate's validation in the classpath. If you read the error, that's what it's saying.

When you remove <mvc:annotation-driven> you turn off Spring MVC's ability to map requests to controllers using annotations. Thus, the request you submit is not tied to any controller and you get a 404.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic