I am on a project now that needs to access a DLL from JSP pages. We have a Custom.DLL that was compiled and works on VB and ASP. I would like to find out how to call functions from this DLL from my JSP page?
You can't unless the DLL was built to be JNI compatible which it probably wasn't. In fact it is probably home to one or more COM In-proc servers since it is used in ASP.
Do some research on the DLL in question first. Then when you have found out what technology(s) it exports using what mechanisms go and research them. Then research JNI (Java Native Interface) at java.sun.com
You can't drag n drop a solution nor can you copy and paste some code from the internet for this solution. What you might be able to do is build another DLL that is JNI compatible and encapsulates (wraps) the original DLL This solution will take some Object Oriented Design work and definitely some Java knowledge as well as a good understanding of the technology(s) in the original DLL.
Well, in this case, if I want to protect my code in JSPs, what can I do? I would research JNI but that will delay my development, which as it is, is behind time.
There was some mention of compiling my JSP page into a servlet and then obfuscating it. It raises some questions for me:
1) What is the process of compiling? How do I go about it?
2) If I obfuscate a file, can I insert it via Include statements in other JSPs for usage of its (obfuscated)functions?
I have no idea what that means. Is that standard Java terminology? If it is can you post a link to the sun.com page that documents it? If your making up your own terms it's going to make message based communications impossible.
>> 2) If I obfuscate a file, can I insert it via Include
>> statements in other JSPs for usage of its (obfuscated)functions?
You can use Servlets from JSP pages through forwarding. What you mean by obfuscate a file and how it might effect your ability to use the Servlet i have no idea.
Use a Runtime.exec() from your JSP or Servlet that calls a C program, to run the DLL functions you wish to execute. Write that out to a file. Then, read the data back into your JSP or Servlet ! No worries, and no JNI !!
I wouldn't laugh to hard at that. I guarantee that there are people hacking out stuff like that. Bet it scales real well to eh?
Here's another idea. Just use the DLL in a VB application that runs every possible request combination and saves them to HTML files. Then copy the HTML files to your web server and create a menu for them. Viola!
The problem is that the DLL I have on my hands are reading certain tables from my database that I do not want my clients to know explicitly. These data are very volatile and I have to retrieve them often.
However, I am new to obfuscation and need some advice on it's deployment impact on JSPs and any pitfalls. At the moment now, my manager's directive is to focus on code security.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.