问题描述
我有一个与Tomcat一起运行的Lucee框.该站点和CFM页面一切都很好.最近,我在JSP中得到了一个页面,该页面是客户端希望在该站点上运行的页面.我读过的所有内容都说没问题,所以我同意运行它.
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.
将文件放在目录中,而不是像html页面那样运行处理",我可以看到代码.意识到没有指示Tomcat处理JSP文件,所以我在<url-pattern>*.jsp</url-pattern>
上添加了:
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.*"%>
我认为Lucee正在导入"它们,因为我没有看到任何错误,但是我不确定这是我第一次使用JSP.
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.
我已经在cfml中使用Java编写了几件事,类似于
I have written several things using java in cfml similar to
Math = createObject("java","java.lang.Math");
所以我确定,如果需要的话,我最终可以在cfml中重写它,但是我觉得我缺少一些小东西.
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.
如果任何人都具有运行这样的JSP的经验,那么您的见解将受到赞赏.
If anyone has any experience running JSPs like this you insight is appreciated.
推荐答案
超级RTFM
如果还有其他人遇到这个问题.
If anyone else runs into this.
取消注释此部分
<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>
和本节
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
/lucee/tomcat/conf/web.xml
of /lucee/tomcat/conf/web.xml
这篇关于在Tomcat上运行Lucee并需要服务器JSP页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!