Difference between Java Servlet and JSP
Servlet is html in java whereas JSP is java in html. Servlets run faster compared to JSP. … JSP is a webpage scripting language that can generate dynamic content while Servlets are Java programs that are already compiled which also creates dynamic web content. In MVC, jsp acts as a view and servlet acts as a controller. Servlet example: Hello.java JSP example: hello.jsp
Convert .class to .java
cd to the folder that contains .class file, type the command below (without .class extension). The class will be de-compiled to java code You’ll see the code of .java file that look like this in the terminal.
How to write an Object to a file
Java object can be written into a file for future reference. This process is called Serialization (translating data structures or object state into a format that can be store). In order to do that, we have to implement the Serializable interface, and use ObjectOutputStream to write object into a file.
Adding JUnit and Hamcrest for Testing in Java
Errors In order to fix it we had to Open Module Settings for that project and manually add jar Dependencies junit-4.12.jar and hamcrest-core-1.3.jar which are contained in the IntelliJ installation lib directory (C://Program Files/JetBrains/lib/xxx.