POWL(Personal Object Worklist) for Web Dynpro

转载地址:https://blogs.sap.com/2013/02/15/powlpersonal-object-worklist-for-web-dynpro/

2 Likes 8,428 Views 21 Comments 

Summary

This document illustrates how to make personnel object work list, Feeder class and how to integrate POWL with WD ABAP.

Author: Rohan Sanjay Uphade

Company: NTT DATA India EAS Ltd.

Created on: 12 December 2012

Author Bio

Rohan is SAP certified Consultant and works in NTT DATA, He has work experience in SAP ABAP , Dynamic programming,

WebDynpro ABAP, POWL , Smart forms , Adobe forms and so on.

Main Steps Involve in creating POWL Feature.

  1. Create Feeder class
  2. Implement Feeder class method
  3. Define Application id, Type, Role and queries
  4. Integrate POWL with our WebDynpro application
  5. Test POWL

1. Create Feeder class.

  • For our example, we need to create tables for Data selection
  • Create a table name:  YEMPLOYEE, presented in Fig. 2.
  • Create Table entries for above table for references.
  • Create Table Type    : YTT_YEMPLOYEE ,presented in Fig.3

  

   Fig. 2 Database table used for our example

Fig. 3 Table type for database table YEMPLOYEE.

  • Now go to T.Code: SE24 and create a class with following interface, presented in Fig.4
  • Class Name          : YPOWL_CLASS.
  • Interface Name     : IF_POWL_FEEDER.

Fig. 4 YPOWL_CLASS   is made and is using the interface IF_POWL_FEEDER.

  • Now create attribute for same class, presented in Fig.5
  • Attribute Name:

   MT_RESULT                      Type      YTT_YEMPLOYEE.

   MT_FIELDCAT                   Type      POWL_FIELDCAT_TTY

   MT_SELCRITERIA              Type      POWL_SELCRIT_TTY

   MT_CRITERIA_DEFAULT   Type      RSPARAMS_TT

Fig. 5 Attribute for YPOWL_CLASS   is made.

  • Implemented Feeder class has various methods as shown in Fig 6.

   Fig.6 Interface Implemented methods.

   NOTE:  It is not necessary to use all methods provided by interface from the start.

   There are 2 mandatory methods and 6 optional ones.

   GET_OBJECTS and GET_OBJECT_DEFINITION are two mandatory methods, rest are optional.

  Method description:

1.GET_ACTIONS: In this method, we can define the buttons and their action which can be handle in

Method HANDLE_ACTION. Method GET_ACTION properties defined in structure POWL_ACTDESCR_STY like text, tooltip, index etc.

2.GET_ACTION_CONF: In this method, one can fire a confirmation dialog window  on the click of button, it will ask user whether to delete

the entries or not or similar.

3.GET_SEL_CRITERIA: In these method selection criteria is defined for this particular feeder.  I.E Fields which appear in POWL selection screen.

    • Structure use: POWL_SELCRIT_STY

4.GET_FIELD_CATALOG: This method describes the field catalog to be used for query results table and the UI properties of the particular fields.

    • Various properties can be set here: Column position, column header, column visible, column color etc.
    • Structure use: POWL_FIELDCAT_STY.

5.GET_OBJECT_DEFINITION: This method is used to define the container (e.g. specify field types) where the selected data gets stored.

6.GET_OBJECTS: This method is used to retrieve data from the backend system. Data retrieval can be done via simple select query or by

using a function module. Selected data is passed to E_RESULTS which is exporting parameter of this method

7.GET_DETAIL_COMP:Enable the detail component feature.

8.HANDLE_ACTION: In this, all the actions for the buttons are defined and also we can control enable/disable property of buttons here.

Control can be  transferred from class to portal via firing a event using :

    • E_portal_actions-fire_wdevent = abap_true.

2. Implement Feeder class method.

NOTE: Please implement/Activate all method of feeder class, otherwise system will generate dump saying ‘Implementation is missing’.

  • Method GET_ACTIONS
