Struts2 在IDEA<s:datetimepicker/>的问题
2015-11-10 21:49
507 查看
鉴于很多人说Intellij IDEA 非常好用,我也开始了我的IDEA之旅。作为一名Eclipse的使用者,旅途中自是各种曲折。比如说今天用这个学习研究struts2真是烦不胜烦。
原因:Strust2.1开始,对于ajax类的标签不再使用<%@ taglib prefix="s" uri= "/struts-tags"%>
引用
具体原因我就不多说了详情请见大神博客:http://www.th7.cn/Program/java/201406/221080.shtml
这位大神讲的非常详细,有一点补充的是:
我们如何知道对应pojo-plugin版本和struts的版本呢?
打开这个dojo-plugin.jar里面的struts-plugin.xml
这个就是你所需要的版本号,所以我maven配置了这个版本。这个问题解决 <dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.24.1</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dojo-plugin</artifactId>
<version>2.3.24.1</version>
</dependency>
刚开始百度,google各种答案:大概的意思是把这两个对应的tld放在WEB-INF目录下面,然后在web.xml中手动指定。
后面看了有位大神的文章之后很有启发,虽然那位大神没有给出解决办法,但是还是谢谢那位大神。下面给出大神的博客:Struts2的dojo使用与/template/ajax/head.ftl
not found.
最后几经波折终于解决了问题:
主要原因是我是在原来project下新建的一个module(IDEA的project相当于原来的workspace),当前module中依赖的是原来project的包。把依赖改为自己的依赖就可以解决问题。
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.24.1</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dojo-plugin</artifactId>
<version>2.3.24.1</version>
</dependency>
<s:datetimepicker/>的问题
刚开始导了/struts-tags之后发现没有<s:datetimepicker/>这个标签原因:Strust2.1开始,对于ajax类的标签不再使用<%@ taglib prefix="s" uri= "/struts-tags"%>
引用
具体原因我就不多说了详情请见大神博客:http://www.th7.cn/Program/java/201406/221080.shtml
这位大神讲的非常详细,有一点补充的是:
我们如何知道对应pojo-plugin版本和struts的版本呢?
打开这个dojo-plugin.jar里面的struts-plugin.xml
这个就是你所需要的版本号,所以我maven配置了这个版本。这个问题解决 <dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.24.1</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dojo-plugin</artifactId>
<version>2.3.24.1</version>
</dependency>
两个东西 "/struts-tags" not found 、"/struts-dojo-tags" not found
刚开始百度,google各种答案:大概的意思是把这两个对应的tld放在WEB-INF目录下面,然后在web.xml中手动指定。<taglib> <taglib-uri>/struts-tags</taglib-uri> <taglib-location>/WEB-INF/struts-tags.tld</taglib-location> </taglib> <taglib> <taglib-uri>/struts-dojo-tags</taglib-uri> <taglib-location>/WEB-INF/struts-dojo-tags.tld</taglib-location> </taglib>然而我按照上述办法弄了之后还是没能解决我的问题。。。。。。
后面看了有位大神的文章之后很有启发,虽然那位大神没有给出解决办法,但是还是谢谢那位大神。下面给出大神的博客:Struts2的dojo使用与/template/ajax/head.ftl
not found.
最后几经波折终于解决了问题:
主要原因是我是在原来project下新建的一个module(IDEA的project相当于原来的workspace),当前module中依赖的是原来project的包。把依赖改为自己的依赖就可以解决问题。
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.24.1</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dojo-plugin</artifactId>
<version>2.3.24.1</version>
</dependency>
相关文章推荐
- JQuery+Strusts1.x无刷新登录
- java struts常见错误以及原因分析
- Struts之logic标签库详解
- struts2的select标签用法实例分析
- SSH框架网上商城项目第20战之在线支付平台
- java中struts 框架的实现
- sprng和struts有什么区别?
- SpringMVC+MyBatis项目总结(三)
- IntelliJ IDEA & Android Studio的调整优化
- MyEclipse7.5+JDK1.6+Tomcat6+Struts1.3+MySQL4.1开发演示
- struts使用拦截器注解
- 懒到极致:对mybatis的进一步精简
- idea中切换svn地址不起作用
- 使用Ant构建SSH项目(Intellij IDEA版)
- 浅谈struts1和struts2框架(转载+整理)
- idea常用设置
- 使用IntelliJ IDEA开发SpringMVC网站(三)数据库配置
- 使用IntelliJ IDEA开发SpringMVC网站(四)用户管理
- Maven搭建struts2+spring+hibernate环境(二)