Running Lucee on Tomcat and need to server a JSP page

423 views Asked by At

I have a Lucee box that is running with Tomcat. Everything is great with the site and CFM pages. I was recently given a page in JSP that the client would like to run on the site. Everything I had read says no problem so I agreed to run it.

Put the file in a directory and instead of "processing" it ran like and html page would and I could see the code. Realized that Tomcat hadn't been instructed to process JSP files so I added <url-pattern>*.jsp</url-pattern> to:

     <servlet-mapping>
        <servlet-name>CFMLServlet</servlet-name>
        <url-pattern>*.cfm</url-pattern>
        <url-pattern>*.cfml</url-pattern>
        <url-pattern>*.cfc</url-pattern>

        <url-pattern>*.jsp</url-pattern>

        <!-- Basic SES Mappings -->
        <url-pattern>/index.cfc/*</url-pattern>
        <url-pattern>/index.cfm/*</url-pattern>
        <url-pattern>/index.cfml/*</url-pattern>
    </servlet-mapping>

Now the page is blank and isn't outputting anything and it isn't throwing any errors. Obviously "dump" doesn't work so I am not sure even where to start.

The beginning of the page is a series of import statements

<%@ page import="java.util.*" %>
<%@ page import="org.json.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.net.*" %>
<%@ page import="java.rmi.*" %>
<%@ page import="java.text.*"%>

I assume that Lucee is "importing" them since I am not seeing an error of any kind but being that this is my first experience with JSP I am not sure.

I have written several things using java in cfml similar to

Math = createObject("java","java.lang.Math");

So I am sure I could eventually rewrite this in cfml if I have to but I feel like there is something small I am missing.

If anyone has any experience running JSPs like this you insight is appreciated.

1

There are 1 answers

1
Lance On

Ugh RTFM

If anyone else runs into this.

Un-comment this section

<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>fork</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>

and this section

<servlet-mapping>
    <servlet-name>jsp</servlet-name>
    <url-pattern>*.jsp</url-pattern>
    <url-pattern>*.jspx</url-pattern>
</servlet-mapping>

of /lucee/tomcat/conf/web.xml