Posts

How to get IP address and MAC address of client in java | #CodeFactory

- Java access to the client IP address and MAC address -  In JSP, method to obtain the client's IP address is: request.getRemoteAddr (), this method is effective in most cases. -  After the agent, because between the client and the service increased intermediate layer, so the server can not be directly to the IP client, server application is not directly by forwarding the requested address is returned to the client. -  But in the HTTP header information request, increase the XFORWARDEDFOR information. To track the original client IP address and the original client requests the server address. -  When we visit index.jsp/, In fact, we are not true to the browser to access the index.jsp file on the server, But the proxy server to access the index.jsp , The proxy server will access to the results returned to the browser, Because it is a proxy server to access the index.jsp, So the index.jsp through the request.getRemoteAddr () method to obtain the IP is actually the address of pro

Create Custom Javascript Validation Popup | #CodeFactory

Image
Download js and css :  Download  |  Demo Preview : Description : An easy to use yet fully customizable form field validator built using native JavaScript with no 3rd JavaScript libraries. Predefined validation rules : - required -  notzero - integer - float - min - max - between - name - lastname - phone - email - length - maxlength - minlength - maxfilesize - fileextension How to use it : Import the main JavaScript file js-form-validator.min.js  and css file forms.css  into your html file. <link href="css/forms.css" rel="stylesheet"> <script src="js/js-form-validator.min.js"></script> Apply the validation rules to the target form fields using data-rule  attributes. You can apply multiple rules to the same field by seperate the rules with "|". <form action="#" id="form"> <br> Emp code : <br> <input type="text" n

At Least One Checkbox Is Checked From All CheckBox Group | #CodeFactory

Image
File : checkBox.jsp <!DOCTYPE html > <html> <head> <title>checkbox</title> <!-- for bootstrap css and js --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <center> <h2> checkbox</h2> </center> <form action="#" class="form-horizontal" method="post" onsubmit="return checkFormData()"> <!-- Check Box 1 --> <div class="form-group"> <label class="control-label col-sm-4">Check Box 1</label> <div class="col-sm-5"> <

Web Page Editor In Eclipse | Code Factory

Image
You use the Web Page Editor Palette to edit and create a variety of tags, such as HTML, JSP, JSF, and so on. In addition to standard HTML and JSP tags, the Palette displays an item for each tag in the JSP tag libraries that are on the application's classpath. You drag and drop tags on to the Design or Source view to design Web pages. You can pin the Palette to be open, or set to automatically expand when the cursor is placed over it while it is in its collapsed state. To access the Palette, from your Web project open in the Project Explorer, right-click a page on which you are planning to drop or edit tags, and then select Open With > Web Page Editor from the drop-down menu. Tags : Web Application Development - Using the Web Page Editor Web Page Editor - Eclipse Web Tools Platform (WTP) - Eclipse HTML Editor (WTP) - Eclipse How To Edit JSP Page In Eclipse

FTP Connection In Installed Alfresco | Code Factory

Image
Note  :  First check that PC is able to create FTP connection... Step 1 : Stop alfresco. Step 2 : Add these properties in < alfresco> -> tomcat -> shared -> classes -> alfresco-global.properties ftp.enabled=true ftp.port=2121 Step 3 : Start alfresco. Step 4 : Check FTP connection is successfully created or not using URL. ftp://<ip address>:2121/alfresco Tags : Alfresco Tutorial Configuring the FTP file server How To Enable FTP On Alfresco? Transfer and Get File Using FTP

FTP Connection In Alfresco | Code Factory

Image
Note : First check that PC is able to create FTP connection... Step 1 : Add these properties in alfresco-global.properties ftp.enabled=true ftp.port=2121 Step 2 : Start Repo and Share. Step 3 : Check FTP connection is successfully created or not using URL. ftp://<ip address>:2121/alfresco Tags : Alfresco Tutorial Configuring the FTP file server How To Enable FTP On Alfresco? Transfer and Get File Using FTP

Java DOM Parser - Parse XML Document | Code Factory

Image
File : ReadXMLFile.java package com.codeFactory; import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class ReadXMLFile { public static void main(String[] args) { // TODO Auto-generated method stub try { File folder = new File("./src/com/codeFactory"); File[] listOfFiles = folder.listFiles(); // get all files details for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile() && listOfFiles[i].toString().contains(".xml")) { // check file is xml or not System.out.println("\n*** File " + listOfFiles[i].getName() + " ***\n"); File fXmlFile = new File("./src/com/codeFactory/" + listOfFiles[i].getName()); DocumentBuilderFactory dbFactory = DocumentBuilderFactory .n