| Author |
Displaying Static content in JSP page in Spring MVC
|
meera harikrishna
Greenhorn
Joined: Mar 18, 2011
Posts: 5
|
|
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
Joined: Mar 18, 2011
Posts: 5
|
|
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
Joined: Sep 19, 2003
Posts: 301
|
|
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.
|
Spring in Action - Unleash POJO power in your applications!
Modular Java - Discover the secret weapon to modularity on the Java platform!
XDoclet in Action - Your complete guide to code generation with XDoclet.
|
 |
 |
|
|
subject: Displaying Static content in JSP page in Spring MVC
|
|
|