![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Struts
iteye_5856
这个作者很懒,什么都没留下…
展开
-
Struts2标签与JSTL实现截取字符串长度
<s:if test="%{title.length()>300}"> <s:property value="title.substring(0,300)+'...'"/></s:if><s:else> <s:property value="title"/></原创 2012-01-03 12:01:03 · 117 阅读 · 0 评论 -
<s:iterator>迭代一行4列
<table border="1"> <s:iterator value="xxx" status="status" > <s:if "#status.index % 4 == 0"> <tr> </s:if&原创 2012-01-03 17:31:08 · 93 阅读 · 0 评论 -
通过struts2的JSONResult返回json数据的配置
<package name="json" extends="json-default" namespace="/test"> <action name="testByAction" class="cn.ysh.studio.struts2.json.demo.action.UserAction" method="testB原创 2012-09-24 22:17:21 · 112 阅读 · 0 评论 -
Can not find a java.io.InputStream with the name [inputStream] in the invocation
具体异常是这句话: Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the tag specified for this action. 1.文件路径不对,根本就没有取到文件。这种情况下,可以将获得InputStream的那条语句放在system...原创 2012-11-30 11:38:24 · 162 阅读 · 0 评论 -
Java获取系统文件类型图标并显示在JSP上
在网站制作中通常需要上传附件,而对于附件我们往往希望在其名称前面有类似于Windows系统中的类型图标,那么怎么根据附件的类型来显示不同的图标呢?目前有两种解决方案: 第一种:将所有类型文件的图标图片放置到项目中,然后通过分析文件的扩展名来调用相应的图片,这种方式比较简单常见,但是我们往往无法弄到所有文件类型的图标,而且也不能排除意外情况的出现,这里就不在介绍了; 第二种:通过java调用系统...原创 2012-12-03 15:51:04 · 371 阅读 · 0 评论 -
Spring AOP操作action时无法注入,报NullPointer异常
当使用Spring AOP对action层进行操作时,会出现注入失败的问题,出现空指针异常。 原因是一般struts2+spring应用中,spring的插件只负责为action的ioc部分,但并没有进行功能加强,即采用代理的机制,所有的action还是使用struts2进行管理, 在使用AOP后,这些action需要由spring进行管理,如果没有由spring进行代理,将出现注入失败。 ...原创 2013-03-06 11:33:19 · 362 阅读 · 0 评论 -
Struts2拦截器处理用户操作日志
[code="java"] public String intercept(ActionInvocation invocation) throws Exception { ActionContext ac = invocation.getInvocationContext(); Object action = invocation.getAction(); if (act...原创 2013-03-06 14:18:29 · 143 阅读 · 0 评论