gpt4 book ai didi

jsp - JspServlet中的 "mappedfile"参数代表什么?

转载 作者:行者123 更新时间:2023-11-28 21:54:38 24 4
gpt4 key购买 nike

我正在阅读 https://tomcat.apache.org/tomcat-7.0-doc/jasper-howto.html

有参数:

mappedfile - Should we generate static content with one print statement per input line, to ease debugging? true or false, default true.

但是我不明白这个参数的详细用法是什么,我试着用谷歌搜索但没有帮助。谁能告诉我它是什么。

最佳答案

mappedfile为真,容器为 JSP 文件中的每个 HTML 文本行生成“out.print()”。当为 false 时,来自多行的 HTML 文本被连接起来并输出到一个“out.print()”中,这就是它简化调试的方式。

<JspInterceptor mappedFile="true" />容器将生成如下内容:

out.write("<!DOCTYPE html>\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("<title>Test</title>\r\n");
out.write("</head>\r\n");

<JspInterceptor mappedFile="false" />像这样:

out.write("<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><title>Index</title></head>");

旧版本 tomcat (3,4)默认有这个选项false和从 tomcat 5 开始的新版本默认有这个选项 true .

关于jsp - JspServlet中的 "mappedfile"参数代表什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37586068/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com