how to reference an external jar in jsp app?

前端 未结 3 1930
小鲜肉
小鲜肉 2020-12-31 23:29

I am new to Eclipse. I am trying to run a jsp example using iText to generate a PDF, I put iText.jar file in Referense Library folder, but when I ran the jsp, I got error m

相关标签:
3条回答
  • 2021-01-01 00:06

    Right click on your project folder in the navigator, choose properties, choose java build path, select the libraries tab, click Add External Jars..., choose your jar. Click OK.

    0 讨论(0)
  • 2021-01-01 00:23
    1. Add the jar in WEB-INF/lib
    2. add <%@ page import="com.lowagie.itext.Document" %> (or whatever the package is) to the top of your JSP
    0 讨论(0)
  • 2021-01-01 00:23

    You can also add this jar into the project lib folder(present in WEB-INF, if not present you can add a folder in WEB-INF).

    Now you can either

    Right click on your project folder in the navigator, choose properties, choose java build path, select the libraries tab, click Add External Jars..., choose your jar. Click OK.

    or

    Right click on your project folder in the navigator, choose properties, choose java build path, select the libraries tab, click Add Jars..., choose your jar. Click OK.

    Hope this helps..

    0 讨论(0)
提交回复
热议问题