The road so far….

April 7, 2013

Spring Recepies : URI redirection

Filed under: java — Tags: , — Rahul Sharma @ 6:51 pm

We have a application which has gone through a short developments sprints. Things got added and then some got modified or removed etc. During this phase a number of service URLs got added/removed/modified. Now if such an application is getting crawled by Google, the you have a mess to clear about. Clearing such a mess is not easy, some URLs should give 301 to a relevant page which some should show 404 and 500 status errors. More over there can be other requirements from the application like domain/sub-domain redirections eg making http://www.myapp.com to myapp.com, ver1.myapp.com to ver2.myapp.com etc. (more…)

Advertisements

April 21, 2010

Spring: Load resources from any location(Classpath Jar, FilePath etc)

Filed under: java — Tags: , — Rahul Sharma @ 11:47 pm

Loading proper resources esp configuration files, properties files etc is an important aspect of any application. In one of my projects I was supposed to load a resource(configuration file) from a dependency jar but the same resource was also required to be loaded from a specified path location in another part of the same application .  We can do this using the ClassLoader‘s and URL for loading the Classpath resource and using File for the file system resource. OR, we can use spring Resource api to get the difference sort out for us. (more…)