站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题大家能都来谈谈我们在开发STRUTS时候应该注意的事项吗?

大家能都来谈谈我们在开发STRUTS时候应该注意的事项吗?

摘要: 大家能都来谈谈我们在开发STRUTS时候应该注意的事项吗?


结合大家的工作经验来谈谈,学习学习,可能我这么说方面很笼统
反正大致的意思就是开发的时候经常会遇见的问题和出现错误之类的
大家都聊聊 不要错过了 呵呵


自己顶上去啊 哈哈


首先,个人认为struts的设计初衷是好的,强化了mvc模式的应用,不过实际应用中如果死套这个框架有时候会适得其反,灵活性大大降低,要合理使用


其次,目前ajax的流行,使得struts的应用会有点受限制,至少它的标签不适合在客户端使用


First and most important, thou shalt make your Action classes be thread-safe, unless the RequestProcessor.processActionCreate method has been properly overwritten.

Action's execute method returns ActionForward, but this never means the returned ActionForward should be configured from ActionMapping.

When downloading, or in other cases when the response has been comitted, thou shalt return null in the execute method.

Learn to use BeanUtils and ConvertUtils, which might help you a lot.

Remember, the RequestProcessor.processXXX methods will be invoked again when the first Action returns a ".do" ActionForward. This behavior might cause a single ActionForm be reset and validated twice during a single user request, and thus a worse performance. It might also make two sequential Actions belong to two separate transaction, and usually the developers are not aware of it.

The / tags are a bit different from the ones in the value filter operation. The formers (extends BaseHandlerTag) don't call ResponseUtils.filter() to filter <input ... value="ab"c"> to <input ... value="ab&quot;c">, while the laters (extends BaseFieldTag) do.

Not related to Struts, but related to B/S application. DO NOT rely on the client-side script, as they are not so reliable and testable; Use nothing but IE (minor-version-dependent) to test your application, even the browser's core is IE.


up


↑返回目录
前一篇: jsp中如何获取客户端浏览器信息
后一篇: jsp中 session存活时间是多长?