how to reference an external jar in jsp app?
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 message that the class Document defined in the iText,jar can't not be resolved.
- Add the jar in WEB-INF/lib
- add
<%@ page import="com.lowagie.itext.Document" %>
(or whatever the package is) to the top of your JSP
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..
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.
精彩评论