I inherited 2 JSP projects (tomcat) in my eclipse with common code that is duplicated. I wanted to export a duplicate of the code to a shared library / project and reference it from a JSP project.
So, I did the following:
I created a new Java project "JSP-Common" with the following package "com.mycompany.jsp.common". There I create a class "ExternalClass" with the public method "test ()", which returns a string.
in the JSP1 project (one of two JSP projects):
I added the JSP-Common project to the project tab of the build path
I added the following import to the jsp file:
<%@ page import = "com.mycompany.jsp.common.*" %>
I added to the jsp file in the body somewhere
<% ExternalClass ec=new ExternalClass(); %>
After creating and publishing the project, I get the error message "ExternalClass cannot be resolved to type" in the line with the instance described above on my page.
Am I missing something? Help?
I want to do this when I build the JSP1 project, it will automatically accept calls from the JSP-Common project.
source share