Spring boot+Spring Security 4配置整合實例
1. 使用Spring Security管理用戶身份認證、登錄退出
2. 用戶密碼加密及驗證
3. 采用數據庫的方式實現Spring Security的remember-me功能
4. 獲取登錄用戶信息。
5.使用Spring Security管理url和權限
posted @ 2018-03-19 21:02 風人園 閱讀(318) | 評論 (0) | 編輯 收藏
風人園弱水三千,只取一瓢,便能解渴;佛法無邊,奉行一法,便能得益。
隨筆 - 99, 文章 - 181, 評論 - 56, 引用 - 0
|
Spring boot+Spring Security 4配置整合實例
http://blog.csdn.net/code__code/article/details/53885510
1. 使用Spring Security管理用戶身份認證、登錄退出 2. 用戶密碼加密及驗證 3. 采用數據庫的方式實現Spring Security的remember-me功能 4. 獲取登錄用戶信息。 5.使用Spring Security管理url和權限 posted @ 2018-03-19 21:02 風人園 閱讀(318) | 評論 (0) | 編輯 收藏 spring security 參數配置
摘要: // 自定義登錄頁面 http.csrf().disable().formLogin().loginPage("/login") //指定登錄頁的路徑&n... 閱讀全文
posted @ 2018-03-19 20:33 風人園 閱讀(434) | 評論 (0) | 編輯 收藏 spring quartz 串行配置<bean id="jobDetail7"class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <propertyname="targetObject" ref="billingBillTask"></property> <propertyname="targetMethod" value="executeInternal" /> <propertyname="concurrent" value="false" /> </bean> <beanid="billingBillTask"class="com.dangdang.tms.job.schedule.bms.BillingBillTask"/> <beanid="cronTriggerBean7" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <propertyname="jobDetail" ref="jobDetail7"></property> <propertyname="cronExpression" value="0/5 * * * * ?"></property> </bean> posted @ 2018-03-12 19:58 風人園 閱讀(388) | 評論 (0) | 編輯 收藏 spring 3.0 async 異步方法 設置
為了解決一些比較費時且不是很緊要的任務,將此任務轉為異步任務處理,提高前端操作體驗。
spring 中 自帶注解 @Async.
配置如下
applicationContext.xml 中 增加 task的引用
posted @ 2017-05-24 14:27 風人園 閱讀(263) | 評論 (0) | 編輯 收藏 android ResourceNotFoundException在對 TextView 或者 EditText 進行賦值時,調用setText()方法,一定要注意,使用String類型,不要使用int 或者long,否則 會出現找不到資源的異常。系統自動會將int作為一個資源ID,然后去R 里面找,結果找不到。 posted @ 2016-12-21 20:48 風人園 閱讀(137) | 評論 (0) | 編輯 收藏 android 系統提示對話框(AlertDialog)的使用(zt)
摘要: http://blog.csdn.net/meng425841867/article/details/8523730
在按鍵單擊事件中添加創建對話框并設置相關屬性。
[java] view plain copy
dialogButton=(Button)findViewBy... 閱讀全文
posted @ 2016-12-02 12:54 風人園 閱讀(476) | 評論 (0) | 編輯 收藏 Android 自定義ListView adapter(zt)
摘要: http://daoshud1.iteye.com/blog/1874241
本文講實現一個自定義列表的Android程序,程序將實現一個使用自定義的適配器(Adapter)綁定 數據,通過contextView.setTag綁定數據有按鈕的ListView。 系統顯示列表(ListView)時,首先會實例化一個適配器,本文將實例化一個自定義的適配器。實現 自定義適... 閱讀全文
posted @ 2016-12-01 13:13 風人園 閱讀(168) | 評論 (0) | 編輯 收藏 Android之SimpleAdapter簡單實例和SimpleAdapter參數說明(zt)
摘要: http://blog.csdn.net/x605940745/article/details/11981049
SimpleAdapter的參數說明 第一個參數 表示訪問整個android應用程序接口,基本上所有的組件都需要 第二個參數表示生成一個Map(String ,Object)列表選項 第三個參數表示界面布局的id 表示該文件作為列表項的組件&... 閱讀全文
posted @ 2016-12-01 13:12 風人園 閱讀(184) | 評論 (0) | 編輯 收藏 android開發教程之listview使用方法
首先是布局文件,這里需要兩個布局文件,一個是放置列表控件的Activity對應的布局文件 main.xml,另一個是ListView中每一行信息顯示所對應的布局 list_item.xml 這一步需要注意的問題是ListView 控件的id要使用Android系統內置的 android:id="@android:id/list"
main.xml ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() list_item.xml ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 然后就設置MainActivity中的代碼了:基本思想就是先將數據添加到ArrayList中,然后在設置SimpleAdapter適配器完成設置,入下: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 另外對點擊某一行作出響應的方法是覆寫onListItemClick方法,根據返回的position(從0開始): ![]() ![]() ![]() ![]() ![]() posted @ 2016-12-01 13:08 風人園 閱讀(157) | 評論 (0) | 編輯 收藏 android json 數據解析單數據{'singer':{'id':01,'name':'tom','gender':'男'}} 多個數據{"singers":[ {'id':02,'name':'tom','gender':'男'}, {'id':03,'name':'jerry,'gender':'男'}, {'id':04,'name':'jim,'gender':'男'}, {'id':05,'name':'lily,'gender':'女'}]} posted @ 2016-11-29 15:09 風人園 閱讀(163) | 評論 (0) | 編輯 收藏 button onClick 事件的幾種調用方式
public class TestButtonActivity extends Activity implements OnClickListener {
Button btn1, btn2;
Toast tst;
@Override
protected void onCreate(Bundle savedInstanceState) {
super .onCreate(savedInstanceState);
setContentView(R.layout.activity_test_button);
btn1 = (Button) findViewById(R.id.button1);
btn2 = (Button) findViewById(R.id.button2);
btn1.setOnClickListener( this );
btn2.setOnClickListener( this );
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.button1:
tst = Toast.makeText( this , "111111111" , Toast.LENGTH_SHORT);
tst.show();
break ;
case R.id.button2:
tst = Toast.makeText( this , "222222222" , Toast.LENGTH_SHORT);
tst.show();
break ;
default :
break ;
}
} }
posted @ 2016-11-29 13:31 風人園 閱讀(907) | 評論 (0) | 編輯 收藏 打開activity的幾種方式一、直接打開,不傳遞參數 Intent intent = new Intent(this, Activity.class); startActivity(intent); 二、傳遞參數 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 三、回傳參數 posted @ 2016-11-29 13:24 風人園 閱讀(444) | 評論 (0) | 編輯 收藏 spring mvc @ExceptionHandler 異常處理spring mvc 統一的異常處理,有兩種方式。
一、exceptionResolver 二、ExceptionHandler 兩者不能同時配置。如果配置了第一種,則第二種無效。就因為這個原因,找了一天的問題。 ExceptionHandler 通過注解的方式,進行配置,只需要在某個controller 中設置了這個注解,則這個controller中的所有異常都會通過這個方法進行處理。 比如rest controller,增加一個 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 這樣,這個controler中的異常,都會由這個異常處理方法,進行統一處理,生成異常json。避免在各個方法中通過try catch 的方法,進行異常處理。 posted @ 2016-11-08 08:32 風人園 閱讀(395) | 評論 (0) | 編輯 收藏 有關使用 ActionBarSherlock 自定義樣式的問題1、不同android 版本,需要設置不同的 sytle 文件。
默認 通常我們會設置values下面的style 文件 但是如果是4.0以上,則還需要設置values-v14下面的style文件。 否則不能生效 posted @ 2014-03-30 09:00 風人園 閱讀(470) | 評論 (0) | 編輯 收藏 |
|