Instantiate an external directory Java class in JSP

1

I created my application Java with Eclipse in the Meus Documentos/workspace/TesteJAVA/ directory

Now I want to call a class with JSP , I want to know how to configure to get the application from this directory or should I keep the application and classes in the Tomcat ? folder.

I am using Apache Tomcat 8 and the page is in C:Aplicativos/Apache/Tomcat8/webapps/TesteJSP/

    
asked by anonymous 26.10.2015 / 00:09

2 answers

2

You have two options:

  • Create a web project in Eclipse and let it mount the package for you.
  • You need to copy the .class files into the WEB-INF/classes directory in your project. Example (put inside):

    C: / Applications / Apache / Tomcat8 / webapps / TestJSP / WEB-INF / classes

  • Remember that the uppercase and lowercase characters make a difference.

        
    26.10.2015 / 14:35
    1

    Now, everything is working.

    First I installed the software in Eclipse

    • Eclipse Java EE Developer Tools
    • Eclipse Java Web Developer Tools
    • Eclipse Web Developer Tools
    • Eclipse XML Editors and Tools

    As described in the answer with the most votes of this question: http://stackoverflow.com/questions/5531402/newbie-in-eclipse-i-dont-have-dynamic-web-project-i-am-under-linux-ubuntu

    Second, I created the file JSP in the project, as described by @LeonardoCosta and @WeslleyTavares, but the same one presented an error, solved with the answer of the following question:

    http://pt.stackoverflow.com/questions/94987/como-resolver-o-erro-the-superclass-javax-servlet-http-httpservlet-was-not-f

    Thanks for the help.

        
    27.10.2015 / 23:28