File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Displaying Static content in JSP page in Spring MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Displaying Static content in JSP page in Spring MVC" Watch "Displaying Static content in JSP page in Spring MVC" New topic
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying Static content in JSP page in Spring MVC
 
Similar Threads
javax.servlet.ServletException: Could not resolve view with name home-- apache Velocity, spring
STS springMVC project how to run on tomcat application
Accessing a static resource
404 error while trying to test spring3 rest service
spring security 3.1 login not working.