Sunday, February 3, 2019

How to convert String.class to Class ?

Class<?> classes = String.class;
System.out.println("Classes.getName() is " + classes.getName());
System.out.println("Classes.getSimpleName() " + classes.getSimpleName());
System.out.println("Classes.toGenericString " + classes.toGenericString());

Answer :
-----------

Classes.getName() is java.lang.String
Classes.getSimpleName() String
Classes.toGenericString public final class java.lang.String



Saturday, February 2, 2019

What does > symbol mean in html ?

<body>
What is this ?: {{>status}}
</body>

Answer :
-----------
> symbol means to open the folder, say if it is inside the template folder then open the template folder and if it is status then it means open the status.html page inside the template folder

Exception in thread "main" java.lang.IllegalStateException

When you have input like this below

ApplicationContext applicationContext = new ClassPathXmlApplicationContext();

you get output like

Exception in thread "main" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

Hence you have to define the bean in the ClassPathXmlApplicationContext("SpringBeans.xml");