How can I have case insensitive URLS in Spring MVC with annotated mappings

Spring 4.2 will support case-insensitive path matching. You can configure it as follows: @Configuration public class WebConfig extends WebMvcConfigurerAdapter { @Override public void configurePathMatch(PathMatchConfigurer configurer) { AntPathMatcher matcher = new AntPathMatcher(); matcher.setCaseSensitive(false); configurer.setPathMatcher(matcher); } }

Using AutoMapper to unflatten a DTO

This also seems to work for me: Mapper.CreateMap<PersonDto, Address>(); Mapper.CreateMap<PersonDto, Person>() .ForMember(dest => dest.Address, opt => opt.MapFrom( src => src ))); Basically, create a mapping from the dto to both objects, and then use it as the source for the child object.

What is the best way to map windows drives using Python?

Building off of @Anon’s suggestion: # Drive letter: M # Shared drive path: \\shared\folder # Username: user123 # Password: password import subprocess # Disconnect anything on M subprocess.call(r’net use m: /del’, shell=True) # Connect to shared drive, use drive letter M subprocess.call(r’net use m: \\shared\folder /user:user123 password’, shell=True) I prefer this simple approach, especially if … Read more

Jackson Mapper post-construct

Found this thru a link in the comments (credit: fedor.belov). This appears to allow you to run code post construct. Adding a comment for people who end up here via http://jira.codehaus.org/browse/JACKSON-645 or http://jira.codehaus.org/browse/JACKSON-538 and are looking for a method which is called after a deserializer completes. I was able to achieve the desired effect by … Read more

how to map an anonymous object to a class by AutoMapper?

Update 2019-07-31: CreateMissingTypeMaps is now deprecated in AutoMapper v8, and will be removed in v9. Support for automatically created maps will be removed in version 9.0. You will need to explicitly configure maps, manually or using reflection. Also consider attribute mapping. Update 2016-05-11: DynamicMap is now obsolete. Now you need to create a mapper from … Read more

How to efficiently map a org.json.JSONObject to a POJO?

Since you have an abstract representation of some JSON data (an org.json.JSONObject object) and you’re planning to use the Jackson library – that has its own abstract representation of JSON data (com.fasterxml.jackson.databind.JsonNode) – then a conversion from one representation to the other would save you from the parse-serialize-parse process. So, instead of using the readValue … Read more