9/19/2017

Dynamic cron expression in scheduled annotation

In spring we use annotation based schedulers to configure the jobs.There are several ways to configure the jobs and among the good option is using cron expression. While configuring cron it expects constant values to be applied not a variable one in cron expression.

Only way to get dynamic cron expression is using property files as like below.Considering the fact property file is already configured in your spring container

@Scheduled(cron = "${app.cron.expression}")
public void myMethod() {
  
}

9/14/2017

Shortcut keys available in eclipse

Eclipse in very important tool if we do any work in java. There are many shortcuts keys available in eclipse to achieve the required functionality.  Click control + shift +L keys together to display all shortcut keys in eclipse.

                                  Control + Shift + L

All the shortcuts will be displayed on the right below of eclipse as like below.
eclipse-shortcuts

8/01/2017

Remove CRLF display in Notepad++

Some times when we open a notepad ++ we use to see some weird display characters appear in each line.This is because editor is trying to highlight the end of the line but this looks strange to us to use it. We can eliminate CRLF by un selecting "View--->Show Symbol-->Show end of Line" option.

CRLF-notepadd++

7/30/2017

Makkal Marunthagam Low cost medicines in Tamilnadu

Makkal Marunthagam is formed under the central government scheme "Jan Aushadhi" . This store sells medicines extremely low cost so that poor people can afford cost effective medicines. There are many store across the country but this is first store in Tamilnadu.  This store located in Sivagangai district.

We can get all kind of medicines in this stores and orders will be delivered with 20 days maximum. Order can be done through online or whatsapp. They have provided whatsapp number and email address for further contact/order.

             Email : svgjanaushadhi@gmail.com
             Phone/Whatsapp : 9788052839

They also introduced android application through that as we can do online ordering as well.

 https://goodboxapp.com/makkalmarunthagamapp          







HDFC bank balance by giving missed call

HDFC bank introduced new feature to their customer, Checking bank account balance through missed call. Now customers don't have to go to bank or ATM to check the bank balance. We can just give a missed call from registered mobile number for the account  and with in few seconds we will get an SMS with bank balance information.

                               18002703333 

7/23/2017

Tricks to reduce javascript load time in webpage

Javascript is plays important role in any web based application.But some times javascript also lead to slowness in the webpages. In order to improve java-script performance we can use following techniques.

1. Add all the javascripts in the bottom of the page instead of adding in the head.
2. Try to combine all the javascripts functions and include through external file instead of including all scripts in main file.

<script       src="ourscript.js"></script>

3. We can minimize the javascript we are using in the application. This will reduce the load time as much.

4. We can also enable  asynchronously down the load script,this option improves the DOM construction during webpage load.

<script   async="async"    src="ourscript.js"></script>

Automatic HTTP to HTTPS redirection in Tomcat

Automatically we can redirect non secure HTTP URL to secure HTTPS URL in tomcat. Any web application to secure the data transfer use to configure https access. Some times even after setting up the https access default http access also available along with https. This could a security thread for the application.

Assuming your already configured HTTPS access for the application , Now we need do the change web.xml in tomcat under apache-tomcat-8.0.36/conf/web.xml to redirect all non http access to https.

<!-- Added to redirect http to https -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Whole Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

Now when we access http://localhost:8080/myapp it will be redirected to https://localhost:443/myapp