• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Need Spring 3.0 help with annotations/setup

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:




 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic