Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JSP With DLLs

Status
Not open for further replies.

Skull2003

Programmer
Jan 7, 2003
10
SG
Hi everyone,

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?

Thanks and regards,
John
 
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.


-pete
 
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.

Is there a pretty fast way I can do this.

Thanks in advance.
 
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?

Please advise.

Thanks in Advance.
 
Protecting code in JSPs?
obfuscating a Servlet?

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.

-pete
 
How about this (tongue possibly in cheek).

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 !!
 
sedj,

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!

-pete
 
Pete,

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.

As for Obfuscators, I have a link here.
recommended from

also the following links lead to obfuscators

As for the Sun site documentation, I picked it up from this link :
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.

Can you advise or direct me on Forwarding pls?

Thanks in Advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top