METHOD IF_POWL_FEEDER~GET_ACTIONS.
DATA:WA_POWL_ACTIONS TYPE POWL_ACTDESCR_STY,
IT_POWL_ACTIONS TYPE TABLE OF POWL_ACTDESCR_STY.
WA_POWL_ACTIONS-ACTIONID = ‘POWL_LEAD_SEL’.
*WA_POWL_ACTIONS-CARDINALITY = C_FEEDER_ACTION_SEL_REQ.
*WA_POWL_ACTIONS-PLACEMENT = C_FEEDER_ACTION_TOOLBAR.
WA_POWL_ACTIONS-ENABLED = ‘X’.
WA_POWL_ACTIONS-PLACEMENTINDX = .
*WA_POWL_ACTIONS-
WA_POWL_ACTIONS-TEXT = ‘TEST’.
APPEND WA_POWL_ACTIONS TO IT_POWL_ACTIONS.
E_ACTIONS_CHANGED = ‘X’.
C_ACTION_DEFS = IT_POWL_ACTIONS.
ENDMETHOD.
  • Method GET_ ACTION_CONF
  • Method GET_SEL_CRITERIA
METHOD IF_POWL_FEEDER~GET_SEL_CRITERIA.

     DATA: LS_SELCRIT TYPE POWL_SELCRIT_STY,
LS_CRITERIA_DEFAULT TYPE RSPARAMS,
LS_DEFAULT TYPE RSPARAMS.
IF MT_SELCRITERIA IS INITIAL.
LS_SELCRIT TO MT_SELCRITERIA.
LS_SELCRIT-SELNAME = ‘SALARY’.
LS_SELCRIT-KIND = ‘S’.
LS_SELCRIT-PARAM_TYPE = ‘I’.
LS_SELCRIT-SELOPT_TYPE = ‘A’.
LS_SELCRIT-ALLOW_ADMIN_CHANGE = ‘X’.
LS_SELCRIT-DATATYPE = ‘YEMPLOYEE-SALARY’.
APPEND LS_SELCRIT TO MT_SELCRITERIA.
CLEAR LS_SELCRIT.
E_SELCRIT_DEFS_CHANGED = ‘X’.
E_DEFAULT_VAL_CHANGED = ‘X’.
C_SELCRIT_DEFS = MT_SELCRITERIA.
C_DEFAULT_VALUES = MT_CRITERIA_DEFAULT.
ELSE.
C_SELCRIT_DEFS = MT_SELCRITERIA.
C_DEFAULT_VALUES = MT_CRITERIA_DEFAULT.
E_SELCRIT_DEFS_CHANGED = ‘X’.
ENDIF.
CLEAR C_DEFAULT_VALUES.
CLEAR C_DEFAULT_VALUES. ENDMETHOD.
  • Method GET_FIELD_CATALOG
