File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Need Spring 3.0 help with annotations/setup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Need Spring 3.0 help with annotations/setup" Watch "Need Spring 3.0 help with annotations/setup" New topic

Need Spring 3.0 help with annotations/setup

laura mccord
Ranch Hand

Joined: Feb 10, 2009
Posts: 108
I'm trying out the new Spring 3.0 but I'm having some trouble getting everything working together. I basically need help figuring out how to get the "view.jsp" to show up. When I restart tomcat I can see that the Autowired setter is working because I get the output "Sample Service has been set".

I have a project called "sampleAjax"

Here is my web.xml file

my applicationContext.xml file:

my sampleAjax-servlet.xml file:

This is my VIewController

Any suggestions as to what I'm forgetting?

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

What is the URL you are trying?


Based on assuming it is using the RequestMapping via Bean NameMapping Handler and using the convention of configuration. I use "view" as meaning ViewController and the getResources part being the method name.

I always get mixed up with the "/" in the front. Is that supposed to be there in the servlet mapping or should it be sampleAjax/*

I tend to go find samples and see if they had a "/" in front or not, and never memorized it.

Try those out and let us know if that helps.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
laura mccord
Ranch Hand

Joined: Feb 10, 2009
Posts: 108
I'm trying to access my application like this: and it automatically goes to the viewController to access /sampleAjax/view.jsp

Do you know how to do that?

I had gotten it to somewhat work but I had to access the application using /sampleAjax/view.htm based on examples I had used. But then not all of my jsp functionality would work I'm assuming because it had a .htm extension. For example, my method getResources worked and my view jsp would execute but when I tried to access elements in my model hashmap it would actually display ${} instead of the value of what is inside.

Here's a snippet of my view.jsp page:

I agree. Here's the link:
subject: Need Spring 3.0 help with annotations/setup
jQuery in Action, 3rd edition