- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
它是一个带有 tomcat 7 和 java 6 的 spring boot 项目。我正在尝试使用 jasper.Jspc 预编译 jsps,但在生成的 Java EL 中未进行评估。
out.write("script src=\"${pageContext.request.contextPath}/resources/js/AdvanceDeviceInfo.js\">\r\n");
它应该是这样的:
out.write((java.lang.String)org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath}"
如果我使用 <%@ page isELIgnored="false" %>
然后在单个 jsps 中对其进行正确评估。请帮助我不要去更改每个 jsp。
用于预编译的 Ant 脚本
<target name="main">
<echo message="base dir: ${project.basedir}"/>
<echo message="compile_classpath: ${compile_classpath}"/>
<mkdir dir="${target_dir}/java"/>
<mkdir dir="${target_dir}/resources"/>
<path id="jspc_classpath">
<path path="${compile_classpath}"/>
</path>
<!-- <property environment="org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING" value="false"/> -->
<taskdef classname="org.apache.jasper.JspC" name="jasper" classpathref="jspc_classpath"/>
<copy todir="${project.basedir}/target/jsp">
<fileset dir="${project.basedir}/src/main/webapp">
<include name="**/templates/*.jsp"/>
<include name="**/views/**"/>
<exclude name="**/CVS/**"/>
</fileset>
</copy>
<copy todir="${project.build.outputDirectory}/public/resources">
<fileset dir="${project.basedir}/src/main/webapp/resources">
<include name="**/css/**"/>
<include name="**/img/**"/>
<include name="**/fonts/**"/>
<include name="**/js/**"/>
<include name="**/pie/**"/>
<exclude name="**/CVS/**"/>
</fileset>
</copy>
<jasper verbose="0"
uriroot="${project.basedir}/target/jsp"
webxml="${target_dir}/resources/jsp-web.xml"
trimSpaces="true"
outputDir="${target_dir}/java/" >
</jasper>
<copy todir="${project.build.outputDirectory}">
<fileset dir="${target_dir}/resources"/>
</copy>
<javac srcdir="${target_dir}/java"
destdir="${project.build.outputDirectory}"
classpathref="jspc_classpath"
fork="true"
encoding="UTF-8"
includeantruntime="false"/>
</target>
最佳答案
这里有几个解决方案。
您看到这个的原因可能是由于您的 web.xml 文件的版本。如果 web.xml 版本为 2.3,则默认情况下不会计算表达式。
例如,您可能会将其放在 web.xml 文件的顶部:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp_ID">
如果是这样,您可以将其修改为较新的版本(2.4、2.5、3.0),默认情况下将对表达式求值。例如,将上面的文本更改为:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
你应该会看到你的表达式开始被计算。
或者,您可以在 web.xml 中添加此 JSP 属性组以将 scripting-invalid
设置为 false,而不是更改 web.xml 文件的版本。
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>false</scripting-invalid>
</jsp-property-group>
关于jsp - 在使用 tomcat 7 的 jspc 预编译 jsp 期间未评估 el,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38952859/
您好,当我尝试构建build.xml 文件。谁能给我一个解决方案。提前致谢 最佳答案 我将以下内容添加到我的 ant 类路径中: /usr/local/apache-tomcat-7/bin/tomc
我正在尝试在gradle中使用jspc来编译我们的jsp文件,但是却遇到了异常。 这是相关的gradle部分 //tomcatHome is defined in gradle.properties
我们正在使用 Maven 3,我面临一个具有 JSP 文件并且还使用存储在不同项目中的“全局”JSP 文件的项目。这在使用 maven-war-plugin 时效果很好和 webResources .
在 Maven 项目中,运行 mvn package 时收到以下错误: [ERROR] Failed to execute goal org.codehaus.mojo:jspc-maven-plug
我在我的 pom.xml 中添加这样的 jspc 插件 org.codehaus.mojo.jspc
在哪里可以找到 JBoss 4.2 发行版(确切地说是 4.2.2.GA 发行版)中的 org.apache.jasper.JspC 类?谢谢 克劳迪奥 最佳答案 jboss-4.2.2.GA\ser
当我尝试构建(ant build)xml 文件时,出现错误“No public execute() in class org.apache.jasper.JspC”。你能建议一个解决方案吗?提前致谢
我遇到了这里提到的一些问题: Unable to properly install binary edition of Apache Ant . 我按照以下步骤替换 http://repository
我正在使用 Maven 在我的 web 应用程序中预编译 JSP。我使用了相当多的自定义标签,但其中之一阻碍了 Apache 的 JSP 编译器。 JSP 的相关部分是这样的:
它是一个带有 tomcat 7 和 java 6 的 spring boot 项目。我正在尝试使用 jasper.Jspc 预编译 jsps,但在生成的 Java EL 中未进行评估。 out.wri
我已经创建了多模块 CQ5 Maven 项目。我的 Cq 版本是 5.5,Java 版本是 6。 这些是我遵循的步骤。 创建maven多模块CQ maven项目 在eclipse中导入 使用 VLT
之后:在 openfire-apns-plugin 目录中运行:mvn clean install -X 我遇到以下错误 [ERROR] Failed to execute goal com.reuc
我是一名优秀的程序员,十分优秀!