Category: Java Frameworks
Java | Execute SQL script using Maven
Whenever there is a change in the database whether we are altering database structure or adding/updating data inside database most of the times we create a script file and run it manually. We can automate this process using Maven. Solution:
Linux | Configure Tomcat service in linux
Running Tomcat as a service in Linux: For security reasons you should not run Tomcat as root service. It is better to create a new user and run Tomcat under it. Create a file with the script: $ sudo vi
Moodle/Totara | HTML Editor doesn’t show up on summary area
If HTML editor does not show up on summary area verify whether the editor has been enabled using the admin login to Moodle / Totara. This can be verified by checking the following points (in no particular order): 1. Is
Salesforce | Refresh the parent window automatically on closing the child window
On closing child popup window (on click of a button), we wanted to refresh the parent window automatically to check the updates. We can refresh the parent window on closing the popup window by using javascript. Syntax : This is
Java | Check if domain of an email address is valid or not
To Check if the domain of an email address is valid or not, pass the email address to the below method as an argument and execute it, it will return true or false by checking if the email id you
PHP | Sorting Complex Multidimensional Array
Suppose we have a complex array like below: $products = array( array( ‘product’ => array(‘id’ => 1, ‘name’ => ‘Jquery tutorial book’), ‘product_details’ => array(‘cost’ => 10, ‘edition’ => ‘first’) ), array( ‘product’ => array(‘id’ => 2, ‘name’ => ‘javascript
How to create a dynamic div using Javascript
Here is sample code if you want to create a dynamic div using Javascript: <script type=”text/javascript”> divCount =0; function createDiv() { var divTag = document.createElement(“div”); var studList =””; studList += ‘<select id=”BOX_’+divCount+'” name=”BOX_’+divCount+'”>’; studList += ‘<option value=””>— Select —</option>’; for(i=0;i<countStud;i++)
Javascript | Unable to get content of HTML while converting HTML page to PDF
Problem : Unable to get content of HTML while converting HTML page to PDF. Solution : You can use the javascript if you want to get content of HTML while converting it into PDF : <HTML> <head> <script type=”text/javascript”> function submitForPDF() {
HTML text box should only accept numbers and dot
You can use the following javascript code to check textbox value: <html> <head> <script language=”Javascript”> function isNumberKey(evt) { var re=new RegExp(/^[0-9]*.?[0-9]*$/); if(document.getElementById(“text”).value.match(re)) { alert(“match”); } else { alert(“no match”); return false; } } </script> </head> <body> <input id=”text” type=”text” value=”0″