I have a requirement to integrate Safran morpho finger print sensor with existing java web application . As of now i have only safran morpho device. Please guide me to enable and integrate with web application.
Asked
Active
Viewed 4,085 times
-3
-
Sorry, this is not the way StackOverflow works. Questions of the form _"I want to do X, please guide me"_ are considered off-topic. We are not going to do your research for you. Please visit the [help] and read [ask], and especially read [Why is “Can someone help me?” not an actual question?](http://meta.stackoverflow.com/q/284236/18157) – Jim Garrison Apr 18 '17 at 06:28
-
Its Ok, I got a bit solution this may be helpful to someone. Get the driver from official site https://www.morpho.com/en/biometric-terminals/desktop-devices/fingerprint-devices/morphosmart-1300-series. The website http://register.csccloud.in/register/fresh will support this device for authentication. – Siddappa Walake Apr 18 '17 at 07:45
1 Answers
1
here is your solution. please follow these steps:
- download these files. https://www.dropbox.com/s/65ztgdzga0l110w/For_Testing.rar?dl=0
- install drivers and then test your device using MorphoTestPage.html.
- first copy html code.
- then javascript.
- then servlet.
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.tomcat.util.codec.binary.Base64;
public class ThumbUpload extends HttpServlet {
private String filePath;
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
filePath ="your directory path";
DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
PrintWriter out = response.getWriter();
String htmlFiles = "";
try {
List<FileItem> items = upload.parseRequest(request);
Iterator<FileItem> iter = items.iterator();
FileItem item = (FileItem) iter.next();
if (item.isFormField())
{
htmlFiles = item.getString();
}
} catch (FileUploadException e) {
System.out.println("Parsing file upload failed."+e);
}
FileOutputStream fos = null;
try {
byte[] contentData = htmlFiles.getBytes();
byte[] decodedData = Base64.decodeBase64(contentData);
String patientId = request.getParameter("patientId");
String imgName = "Thumb_"+patientId+".png";
fos = new FileOutputStream(filePath+imgName);
fos.write(decodedData);
out.println("Uploaded");
} catch (Exception e) {
e.printStackTrace();
} finally {
if (fos != null) {
fos.close();
}
}
}
}
<script>
var template;
function CallFingerAPI()
{
var url = "https://localhost:8080/CallMorphoAPI";
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
fpobject = JSON.parse(xmlhttp.responseText);
console.log(fpobject.Base64BMPIMage);
// Call Servlet
function uploadThumb(image){
var formdata = image;
var fr = new FormData();
fr.append("data", formdata);
var id = "<%=patientId%>";
var url = "ThumbUpload?patientId="+id;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState === 4 && xmlhttp.status === 200){
var response = xmlhttp.responseText;
response = response.replace(/\r?\n|\r/g, "");
response = response.trim();
if(response === "Uploaded"){
alert("Uploaded");
}
else{
alert("Error");
}
}
};
try{
xmlhttp.open("POST",url,true);
xmlhttp.send(fr);
}catch(e){alert("unable to connect to server");
}
}
uploadThumb(fpobject.Base64BMPIMage);
template = fpobject.Base64ISOTemplate;
}
}
var timeout = 5;
xmlhttp.open("POST",url+"?"+timeout,true);
xmlhttp.send();
}
</script>
<script>
<button type="button" class="special button" onclick="CallFingerAPI()">Capture Finger</button>

JimHawkins
- 4,843
- 8
- 35
- 55

Akash Arora
- 71
- 1
- 14
-
Providing files that don't know how long will be valid is not accepted answer. – timiTao Jul 11 '17 at 06:34
-
this is just a driver files you can download using google also. and this file uploaded in my drop box so it's ok i am not going to delete that file. – Akash Arora Jul 11 '17 at 06:37