In Eclipse, you need to add the jspider project to the crawler_GUI project as follows:
crawler_GUI properties> Java build path> Projects> Add jspider .crawler_GUI properties> Java EE module dependencies> Mark jspider .
Remember to clear any free files in /WEB-INF/classes added manually. It's not needed. Eclipse will take care of this automatically if you specify the projects correctly. In addition, any free JAR files should simply be dumped into /WEB-INF/lib .
Now part of the JSP story. It is difficult to determine the root cause, since you wrote the Java source code in a JSP file instead of the real Java class. The first step is to check the server logs for any inconsistencies. It may also happen that the wrong version of the ESpider class was ESpider (in which sysout is missing).
As already hinted, this is actually not the way you should use JSP. It should be used as a template for writing HTML / CSS / JS, in which you can dynamically control the flow using taglib tags such as JSTL and access the underlying data using EL. Raw Java code belongs to Java classes, not JSP files. In this case, you should have used the Servlet class. Just create the extends HttpServlet class extends HttpServlet , implement the doGet() method, respectively, with the ESpider tag and finally go to the JSP page to display the result, register the servlet in web.xml and call it at the URL that its url-pattern covers in web.xml . You can find many good JSP / Servlet tutorials here .
PS: make sure you understand the robots.txt policy ...
source share