METHOD IF_POWL_FEEDER~GET_FIELD_CATALOG.
DATA: LS_FIELDCAT TYPE POWL_FIELDCAT_STY,
LS_DFIES TYPE DFIES,
LS_FCAT TYPE LVC_S_FCAT,
L_SEQNR TYPE INT4. DEFINE ADD_COLPOS.
ADD TO L_SEQNR.
LS_FIELDCAT-COLPOS = L_SEQNR.
END–OF–DEFINITION. IF MT_FIELDCAT IS INITIAL.
* 1. MANDT
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COLID = ‘MANDT’.
ADD_COLPOS.
LS_FIELDCAT-HEADER_BY_DDIC = ‘X’.
LS_FIELDCAT-FIXED = ‘X’.
LS_FIELDCAT-H_ALIGN = ‘L’.
LS_FIELDCAT-COL_VISIBLE = ‘ ‘.
LS_FIELDCAT-EDITABLE = ‘ ‘.
LS_FIELDCAT-WIDTH = .
INSERT LS_FIELDCAT INTO TABLE MT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COLID = ‘EMP_ID’.
ADD_COLPOS.
LS_FIELDCAT-HEADER_BY_DDIC = ‘X’.
LS_FIELDCAT-FIXED = ‘X’.
LS_FIELDCAT-H_ALIGN = ‘L’.
LS_FIELDCAT-ALLOW_SORT = ‘X’.
LS_FIELDCAT-COL_VISIBLE = ‘X’.
LS_FIELDCAT-EDITABLE = ‘ ‘.
LS_FIELDCAT-WIDTH = .
INSERT LS_FIELDCAT INTO TABLE MT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COLID = ‘EMP_ID’.
ADD_COLPOS.
LS_FIELDCAT-HEADER_BY_DDIC = ‘X’.
LS_FIELDCAT-FIXED = ‘X’.
LS_FIELDCAT-H_ALIGN = ‘L’.
LS_FIELDCAT-ALLOW_SORT = ‘X’.
LS_FIELDCAT-COL_VISIBLE = ‘X’.
LS_FIELDCAT-EDITABLE = ‘ ‘.
LS_FIELDCAT-WIDTH = .
INSERT LS_FIELDCAT INTO TABLE MT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COLID = ‘EMP_NAME’.
ADD_COLPOS.
LS_FIELDCAT-HEADER_BY_DDIC = ‘X’.
LS_FIELDCAT-FIXED = ‘X’.
LS_FIELDCAT-H_ALIGN = ‘L’.
LS_FIELDCAT-ALLOW_SORT = ‘X’.
LS_FIELDCAT-COL_VISIBLE = ‘X’.
LS_FIELDCAT-EDITABLE = ‘ ‘.
LS_FIELDCAT-WIDTH = .
INSERT LS_FIELDCAT INTO TABLE MT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COLID = ‘DESIGNATION’.
ADD_COLPOS.
LS_FIELDCAT-HEADER_BY_DDIC = ‘X’.
LS_FIELDCAT-FIXED = ‘X’.
LS_FIELDCAT-H_ALIGN = ‘L’.
LS_FIELDCAT-ALLOW_SORT = ‘X’.
LS_FIELDCAT-COL_VISIBLE = ‘X’.
LS_FIELDCAT-EDITABLE = ‘ ‘.
LS_FIELDCAT-WIDTH = .
INSERT LS_FIELDCAT INTO TABLE MT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COLID = ‘MANAGER’.
ADD_COLPOS.
LS_FIELDCAT-HEADER_BY_DDIC = ‘X’.
LS_FIELDCAT-FIXED = ‘X’.
LS_FIELDCAT-H_ALIGN = ‘L’.
LS_FIELDCAT-ALLOW_SORT = ‘X’.
LS_FIELDCAT-COL_VISIBLE = ‘X’.
LS_FIELDCAT-EDITABLE = ‘ ‘.
LS_FIELDCAT-WIDTH = .
INSERT LS_FIELDCAT INTO TABLE MT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COLID = ‘SALARY’.
ADD_COLPOS.
LS_FIELDCAT-HEADER_BY_DDIC = ‘X’.
LS_FIELDCAT-FIXED = ‘X’.
LS_FIELDCAT-H_ALIGN = ‘L’.
LS_FIELDCAT-ALLOW_SORT = ‘X’.
LS_FIELDCAT-COL_VISIBLE = ‘X’.
LS_FIELDCAT-EDITABLE = ‘ ‘.
LS_FIELDCAT-WIDTH = .
INSERT LS_FIELDCAT INTO TABLE MT_FIELDCAT.
ELSE.
C_FIELDCAT = MT_FIELDCAT.
ENDIF.
ENDMETHOD.
  • Method GET_ OBJECT_DEFINITION
 METHOD IF_POWL_FEEDER~GET_OBJECT_DEFINITION.
E_OBJECT_DEF ?= CL_ABAP_TABLEDESCR=>DESCRIBE_BY_DATA( ME->MT_RESULT ).
ENDMETHOD.
  • Method GET_OBJECTS
