The following line does not compile, due to HashMap taking two generic parameters (as said by Tom G in a comment)
@ModelAttribute("dslrErrors") HashMap<?> dslrErrors;
Simply said, I would expect something along the lines of:
@ModelAttribute("dslrErrors") HashMap<?,?> dslrErrors;
The first parameter is the key, the second parameter is the value.
An example of how the above would like in an instantiation situation:
HashMap<?,?> myMap = new HashMap<String, String>();
And one last note to add to that; unless you need hashmap specific methods, prefer to use the interface as a best practise, as it makes it easier to switch implementation without changing alot of code
Map<?,?> myMap = new HashMap<String, String>();
@ModelAttribute("dslrErrors") Map<?,?> dslrErrors;
As for the other line of code;
dslrErrors = (HashMap<>)dslrHashMap.get("dslrErrors");
I can think of 2 ways ontop of my head (don't have an editor in front of me at the moment to verify:
dslrErrors = (HashMap)dslrHashMap.get("dslrErrors"); //no diamond <> operator in the cast
dslrErrors = (HashMap<Object, Object>)dslrHashMap.get("dslrErrors"); //note how we specify the type in the diamond operator here
I hope this helps you. Feel free to ask if any question remains.
Some source about programming to an interface: Program to an interface