Suresh KumarPandey wrote:1.NavigableSet<? extends Object> set6=new TreeSet<Integer>();
why this add gives error because i am adding a integer object only which extends Object.
Suresh KumarPandey wrote:2.
NavigableSet<? super Object> set5=new TreeSet<Object>();
Why the add method does not throw compile error here.
Mark Spritzler wrote:There are many approaches to resolve ambiguity.
1) Use @Qualifier next to your @Autowired so you can tell which one to inject by name.
2) Put @Primary on one of the implementations, then Spring will inject that one.
3) Only have one of the two implementations in your classpath at runtime, so that there will ever only be one implementation.
For 3, I have yet to see any good examples of why you would need multiple implementations of a Service or a Repository or a Controller, EndPoint, or any other class that you write.
However, there are cases where you might have multiple DataSources, TransactionManagers, or other infrastructure beans. In which case, you only have option #1, because you can't put @Primary into a class you didn't write and only have the .class of.
IllegalStateException - if this ServletContext has already been initialized
Question from enthuware: enthuware.jwpv6.2.1045:
Which of the following events allow you to access the HttpSession attribute that cause the event to be fired?