METHOD IF_POWL_FEEDER~GET_OBJECTS.
DATA: R_EMP_ID TYPE RANGE OF YEMPLOYEE-EMP_ID,
R_EMP_NAME TYPE RANGE OF YEMPLOYEE-EMP_NAME,
R_SALARY TYPE RANGE OF YEMPLOYEE-SALARY,
X_BOOK_ID LIKE LINE OF R_EMP_ID,
X_EMP_NAME LIKE LINE OF R_EMP_NAME,
X_SALARY LIKE LINE OF R_SALARY.
FIELD-SYMBOLS: <LFS_PARAMS> TYPE RSPARAMS,
<LF_RESULT> TYPE YEMPLOYEE.
“FILL THE RANGE TABLES
LOOP AT I_SELCRIT_VALUES ASSIGNING <LFS_PARAMS>.
CASE <LFS_PARAMS>-SELNAME.
WHEN ‘EMP_ID’.
MOVE-CORRESPONDING <LFS_PARAMS> TO X_BOOK_ID.
INSERT X_BOOK_ID INTO TABLE R_EMP_ID.
WHEN ‘EMP_NAME’.
MOVE-CORRESPONDING <LFS_PARAMS> TO X_EMP_NAME.
INSERT X_EMP_NAME INTO TABLE R_EMP_NAME.
WHEN ‘SALARY’.
MOVE-CORRESPONDING <LFS_PARAMS> TO X_SALARY.
INSERT X_SALARY INTO TABLE R_SALARY.
ENDCASE.
ENDLOOP.
REFRESH ME->MT_RESULT.
SELECT * FROM YEMPLOYEE INTO TABLE ME->MT_RESULT
WHERE EMP_ID IN R_EMP_ID
AND EMP_NAME IN R_EMP_NAME
AND SALARY IN R_SALARY. E_RESULTS = ME->MT_RESULT.
ENDMETHOD.
  • Method GET_OBJECTS
METHOD IF_POWL_FEEDER~GET_DETAIL_COMP.
E_DETAIL_COMP = ‘YEMPLOYEE_POWL_WD’.
ENDMETHOD.
  • Method GET_DETAIL_COMP
 METHOD IF_POWL_FEEDER~GET_DETAIL_COMP.
E_DETAIL_COMP = ‘YEMPLOYEE_POWL_WD’.
ENDMETHOD.
  • Method HANDLE_ACTION
METHOD IF_POWL_FEEDER~HANDLE_ACTION.
DATA: LS_PARAMETER TYPE POWL_NAMEVALUE_STY.
DATA : X_RESULT TYPE YEMPLOYEE ,
V_INDEX TYPE RSTABIX,
V_INDX() TYPE C.
CASE I_ACTIONID.
WHEN ‘POWL_LEAD_SEL’.
CLEAR:X_RESULT,V_INDX.
READ TABLE C_SELECTED INTO V_INDEX INDEX .
IF SY-SUBRC = .
V_INDX = V_INDEX-TABIX.
READ TABLE C_RESULT_TAB INTO X_RESULT INDEX V_INDX.
IF SY-SUBRC = .
E_PORTAL_ACTIONS-FIRE_WDEVENT = ABAP_TRUE.
LS_PARAMETER-KEY = ‘EMP_ID’.
LS_PARAMETER-VALUE = X_RESULT-EMP_ID.
APPEND LS_PARAMETER TO E_PORTAL_ACTIONS-PARAMETERS.
LS_PARAMETER-KEY = ‘EMP_NAME’.
LS_PARAMETER-VALUE = X_RESULT-EMP_NAME.
APPEND LS_PARAMETER TO E_PORTAL_ACTIONS-PARAMETERS.
LS_PARAMETER-KEY = ‘SALARY’.
LS_PARAMETER-VALUE = X_RESULT-SALARY.
APPEND LS_PARAMETER TO E_PORTAL_ACTIONS-PARAMETERS.
ENDIF.
ENDIF.
ENDCASE.
ENDMETHOD.

3. Define Application id, Type ,Role and queries

  • After a feeder is developed, it needs to be made visible to the roles. Basically, this means we need to register the feeder under a specific APPLID, define a POWER List type and introduce it to the roles .

  Step 1.Create an Application ID

    • Transaction code: FPB_MAINTAIN_HIER
    • Click on Change->Display button and then on New Entries button
    • Give  application id name:YEMPLOYEE_APPLID
    • Presses SAVE , it will ask for transport request. Give/Create transport request and save it.
    • Now u can see your entry (YEMPLOYEE_APPLID) in the list as shown below figure.

Step 2.Create a POWL TYPE

    • Transaction code: POWL_TYPE
    • Click on New Entries button.
    • Give Type name : YEMPLOYEE_TYPE
    • Enter description and feeder class name as shown in below figure.
    • Presses SAVE, it will ask for transport request, add it to same request created for APPLID.
    • Now u can see your entry (YEMPLOYEE_TYPE) in the list.

Step 3.Role assignment for POWL TYPE

  Here we connect the APPLID with the POWL Type and make it visible to the role.

    • Transaction code: POWL_TYPER
    • Click on New Entries button and enter details as shown in figure.
    • NOTE:Role is Optional field and can be specified only if a role dependent mapping is required
    • Press SAVE, it will ask for transport request. Give/Create transport request and save it.

