Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 729
Southsouth Avatar asked Nov 12 '09 04:11

Southsouth


People also ask

How do I create a jar with an external library?

You can right-click on the project, click on export, type 'jar', choose 'Runnable JAR File Export'. There you have the option 'Extract required libraries into generated JAR'.


1 Answers

  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
like image 198
Bozho Avatar answered Sep 22 '22 20:09

Bozho