• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

What are Spring/MVC naming conventions?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am setting up my application and was wondering if there are best practices as far as mapping spring dispatch servlets and naming conventions in today's Spring MVC applications. For example, back when I was using Struts all the actions had a .do extension and that's how they mapped to the Struts servlet. Is this still the convention with Spring MVC or is it more path based now?

How about when creating REST services? Should the servlet be mapped with some sort of a common extension or using path conventions?

I noticed that some examples map using "/", however, that does not work when static resources such as images or JavaScript needs to be accessed as everything goes to the servlet for processing and creates exceptions.

Thanks.
-AP_
 
Sheriff
Posts: 67695
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my opinion, using .do brands you as either a n00b, or someone who is stuck in the past.

It was a silly convention in the first place, and even sillier today.
 
Alex Paransky J
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply, but it would also be nice if you could let me know what are the conventions today. I already said that "back when I was using Struts", that is what was done. What is the convention or best practices now?

Like I said, when I used "/" my actions worked fine, but when I created some .js the servlet was invoked as well and the resource was not found. Perhaps I am not configuring my view resolvers correctly, this is what I have:



So, when a request for some .js came into the server, it was mapped to InternalResourceViewResolver and did not quite work as expected. Please, do let me know what is the proper way to do these types of mappings in today's applications?

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