Step 4.Query for POWL

  Here we define default queries for power list. A query id is made which is connected to POWL type.

  NOTE: you can define one or more queries.

    • Transaction code :POWL_QUERY
    • Click on New Entries button and enter details as shown in figure.
    • Press SAVE, and give transport request.
    • After this, we can create/see the query parameters and the query settings with the help of the corresponding buttons:
    • On clicking Query Parameter, you could see following screen, with field declare in feeder class.
    • On clicking Query setting, one can enable different feature like quick search for fields.

  Step 5.Map APPLID & QUERYID for POWL

  Here if several queries are defined then sequence of tabs can be controlled via this transaction.

    • Transaction code :POWL_QUERYR
    • Click on New Entries button and enter details as shown in figure.
    • And tick the checkbox Activate.
    • Press SAVE, and give transport request

4. Integrate POWL with WD application

    • Transaction code :SE80
    • Create a Web Dynpro component YEMPLOYEE_POWL_WD and save it.
    • Define Component usage. POWL_UI_COMP,as shown in below figure.
    • Goto Views, Define POWL Component usage in properties tab of MAIN VIEW
    • Now, Define a view Container, Label and Text view inside the MAIN VIEW (POWL VIEW).
    • FOR CONTEXT NODE: Create node with single attribute EMP_NAME & bind it toTEXT_NAME
    • Now Go to Windows, in the properties tab of Windows, define the usage ofPOWL_UI_COMP component.
    • In WINDOWS, View container(VC_UI) embed the view Powl_Master of Powl_UI_Comp component as shown in fig.
    • Now click on Outbound Plug tab of window, give PLUG NAME & PARAMETER NAME.

    PARAMETER NAME                 TYPE

    APPLID                                    STRING

    FORALLQ                                 POWL_XFLAG_TY

    QNAME                                    POWL_QUERY_TY

    QSELPARA                              STRING

    REFRESHQ                              POWL_XFLAG_TY

    SRVGROUP                              POWL_XFLAG_TY

    • Click SAVE and go to WINDOW tab and create navigation link for OUT.
    • Define the mapping of Outbound plug of windows with Default plug of view Powl_Master as shown:
    • In the methods Tab of Windows , write the code in Handle Default Event handler to fire the outbound plug to Powl_Master View :
METHOD HANDLEDEFAULT .
DATA: LV_INBOX_QUERY TYPE STRING,
LT_QUERY_PARAMS TYPE RSPARAMS_TT,
LWA_PARAM TYPE RSPARAMS.
DATA LV_QNAME TYPE POWL_QUERY_TY. LV_QNAME = ‘YEMPLOYEE_QUERY1’.
CALL FUNCTION ‘POWL_ENCODE_SELPARA’
EXPORTING
I_SELPARA = LT_QUERY_PARAMS
I_ESCAPE = ‘\’
IMPORTING
E_SELPARA_STRING = LV_INBOX_QUERY. WD_THIS->FIRE_OUT_PLG(
APPLID = ‘YEMPLOYEE_APPLID’
QNAME = LV_QNAME
FORALLQ = ‘X’
QSELPARA = LV_INBOX_QUERY
REFRESHQ = ‘X’
* REFRESHA = ‘X’
SRVGROUP = ‘X’ ).
ENDMETHOD.

5. Test POWL.

Now create WD application and activate the whole program and run the application.

  • Initial Screen

Here, You can

    • Define New query (Define New query)
    • Change Query (Change Search condition)
    • Personalize (Set Layout , Remove query , Set default query etc)
  • AFTER DEFINING NEW QUERY

Best Regards,

