dcsimg
Urgent help with JSP page calling a native method
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   gautam_anand
Posted On:   Saturday, June 19, 2004 04:03 PM

Hi, I want to create a JSP page and then call a native method from the page using JNI. I have been able 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]    More>>

Hi,

I want to create a JSP page and then call a native method from the page using JNI. I have been able 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 output is Gautam(the logic for reading the ini file and getting the value is being 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

   <<Less

Re: Urgent help with JSP page calling a native method

Posted By:   srini_raju  
Posted On:   Saturday, July 3, 2004 03:23 AM

Please send the reply for the same.
About | Sitemap | Contact