Running Lucee on Tomcat and need to server a JSP page

天涯浪子 提交于 2019-12-13 18:06:45

问题


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:


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



来源:https://stackoverflow.com/questions/45973200/running-lucee-on-tomcat-and-need-to-server-a-jsp-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!