GWT + JSTL处于开发模式 - 有可能吗? [英] GWT + JSTL in development mode -- is it possible?
问题描述
我有一个GWT应用程序(由roo生成),我决定用Spring Security来保护它。 Roo生成一个login.jspx页面作为安全设置的一部分,这个jspx使用一些基本的JSTL标签库。
在开发模式下运行时,基础的Jetty服务器显然不会喜欢这个。使用以下Maven依赖关系
<依赖关系>
< groupId> javax.servlet.jsp.jstl< / groupId>
< artifactId> jstl-api< / artifactId>
< version> 1.2< / version>
< classifier />
< /依赖关系>
< dependency>
< groupId> org.glassfish.web< / groupId>
< artifactId> jstl-impl< / artifactId>
< version> 1.2< / version>
< classifier />
< /依赖关系>
我得到
java.lang.AbstractMethodError:javax.servlet.jsp.PageContext.getELContext()Ljavax / el / ELContext;
我的猜测是jstl-impl依赖与Web容器已经提供的依赖冲突,但当我将其范围更改为提供时,我得到:
org.apache.jasper.JasperException:/ WEB-INF / views / login.jspx(22,69)属性前缀fn不对应于任何导入的标记库
任何人得到这个工作成功?
PS我听到有传闻说你可以将应用程序导出到Tomcat,并且它运行良好,但是GWT编译可能是一个耗时的操作,所以在开发模式下工作会很棒。
<很显然,支持GWT开发模式的Jetty服务器已经在类路径中的某个地方存在JSTL 1.1了。如果您更改默认添加的Roo添加的Maven依赖关系,则可以使用这些依赖项。
< groupId> javax.servlet.jsp.jstl< / groupId>
< artifactId> jstl-api< / artifactId>
< version> 1.2< / version>
< classifier />
< /依赖关系>
< dependency>
< groupId> org.glassfish.web< / groupId>
< artifactId> jstl-impl< / artifactId>
< version> 1.2< / version>
< classifier />
< /依赖关系>
至
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> jstl< / artifactId>
< version> 1.1.1< / version>
< classifier />
< /依赖关系>
< dependency>
< groupId> taglibs< / groupId>
< artifactId>标准< / artifactId>
< version> 1.1.1< / version>
< /依赖关系>
您将有一个可用的GWT + JSTL环境!
I have a GWT app (generated by roo) that I have decided to secure with Spring Security. Roo generates a login.jspx page as part of the security setup and this jspx uses some basic JSTL taglibs.
When running in development mode, the underpinning Jetty server apparently does not like this. With the following Maven dependencies
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
<classifier/>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jstl-impl</artifactId>
<version>1.2</version>
<classifier/>
</dependency>
I get
java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
My guess was that the jstl-impl dependency was conflicting with one already provided by the web container, but when I change its scope to provided, I get:
org.apache.jasper.JasperException: /WEB-INF/views/login.jspx(22,69) The attribute prefix fn does not correspond to any imported tag library
Anybody gotten this to work successfully?
P.S. I hear rumors that you can just export the app to Tomcat, and it runs fine, but GWT compilation can be a time consuming operation, so it would be great to get this working in dev mode.
Evidently, the Jetty server underpinning GWT development mode has JSTL 1.1 already on the classpath somewhere. If you change the Maven dependencies that Roo adds by default
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
<classifier/>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jstl-impl</artifactId>
<version>1.2</version>
<classifier/>
</dependency>
to
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.1</version>
<classifier/>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.1</version>
</dependency>
you will have a working GWT + JSTL environment!
这篇关于GWT + JSTL处于开发模式 - 有可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!