Enabling JSP on Ignition Jetty webserver

Hi,

Just wondering if it’s possible to enable JSP on the Ignition webserver? I’ve attempted to do so myself by adding .jar files to lib/core/gateway and defining a jsp servlet in the web.xml file (also tried uncommenting JSP section in the webdefault.xml).

I’m currently getting the following error

java.lang.IllegalStateException: No org.apache.tomcat.InstanceManager set in ServletContext

I can only get the gateway to start if the jsp servlet class is ‘org.apache.jasper.servlet.JspServlet’, but I would expect it to be something like ‘org.eclipse.jetty.jsp.JettyJspServlet’ as that may lead to the tomcat reference in the error.

I’ve also read in the Jetty documentation that I might need to enable JSP using --add-module=jsp but I’m not sure where to add that argument during startup or where to put such as module. Tried adding it as a java additional parameter in ignition.conf but that hasn’t worked.

Anyway, the Jetty server my version of ignition uses is 9.4.24. Any help would be appreciated.

Thanks!

What’s your end goal?
I strongly suspect that the only way you’re going to get this to work, if you ever do, is via a custom module…but I don’t see a strong reason to try to shove JSP into place when we’ve already got Wicket available. If you’ve got some other application written using JSP for rendering, then just…run both.

Thank you for the reply,

I don’t have a particular end goal I’m more so testing the capabilties of the webserver, and I’m familiar with JSP but not with Wicket. So if you’re saying that Wicket can do what JSP would have than that’s probably the answer I’m looking for.

I’ll start going through the Wicket documentation, is there any other useful resources for Wicket and how it’s used with Ignition?

No, nothing bespoke. I'm not actually familiar with JSP beyond what a quick Google tells me, but I suspect Wicket fits a lot of the same model - with Wicket, there's an "HTML" page resource that gets passed through Wicket before being rendered in the actual request, allowing semi-dynamic content without any JS. We don't have a lot of use cases for super dynamic pages, so the vast majority of what's useful to module authors happens "automatically"; take a look at how the Slack Notification example creates base Java classes which are automatically rendered into the common record editing table.

For more dynamic pages, we have switched over to preferring React, (technically still "hosted" by Wicket, but Wicket doesn't actually do much of anything on these pages) - for example, all the status pages in Ignition 7.9+. For an example of that setup, there's this SDK example: ignition-sdk-examples/gateway-webpage at master · inductiveautomation/ignition-sdk-examples · GitHub

But basically the only answer is that right now documentation around all this stuff is lacking, so you're largely on your own (but welcome to post questions or solutions here on the forum).