This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Spring 3.0 help with annotations/setup

 
laura mccord
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Thanks
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the URL you are trying?

/sampleAjax/view/getResources

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.

Mark

 
laura mccord
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to access my application like this: http://mycompany.com/sampleAjax/ 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 ${content.name} instead of the value of what is inside.

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




 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic