如果request.getRequestDispatcher();中不是页面而是传action的话,参考以下内容修改:web.xml 2.4版本里,默认的filter只拦截request。如果使用request.getRequestDispatcher("xx.action").forward(re...
分类:
其他好文 时间:
2014-08-22 16:07:38
阅读次数:
162
2.1.1 事务(Transaction)事务(Transaction)是这样一个点,我们为了衡量某个action的性能,需要在action的开始和结束位置插入这样一个范围,这就定义了一个transaction,LoadRunner 运行到该事务的开始点时,LoadRunner 就会开始计时,直到运...
分类:
其他好文 时间:
2014-08-22 15:59:49
阅读次数:
191
?调用系统窗口调用Google搜索Intent intent = new Intent();intent.setAction(Intent.ACTION_WEB_SEARCH);intent.putExtra(SearchManager.QUERY,"searchString");startActi...
分类:
其他好文 时间:
2014-08-22 12:53:39
阅读次数:
161
如题,以ASP.NET MVC为例,解决办法如下:控制器中:public JsonResult Test(){ return Json(json, "text/html");}视图中:$.post("/controller/action/", function (data) { ...
分类:
Web程序 时间:
2014-08-22 12:32:16
阅读次数:
177
在上一篇博文中,有介绍到用换行符分割消息的方法。但是这种方法有个小问题,如果消息中本身就包含换行符,那将会将这条消息分割成两条,结果就不对了。
本文介绍另外一种消息分割方式,即上一篇博文中讲的第2条:use a fixed length header that indicates the length of the body,用一个固定字节数的Header前缀来指定Body的字节数,以此来分割消息。...
分类:
Web程序 时间:
2014-08-22 10:51:06
阅读次数:
265
Web.xml文件与1中相同。
1)Action类为:
public class HelloAction {
private String userName;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName...
分类:
其他好文 时间:
2014-08-22 09:24:16
阅读次数:
158
Struts2为Action中的属性提供了依赖注入功能,在struts2的配置文件中,可以为Action中的属性注入值,属性必须提供setter方法。
1)employeeAction类:
public class employeeAction {
private String savePath;
public String getSavePath() {
return savePa...
分类:
其他好文 时间:
2014-08-22 09:23:55
阅读次数:
205
常量有两种配置方式:
1)在struts.xml中配置:(建议使用此种配置方式)
2)在struts.properties中配置常量:
truts.action.extension = action
因为常量可以在下面多配置文件中进行定义,所以我们需要了解struts2加载常量的搜索顺序:
struts-default.xml
struts-plugin.xml
st...
分类:
其他好文 时间:
2014-08-22 09:23:35
阅读次数:
269
在大部分应用里,随着应用规模的增加,系统中Action的数量也会大量增加,导致struts.xml配置文件变的非常臃肿,为了避免struts.xml文件过于庞大、臃肿,提高struts.xml文件的可读性,我们可以将一个struts.xml配置文件分解成多个配置文件,然后再struts.xml文件中包含其它配置文件。下面的struts.xml通过元素:
<package na...
分类:
其他好文 时间:
2014-08-22 09:22:55
阅读次数:
182
(一)直接调用方法(不推荐使用)
1)Action类:
private String savePath;
public String getSavePath() {
return savePath;
}
public void setSavePath(String savePath) {
this.savePath = savePath;
}
public String...
分类:
其他好文 时间:
2014-08-22 09:22:46
阅读次数:
141