用maven来构建一个web应用程序(这个网上很多就不多介绍了,google一下就能找到),并在pom配置文件里面加入jetty插件来支持应用的及时发布,以便于调试,。
但如果我的web应用中用了jstl的一些taglib的时候由于我配置的jetty服务器本身不能识别taglib于是便会报如下一个错误
The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
在网上找了一些解决办法大多是针对tomcat服务器的,主要是要把jstl和standard这两个包复制到tomcat根目录下common/lib下就可以了,而此处我们用的是由maven部署的jetty服务器的 插件形式,我这两个包怎么来放置呢?
查看了一下maven官网对jetty的使用说明。发现只要在POM中对jetty做如下配置就可以了:
[code]
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
[/code]
实际上这种方式就是告诉jetty要以那两个包为依赖来运行了。。enjoying~
但如果我的web应用中用了jstl的一些taglib的时候由于我配置的jetty服务器本身不能识别taglib于是便会报如下一个错误
The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
在网上找了一些解决办法大多是针对tomcat服务器的,主要是要把jstl和standard这两个包复制到tomcat根目录下common/lib下就可以了,而此处我们用的是由maven部署的jetty服务器的 插件形式,我这两个包怎么来放置呢?
查看了一下maven官网对jetty的使用说明。发现只要在POM中对jetty做如下配置就可以了:
[code]
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
[/code]
实际上这种方式就是告诉jetty要以那两个包为依赖来运行了。。enjoying~
3万+

被折叠的 条评论
为什么被折叠?



