- 浏览: 54300 次
- 性别:
- 来自: 潘多拉星球
-
最新评论
-
a1034919908:
哥们你棒棒的,我试了下,很管用
detached entity passed to persist异常解决 -
weituotian:
查看id生成策略,然后呢?
detached entity passed to persist异常解决
文章列表
前天,帮同学写程序。他们公司用struts2.0,而我也没用过struts2,索性借此学习一下struts2吧。发现struts2结合spring搭建,不像struts那样要在struts配置spring插件,貌似已经在filter做好了。先将配置文件展出,供初学者参考。
1.web.xml
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispat ...
在Java核心书中发现GregorianCalendar类,对日期处理,感觉不错
GregorianCalendar gre = new GregorianCalendar();
int today = gre.get(Calendar.DAY_OF_MONTH);
int month = gre.get(Calendar.MONTH);
gre.set(Calendar.DAY_OF_MONTH,1);
int weekDay = gre.get(Calendar.DAY_OF_WEEK);
System.out.println("Sun Mon ...
首先,在页面引入标签[color=red]
<!--taglib prefix="s" uri="/struts-tags"-->
[/color] 迭代标签如下:
<s:iterator value="#request.bookList" id="book" status="st">
<tr <s:if test="#st.odd">style="background-color:#bbbbbb"& ...
今天在做struts2.0实验时,总是报404错误,而配置文件都ok.郁闷啊,在网上查看了很多别人的代码,愣是没发现错误在哪里。最后,在form的action中改为**.action,问题解决了。这真是让人感觉龌龊啊,在web.xml映射已经用了/*,由于页面没用struts标签,且路径不加.aciton既然出404错.
页面没用struts标签,遇到404,解决方法:action="**.action"(前提配置正确)