extjs datefield 使用url传递参数

最近发现,extjs的datefield控件在使用extjs自带的传递参数的方式时传递到后台会按照datefield设定的格式(例如format: ‘Y-m-d’)。但如果使用url传递参数,传递到后台会不按这种格式。而是web apr 6 00:00:00 UTC+0800 2014 类似这种。

处理:var startDate = Ext.util.Format.date(sform.findField(‘startDate’).getValue(),’Y-m-d’);

然后可以在url中使用:url=basePath+’/searchExam.action?startdate=’+startDate。

后台接收即可:String startDate = getRequest().getParameter(“startDate”);

This entry was posted in Computer, Java. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s