HTML

How to Control HTTP Caching in Java Web application using Spring MVC Framework

One of the standard requirement in a secure Java web application is to disallow the back button of the browser or invalid the session if the user hit the back button of the browser. You might have seen this behavior while doing online banking or net banking, almost all the banks don't allow you to use the browser's back button. Your session gets terminated as soon as you hit the back button, and you have to log in again to do any transaction. Btw, Have you ever checked some situation on your Java web application like, if you pressed the back button of your browser after logging in, what happened? You will find that the browser takes you to the previous page.

How to Attach Apache Tomcat Server in Eclipse for Running and Debugging Java Web Application - Steps

Hello Java programmers, If you are doing Java Web development in Eclipse, then you definitely would like to run and debug your Java application right from the Eclipse. To do so, you need to add Apache Tomcat in the Eclipse version you are using, like Eclipse Kepler, Oxygen, Photon, or Luna. Eclipse comes in multiple flavors, like Eclipse IDE for Java Developers, which is suitable for developers doing core Java work and Eclipse IDE for Java EE developers, which is for people doing enterprise Java work, like developing Servlet, JSP and EJB based application in Eclipse. In fact, the Java EE version of Eclipse is also one of the most downloaded software built with Java, so far, more than 1 million programmers have downloaded it.

How to configure Daily Log File Rolling in Java using Log4j - DailyRollingFileAppender Example

Hello guys, today, I am going to share one small but the useful tip about logging in your Java application. If your Java application is a weekly restart, I mean it starts on Sunday and not again on the weekday, then you really want to have separate log files for each day. This helps during troubleshooting and debugging. But If you are facing a problem where your log files are not rolling daily and becoming bigger and bigger after each passing day, making it challenging to search anything in case of any production issue, then it might be that you have not configured your Log4j properly to roll your logs daily.

How to find difference between two dates in Java 8? Example Tutorial

One of the most common programming task while working with date and time objects are calculating the difference between dates and finding a number of days, months, or years between two dates. You can use the Calendar class in Java to get days, months between two dates. The easiest way to calculate the difference between two dates is by calculating milliseconds between them by converting java.util.Date to milliseconds using the getTime() method. The catch is converting those milliseconds into Days, Months and Year is not tricky due to leap years, the different number of days in months, and daylight saving times.