Author Note: How include servlet output to jsp file I attempted this solution before I posted this problem as one of the includes with failure notes, it did not work for me.
Background/config:
Eclipse version: 2021-12 (4.22.0)
Project type: Dynamic Web Project
Language Java v16 and HTML
Tomcat version 9.0.56
Windows 10 64 bit home edition
Disabled firewall
I am trying to get a JSP to see a servlet via the call <jsp:include page = "SERVLET SOMETHING">>/jsp:include>
It works if I set it in a form and have the action to the same <"SERVLET SOMETHING">. Here is the file/folder hierarchy in question: Structure
I have tried every version I can think of with ../ or ./ if I use the full file path the server throws an error at the line interpretation. <jsp:include page="../java/servlets/ContextDemoServlet.java"></jsp:include>
YIELDS
Message An exception occurred processing [/CallingServlets.jsp] at line [10]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: An exception occurred processing [/CallingServlets.jsp] at line [10]
7: <title>Calling Context Demo Servlet</title>
8: </head>
9: <body>
10: <jsp:include page="../java/servlets/ContextDemoServlet.java"></jsp:include>
11: </body>
12: </html>
Other attempts and their errors:
Include options that I have tried and failed at:
<jsp:include page="ContextDemoServlet"></jsp:include>
YIELDS
Fragment "ContextDemoServlet" was not found at expected path /TestingServlets2/src/main/webapp/
ContextDemoServlet
<jsp:include page="/ContextDemoServlet"></jsp:include>
YIELDS
Fragment "/ContextDemoServlet" was not found at expected path /TestingServlets2/src/main/webapp/
ContextDemoServlet
<jsp:include page="./ContextDemoServlet"></jsp:include>
YIELDS
Fragment "./ContextDemoServlet" was not found at expected path /TestingServlets2/src/main/webapp/
ContextDemoServlet
<jsp:include page="../ContextDemoServlet"></jsp:include>
YIELDS
Fragment "../ContextDemoServlet" was not found at expected path /TestingServlets2/src/main/
ContextDemoServlet
The servlet is configured as: @WebServlet("/ContextDemoServlet")
Any help is greatly appreciated, or simply point me in a direction with some resources to understand this problem. Everything I've read so far indicates that it should work with my configuration, but I'm clearly doing something wrong. I can navigate to the servlet pages within the server as well and they are doing what they need to do...The JSP just can't see it.