WDA-Web Dynpro的POWL(个人对象工作清单)的更多相关文章

  1. WDA入门教程Ⅰ:Web Dynpro for ABAP 入门(转)

    转自:https://www.jianshu.com/p/68c1592f1a87 WDA全称Web Dynpro for ABAP,也写作WD4A或WDA,是用于在ABAP环境中开发Web应用程序的 ...

  2. SAP Web Dynpro - 个性化和配置

    根据业务需求,您可以实现许多标准应用程序,并且Web Dynpro应用程序的UI可以根据要求而有所不同. 应用配置 要配置Web Dynpro应用程序,首先要为单个Web Dynpro组件配置数据记录 ...

  3. SAP Web Dynpro - 应用程序中的服务调用

    您可以使用服务调用来调用Web Dynpro组件中的现有功能模块. 要创建服务呼叫,您可以使用Web Dynpro工具中易于使用的向导. 您可以在ABAP工作台中启动该向导以创建服务调用. 步骤1-选 ...

  4. 【ABAP系列】SAP Web Dynpro 技术简介

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP Web Dynpro 技 ...

  5. SAP Web Dynpro - 教程

    SAP Web Dynpro是一种标准的SAP UI技术,用于使用图形工具和与ABAP工作台集成的开发环境来开发Web应用程序. 图形工具的使用减少了实施工作,并有助于维护ABAP工作台中的组件. 本 ...

  6. ASP.NET Web API 2 之 HttpRequestMessage 对象

    Ø  前言 在 Web API 中经常会使用到 HttpRequestMessage 和 HttpResponseMessage 对象,这两个对象封装了对 Web API 的请求和响应,位于 Syst ...

  7. WEB服务器都在做哪些工作?

    作为WEB开发人员,我们肯定应该要知道WEB服务器都在做哪些工作,这里简单列举一下,有时间然后详细说明. (1)建立连接——接受一个客户端连接. (2)接收请求——从网络中读取一条 HTTP 请求报文 ...

  8. Powershell使用真实的对象工作

    Powershell使用真实的对象工作 来源 https://www.pstips.net/powershell-work-with-reallife-objects.html 每一个Powershe ...

  9. web dynpro配置注意事项

    如果你想使用web dynpro 开发的应用,但是发现浏览器报错,那么你按照下面的步骤逐一进行检查吧.特别是返回的500错误,或者是你发现浏览器的地址栏中以http://<hostname> ...

随机推荐

  1. JSON 语法

    ylbtech-JSON: JSON 语法 JSON 语法是 JavaScript 语法的子集. 1. JSON 语法规则返回顶部 JSON 语法是 JavaScript 对象表示语法的子集. 1. ...

  2. servlet简单的小例子

    去我云盘下载: https://pan.baidu.com/s/1E2yoZ2Nmk2FE2XjuPOCvjA 访问方式:http://localhost:8080/testServlet/index ...

  3. [UE4]GameMode、GameInstance、GameState、PlayerState、PlayerController

    一.只有PlayerController和Pawn/Character才有输入事件(键盘.鼠标等等),PlayerState没有输入事件. 二.对于需要跨域关卡的数据信息,根据上图所知需要放到Game ...

  4. VI使用手册(常见命令)

    VI使用手册 模式切换 i键开始进入编辑模式,Esc进入一般模式,保存退出:wq,不保存退出q,强制退出q! 如何定位到行文档首位,行首位? gg或者1G命令将光标移动到文档开头G命令将光标移动到文档 ...

  5. IDEA15使用maven编译scala和java

    机器安装maven,在IDEA中配置maven的home 创建项目:new-maven–> scala-archetype-simple project structure–>创建src. ...

  6. C语言中 有符号数、无符号数、整数溢出 (转)

    #include<stdio.h> void main() { int l=-1; unsigned int c=135; printf("%u\n",l+c); } ...

  7. 深入理解Apache Flink

    Apache Flink(下简称Flink)项目是大数据处理领域最近冉冉升起的一颗新星,其不同于其他大数据项目的诸多特性吸引了越来越多人的关注.本文将深入分析Flink的一些关键技术与特性,希望能够帮 ...

  8. C# 如何提取字符串中的数字(小技巧)

    下面讲解如何在字符串当中抓取到数字 方法一.使用正则表达式 1.纯数字提取 1 string str = "提取123abc提取"; //我们抓取当前字符当中的123 2 stri ...

  9. 安装部署elasticsearch

    ELK下载:https://www.elastic.co/downloads/ Beats:负责收集系统数据,可以直接发送到es中,也可以通过logstash中转 logstash:收集日志,为bea ...

  10. Java7 新特性: try-with-resources

    Try-with-resources是java7中一个新的异常处理机制,它能够很容易地关闭在try-catch语句块中使用的资源. 利用Try-Catch-Finally管理资源(旧的代码风格)在ja ...