恳请大虾热心帮忙,非常感激!
以下是JavaBean的代码:
package example;public class JavaCallC {
  public JavaCallC() {
  System.loadLibrary("WriteFile");//WriteFile.dll,为自己写的库
  }
  public native int StrInIntOut (String str);//在WrtiteFile.dll实现
  public native String IntInStrOut (int iIndex);//在WrtiteFile.dll实现
  public static void main(String args[]){
  JavaCallC TTC=new JavaCallC();
  System.out.print(TTC.IntInStrOut(5) );
   }
}
编译生成.class文件,生成.h文件,在VC6.0中实现,生成writefile.dll,
在jsp中调用,jsp的源代码如下:
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
    Jsp1例子
</title>
</head>
<jsp:useBean id="JBean" scope="page" class="example.JavaCallC" />
<body>
<h1>
  <%=JBean.IntInStrOut(5)%>
</h1>
</body>
</html>
路径设置应该没错,因为同样的路径我试过JSP调用Jbean的测试。
错误代码大致为:
java.lang.UnsatisfiedLinkError: IntInStrOut
at example.JavaCallC.IntInStrOut(Native Method)
at org.apache.jsp.Jsp3$jsp._jspService(Jsp3$jsp.java:87)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)....
肯请大虾帮忙,万分感谢!!