Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

Urgent Help!! with JSP calling native method  RSS feed

 
gautam anand
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I want to create a JSP page and then call a native method from the page using JNI. I have been to call a native method form a simple java program but having problem including the code in a JSP page.

The java program code that works is as follows:


class Native1 {
public native String getValue(String sMain, String sKey, String sFile);
static {
System.loadLibrary("native1");
}

public static void main(String[] args) {

String xxx;
xxx = new Native1().getValue("Main", "gautam", "C:\\test.ini");
System.out.println(xxx);
}

}

test.ini file contains only two entries
[Main]
gautam= Gautam

The value being printed on the console as the outputis Gautam.. whose functionality is defined in the C++ file.

Please let me know how the above java code can be used in a JSP page. Your help would be sincerely appreciated.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!