How to invoke C DLLs from a JSP


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: How to invoke C DLLs from a JSP

Hybrid View

  1. #1
    Mohan Guest

    How to invoke C DLLs from a JSP


    Hi there,

    My name is Mohan, from Singapore. I like to know if you can help me with
    the following problem. I am prepared to pay for this.
    A description of the requirements are given in detail as follows :-

    I need a JSP page to call a C compiled DLL from server. We like you to help
    us with the development of this program.

    Basically, what we want is this :-

    Develop a rough and ready JSP page which has 2 text boxes, TA (input) and
    TB (output). TA is an input textbox wherein the user enters a value, say
    "Hello World". A command button must be provided which upon pressing will
    call a DLL (developed and compiled thru a C language compiler eg, Visual
    C++). NOTE : The invokation of the DLL must be done using Javascript or pure
    Java.

    The DLL residing in the server must be developed in C language. No other
    language will do other than Microsoft C or Visual C++.
    The function of the DLL could simply be to change the order of words in the
    string. Once this function has performed the task, it outputs the result
    into TB which then gets displayed to the user. In the case of the example
    it will be "World Hello".

    We need to find out from your example a couple of things :-
    a) How the Java code in JSP page will call the C DLL file and pass the string
    as the argument into the DLL.
    b) How the DLL can be compiled in C language using Visual C++ 6.0.
    c) How the output will be passed back to the JSP page.

    Let me know if you can help me out on this task and what is the charge. I
    like to know the charge before you start this assignment.
    Note : I don't want a program that works under MS-DOS running in console.
    This is useless to me. I specifically want a
    JSP page calling a C language DLL.

    Cheers,

    Mohan

  2. #2
    Ruchi Dhar Guest

    Re: How to invoke C DLLs from a JSP


    If you want invoke the DLL from servlet/JSP you need to check with your servlet/jsp
    container for the JNI support. If your container support JNI calls then
    its very simple to invoke dll from servlet/jsp. Try to have one wrapper
    class with all the decleration of the native class like the following

    public class DLLComunicator
    {
    //Delcare all your methods which are being exported from the DLL.
    public native String methodCall1(String name);

    static
    {
    //Load the dll with the name of the dll
    System.loadLibrary("Communicator");
    }
    }

    You can refer the JNI tutorial

    http://java.sun.com/docs/books/tutor...1.1/index.html

    From servlet/jsp you just create the instance of the class DLLComunicator
    and invoke the methods. Its just simple java object creation and method
    invocations.

    The only thing you need to remember is your container should support JNI.

    "Mohan" <score@singnet.com.sg> wrote:
    >
    >Hi there,
    >
    >My name is Mohan, from Singapore. I like to know if you can help me with
    >the following problem. I am prepared to pay for this.
    >A description of the requirements are given in detail as follows :-
    >
    >I need a JSP page to call a C compiled DLL from server. We like you to help
    >us with the development of this program.
    >
    >Basically, what we want is this :-
    >
    >Develop a rough and ready JSP page which has 2 text boxes, TA (input) and
    >TB (output). TA is an input textbox wherein the user enters a value, say
    >"Hello World". A command button must be provided which upon pressing will
    >call a DLL (developed and compiled thru a C language compiler eg, Visual
    >C++). NOTE : The invokation of the DLL must be done using Javascript or

    pure
    >Java.
    >
    >The DLL residing in the server must be developed in C language. No other
    >language will do other than Microsoft C or Visual C++.
    >The function of the DLL could simply be to change the order of words in

    the
    >string. Once this function has performed the task, it outputs the result
    >into TB which then gets displayed to the user. In the case of the example
    >it will be "World Hello".
    >
    >We need to find out from your example a couple of things :-
    >a) How the Java code in JSP page will call the C DLL file and pass the string
    >as the argument into the DLL.
    >b) How the DLL can be compiled in C language using Visual C++ 6.0.
    >c) How the output will be passed back to the JSP page.
    >
    >Let me know if you can help me out on this task and what is the charge.

    I
    >like to know the charge before you start this assignment.
    >Note : I don't want a program that works under MS-DOS running in console.
    >This is useless to me. I specifically want a
    >JSP page calling a C language DLL.
    >
    >Cheers,
    >
    >Mohan



  3. #3
    mhcox Guest

    Re: How to invoke C DLLs from a JSP


    "Ruchi Dhar" <rdhar@verticalnet.com> wrote:
    >
    >If you want invoke the DLL from servlet/JSP you need to check with your

    servlet/jsp
    >container for the JNI support. If your container support JNI calls then
    >its very simple to invoke dll from servlet/jsp


    I don't think that's what Mohan is asking. What you describe is how to have
    a JSP call C code *on the server*. It sounds to me that Mohan wants Java/JavaScript
    and the C DLL downloaded via HTML to the client and the code execute *on
    the client*.

    I don't know the answer to this question and will be anxiously waiting for
    the reply (interesting problem) ;-).

    Mike


  4. #4
    Paul Clapham Guest

    Re: How to invoke C DLLs from a JSP


    mhcox <mhcox@acm.org> wrote in message news:3a72b42c@news.devx.com...
    >
    > "Ruchi Dhar" <rdhar@verticalnet.com> wrote:
    > >
    > >If you want invoke the DLL from servlet/JSP you need to check with your

    > servlet/jsp
    > >container for the JNI support. If your container support JNI calls then
    > >its very simple to invoke dll from servlet/jsp

    >
    > I don't think that's what Mohan is asking. What you describe is how to

    have
    > a JSP call C code *on the server*. It sounds to me that Mohan wants

    Java/JavaScript
    > and the C DLL downloaded via HTML to the client and the code execute *on
    > the client*.
    >
    > I don't know the answer to this question and will be anxiously waiting for
    > the reply (interesting problem) ;-).
    >
    > Mike
    >

    I don't agree with that. Here's an excerpt from Mohan's spec:

    "a) How the Java code in JSP page will call the C DLL file and pass the
    string
    as the argument into the DLL."

    This Java code is running on the server, and so it would be calling a DLL on
    the server.

    However, I don't intend to bid on this project. Best of luck to anyone who
    does!





  5. #5
    David Guest

    Re: How to invoke C DLLs from a JSP


    Hi Mohan,

    This is David from Singapore.
    My method is: use VB or Visual C++ to create the DLL and compile as COM
    object.
    Next, use the free download, "Java com-bridge" (actual name I'm not too sure)
    to access the COM object.

    Good luck!


    "Mohan" <score@singnet.com.sg> wrote:
    >
    >Hi there,
    >
    >My name is Mohan, from Singapore. I like to know if you can help me with
    >the following problem. I am prepared to pay for this.
    >A description of the requirements are given in detail as follows :-
    >
    >I need a JSP page to call a C compiled DLL from server. We like you to help
    >us with the development of this program.
    >
    >Basically, what we want is this :-
    >
    >Develop a rough and ready JSP page which has 2 text boxes, TA (input) and
    >TB (output). TA is an input textbox wherein the user enters a value, say
    >"Hello World". A command button must be provided which upon pressing will
    >call a DLL (developed and compiled thru a C language compiler eg, Visual
    >C++). NOTE : The invokation of the DLL must be done using Javascript or

    pure
    >Java.
    >
    >The DLL residing in the server must be developed in C language. No other
    >language will do other than Microsoft C or Visual C++.
    >The function of the DLL could simply be to change the order of words in

    the
    >string. Once this function has performed the task, it outputs the result
    >into TB which then gets displayed to the user. In the case of the example
    >it will be "World Hello".
    >
    >We need to find out from your example a couple of things :-
    >a) How the Java code in JSP page will call the C DLL file and pass the string
    >as the argument into the DLL.
    >b) How the DLL can be compiled in C language using Visual C++ 6.0.
    >c) How the output will be passed back to the JSP page.
    >
    >Let me know if you can help me out on this task and what is the charge.

    I
    >like to know the charge before you start this assignment.
    >Note : I don't want a program that works under MS-DOS running in console.
    >This is useless to me. I specifically want a
    >JSP page calling a C language DLL.
    >
    >Cheers,
    >
    >Mohan



  6. #6
    Jun Guest

    Re: How to invoke C DLLs from a JSP


    Hi Mohan:

    Here are two commercial Java COM bridge software:

    Halcyon Software
    Chilisoft

    Go to their company web site, download the free trial version.

    Good Luck.

    Jun


    "David" <anjas@catcha.com> wrote:
    >
    >Hi Mohan,
    >
    >This is David from Singapore.
    >My method is: use VB or Visual C++ to create the DLL and compile as COM
    >object.
    >Next, use the free download, "Java com-bridge" (actual name I'm not too

    sure)
    >to access the COM object.
    >
    >Good luck!
    >
    >
    >"Mohan" <score@singnet.com.sg> wrote:
    >>
    >>Hi there,
    >>
    >>My name is Mohan, from Singapore. I like to know if you can help me with
    >>the following problem. I am prepared to pay for this.
    >>A description of the requirements are given in detail as follows :-
    >>
    >>I need a JSP page to call a C compiled DLL from server. We like you to

    help
    >>us with the development of this program.
    >>
    >>Basically, what we want is this :-
    >>
    >>Develop a rough and ready JSP page which has 2 text boxes, TA (input) and
    >>TB (output). TA is an input textbox wherein the user enters a value, say
    >>"Hello World". A command button must be provided which upon pressing will
    >>call a DLL (developed and compiled thru a C language compiler eg, Visual
    >>C++). NOTE : The invokation of the DLL must be done using Javascript or

    >pure
    >>Java.
    >>
    >>The DLL residing in the server must be developed in C language. No other
    >>language will do other than Microsoft C or Visual C++.
    >>The function of the DLL could simply be to change the order of words in

    >the
    >>string. Once this function has performed the task, it outputs the result
    >>into TB which then gets displayed to the user. In the case of the example
    >>it will be "World Hello".
    >>
    >>We need to find out from your example a couple of things :-
    >>a) How the Java code in JSP page will call the C DLL file and pass the

    string
    >>as the argument into the DLL.
    >>b) How the DLL can be compiled in C language using Visual C++ 6.0.
    >>c) How the output will be passed back to the JSP page.
    >>
    >>Let me know if you can help me out on this task and what is the charge.

    >I
    >>like to know the charge before you start this assignment.
    >>Note : I don't want a program that works under MS-DOS running in console.
    >>This is useless to me. I specifically want a
    >>JSP page calling a C language DLL.
    >>
    >>Cheers,
    >>
    >>Mohan

    >



  7. #7
    Harkishin Nachnani Guest

    Re: How to invoke C DLLs from a JSP


    Hi Mohan:
    I can do it for you...and I will charge you 200 US $ for it or Rs 10,000/-
    whatever currency is convenient to you. You can even pay me in equivalent
    singapore dollars. Send me a confirmation note and I will start working on
    it.

    Cheers
    Harkishin


    "Mohan" <score@singnet.com.sg> wrote:
    >
    >Hi there,
    >
    >My name is Mohan, from Singapore. I like to know if you can help me with
    >the following problem. I am prepared to pay for this.
    >A description of the requirements are given in detail as follows :-
    >
    >I need a JSP page to call a C compiled DLL from server. We like you to help
    >us with the development of this program.
    >
    >Basically, what we want is this :-
    >
    >Develop a rough and ready JSP page which has 2 text boxes, TA (input) and
    >TB (output). TA is an input textbox wherein the user enters a value, say
    >"Hello World". A command button must be provided which upon pressing will
    >call a DLL (developed and compiled thru a C language compiler eg, Visual
    >C++). NOTE : The invokation of the DLL must be done using Javascript or

    pure
    >Java.
    >
    >The DLL residing in the server must be developed in C language. No other
    >language will do other than Microsoft C or Visual C++.
    >The function of the DLL could simply be to change the order of words in

    the
    >string. Once this function has performed the task, it outputs the result
    >into TB which then gets displayed to the user. In the case of the example
    >it will be "World Hello".
    >
    >We need to find out from your example a couple of things :-
    >a) How the Java code in JSP page will call the C DLL file and pass the string
    >as the argument into the DLL.
    >b) How the DLL can be compiled in C language using Visual C++ 6.0.
    >c) How the output will be passed back to the JSP page.
    >
    >Let me know if you can help me out on this task and what is the charge.

    I
    >like to know the charge before you start this assignment.
    >Note : I don't want a program that works under MS-DOS running in console.
    >This is useless to me. I specifically want a
    >JSP page calling a C language DLL.
    >
    >Cheers,
    >
    >Mohan



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center