::Hansen
::2012-02-22
::Set ClassPath
@echo off
for %%i in ("lib/*.jar") do call :appendPath %%i
goto pathOK
:appendPath
set CLASSPATH=%CLASSPATH%;lib/%1
goto :eof
:pathOk
@echo on
Applet自签名
1、修改Applet主Jar包的Manifest文件,添加下面几行,然后重新打包
Application-Name: AppletTest Implementation-version: 1.0 Application-Library-Allowable-Codebase: * Permissions: sandbox Caller-Allowable-Codebase: * localhost 127.0.0.1
2、生成keystore及key
#生成私钥 keytool -validity 10000 -genkey -alias xxxxxx -keypass xxxxxx -storepass xxxxxx -keystore xxxxxx.jks -dname "CN=(R&D),O=(ATS),C=(CN)" -keyalg RSA
导出证书
#证书DER格式 keytool -exportcert -alias xxxxxx -keypass xxxxxx -keystore xxxxxx.jks -storepass xxxxxx -file xxxxxx.der #证书PEM格式 keytool -exportcert -alias xxxxxx -keypass xxxxxx -keystore xxxxxx.jks -storepass xxxxxx -rfc -file xxxxxx.pem
枚举证书
keytool -list -keystore xxxxxx.jks
3、签名
jarsigner -keystore xxxxxx.jks -storepass xxxxxx -keypass xxxxxx xxxxxx.jar xxxxxx
4、验证
JARsigner -verbose -verify xxxxxx.jar
5、信任签名证书,下面两种方式用一种就好了
5.1、导入CA证书(按用OS登录户全局,自签名Jar)
#下面的方式,与java控制面板导入证书效果相同 #win7 keytool -import -trustcacerts -keystore "%userprofile%\AppData\LocalLow\Sun\Java\Deployment\security\trusted.certs" -alias "" -file XXXXXX.cer -storepass "" -noprompt #winxp keytool -import -trustcacerts -keystore "%APPDATA%\Sun\Java\Deployment\security\trusted.certs" -alias "" -file XXXXXX.cer -storepass "" -noprompt
5.2、导入CA证书(按JDR/JRE全局,自签名Jar)
keytool -import -trustcacerts -file XXXXXX.der -alias NMyCA1024 -keystore %JRE_HOME%\lib\security\cacerts -storepass changeit
6、如果自签名证书还是不行的话
到java控制面板,安全中,把你的网站添加到信任列表就好了。
Hibernate主键
increment
It generates identifiers of type long, short or int that are unique only when no other process is inserting data into the same table. It should not the used in the clustered environment.
identity
It supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type long, short or int.
sequence
The sequence generator uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase. The returned identifier is of type long, short or int
hilo
The hilo generator uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with connections enlisted with JTA or with a user-supplied connection.
seqhilo
The seqhilo generator uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a named database sequence.
uuid
The uuid generator uses a 128-bit UUID algorithm to generate identifiers of type string, unique within a network (the IP address is used). The UUID is encoded as a string of hexadecimal digits of length 32.
guid
It uses a database-generated GUID string on MS SQL Server and MySQL.
native
It picks identity, sequence or hilo depending upon the capabilities of the underlying database.
assigned
lets the application to assign an identifier to the object before save() is called. This is the default strategy if no
select
retrieves a primary key assigned by a database trigger by selecting the row by some unique key and retrieving the primary key value.
foreign
uses the identifier of another associated object. Usually used in conjunction with a
Jar包签名
1、生成keystore及key
#生成私钥 keytool -validity 10000 -genkey -alias xxxxxx -keypass xxxxxx -storepass xxxxxx -keystore xxxxxx.jks -dname "CN=(R&D),O=(ATS),C=(CN)" -keyalg RSA
导出证书
#证书DER格式 keytool -exportcert -alias xxxxxx -keypass xxxxxx -keystore xxxxxx.jks -storepass xxxxxx -file xxxxxx.der #证书PEM格式 keytool -exportcert -alias xxxxxx -keypass xxxxxx -keystore xxxxxx.jks -storepass xxxxxx -rfc -file xxxxxx.pem
枚举证书
keytool -list -keystore xxxxxx.jks
2、签名
jarsigner -keystore xxxxxx.jks -storepass xxxxxx -keypass xxxxxx xxxxxx.jar xxxxxx
3、验证
JARsigner -verbose -verify xxxxxx.jar
C#调用cdll指针参数处理
1、API声明(包括**参数)
int GetTheLastErrorA(char **pcError); int GetTheLastErrorW(wchar_t **pwError);
2、C#代码
using System.Runtime.InteropServices;
[DllImport("StringAW.dll", CallingConvention = CallingConvention.Winapi,
CharSet = CharSet.Ansi, EntryPoint = "GetTheLastErrorA")]
extern static int GetTheLastErrorA(ref IntPtr a);
[DllImport("StringAW.dll", CallingConvention = CallingConvention.Winapi,
CharSet = CharSet.Auto, EntryPoint = "GetTheLastErrorW")]
extern static int GetTheLastErrorW(ref IntPtr w);
IntPtr a = IntPtr.Zero;
GetTheLastErrorA(ref a);
String sa = Marshal.PtrToStringAnsi(a);
MessageBox.Show(sa);
IntPtr w = IntPtr.Zero;
GetTheLastErrorW(ref w);
String sw = Marshal.PtrToStringUni(w);
MessageBox.Show(sw);
HL7 V2消息类型
| ACK | Acknowledgment | 消息回复 |
| ADR^A19 | Patient Query – Response | |
| ADT^A04 | Register a patient | 病人注册 |
| ADT^A08 | Update patient information | 病人信息更新 |
| ADT^A05 | Pre-admit a patient | |
| ADT^A06 | Change an outpatient to an inpatient | 门诊转住院 |
| ADT^A07 | Change an inpatient to an outpatient | 住院转门诊 |
| ADT^A01 | Admit/visit notification | 查房开始 |
| ADT^A03 | Discharge/end visit | 查房结束 |
| ADT^A02 | Transfer a patient | 病人转院 |
| ADT^A28 | Add person information | |
| ADT^A13 | Cancel discharge/end visit | |
| ADT^A14 | Pending admit | |
| ADT^A31 | Update person information | |
| ADT^A11 | Cancel admit/visit notification | |
| ADT^A10 | Patient arriving – tracking | 病人到达 |
| ADT^A09 | Patient departing – tracking | 病人出发 |
| ADT^A12 | Cancel transfer | 取消转院 |
| ADT^A15 | Pending transfer | |
| ADT^A16 | Pending discharge | |
| ADT^A17 | Swap patients | |
| ADT^A18 | Merge patient information (for backward compatibility only) | 合并病人信息(低版本兼容) |
| ADT^A20 | Bed status update | |
| ADT^A32 | Cancel patient arriving – tracking | 取消病人到达 |
| ADT^A33 | Cancel patient departing – tracking | 取消病人出发 |
| ADT^A27 | Cancel pending admit | |
| ADT^A25 | Cancel pending discharge | |
| ADT^A26 | Cancel pending transfer | |
| ADT^A23 | Delete a patient record | 删除病人记录 |
| ADT^A29 | Delete person information | 删除病人信息 |
| ADT^A21 | Patient goes on a “leave of absence” | |
| ADT^A22 | Patient returns from a “leave of absence” | |
| ADT^A24 | Link patient information | 管理病人信息 |
| ADT^A35 | Merge patient information – account number only (for backward compati | |
| ADT^A36 | Merge patient information – patient ID and account number (for backwa | |
| ADT^A34 | Merge patient information – patient ID only (for backward compatibili | |
| ADT^A30 | Merge person information (for backward compatibility only) | |
| ADT^A48 | Change alternate patient ID (for backward compatibility only) | |
| ADT^A49 | Change patient account number | |
| ADT^A46 | Change patient ID (for backward compatibility only) | |
| ADT^A47 | Change patient identifier list | |
| ADT^A37 | Unlink patient information | |
| ADT^A38 | Cancel pre-admit | |
| ADT^A41 | Merge account – patient account number | |
| ADT^A40 | Merge patient – patient identifier list | |
| ADT^A39 | Merge person – patient ID (for backward compatibility only) | |
| ADT^A42 | Merge visit – visit number | |
| ADT^A44 | Move account information – patient account number | |
| ADT^A43 | Move patient information – patient identifier list | |
| ADT^A45 | Move visit information – visit number | |
| ADT^A51 | Change alternate visit ID | |
| ADT^A50 | Change visit number | |
| ADT^A52 | Cancel leave of absence for a patient | |
| ADT^A53 | Cancel patient returns from a leave of absence | |
| ADT^A55 | Cancel change attending doctor | |
| ADT^A54 | Change attending doctor | |
| ADT^A60 | Update allergy information | |
| ADT^A62 | Cancel change consulting doctor | |
| ADT^A61 | Change consulting doctor | |
| BAR^P01 | Add patient accounts | |
| BAR^P02 | Purge patient accounts | |
| BAR^P05 | Update account | |
| BAR^P06 | End account | |
| BAR^P10 | Transmit Ambulatory Payment Classification(APC) | |
| BAR^P12 | Update Diagnosis/Procedure | |
| BPS^O29 | Blood product dispense status | |
| BRP^O30 | Blood product dispense status acknowledgment | |
| BRT^O32 | Blood product transfusion/disposition acknowledgment | |
| BTS^O31 | Blood product transfusion/disposition | |
| CRM^C02 | Cancel a patient registration on clinical trial (for clerical mistakes onl | |
| CRM^C06 | Cancel patient entering a phase (clerical mistake) | |
| CRM^C07 | Correct/update phase information | |
| CRM^C03 | Correct/update registration information | |
| CRM^C05 | Patient enters phase of clinical trial | |
| CRM^C04 | Patient has gone off a clinical trial | |
| CRM^C08 | Patient has gone off phase of clinical trial | |
| CRM^C01 | Register a patient on a clinical trial | |
| CSU^C09 | Automated time intervals for reporting, like monthly | |
| CSU^C11 | Patient completes a phase of the clinical trial | |
| CSU^C10 | Patient completes the clinical trial | |
| CSU^C12 | Update/correction of patient order/result information | |
| DFT^P03 | Post detail financial transaction | |
| DOC^T12 | Document Query – Response | |
| DFT^P11 | Post Detail Financial Transactions – New | |
| EAC^U07 | Automated equipment command | |
| EAN^U09 | Automated equipment notification | |
| EAR^U08 | Automated equipment response | |
| EHC^E01 | Submit HealthCare Services Invoice | |
| ESR^U02 | Automated equipment status request | |
| ESU^U01 | Automated equipment status update | |
| INR^U06 | Automated equipment inventory request | |
| INU^U05 | Automated equipment inventory update | |
| LSR^U13 | Automated equipment log/service request | |
| LSU^U12 | Automated equipment log/service update | |
| MDM^T05 | Document addendum notification | |
| MDM^T11 | Document cancel notification | |
| MDM^T07 | Document edit notification | |
| MDM^T09 | Document replacement notification | |
| MDM^T03 | Document status change notification | |
| MDM^T01 | Original document notification | |
| MDM^T06 | Document addendum notification and content | |
| MDM^T08 | Document edit notification and content | |
| MDM^T10 | Document replacement notification and content | |
| MDM^T04 | Document status change notification and content | |
| MDM^T02 | Original document notification and content | |
| MFK^M01 | Master File – Not Otherwise Specified (for Backward Compatibility Only) – Response | |
| MFN^M01 | Master file not otherwise specified (for backward compatibility only) | |
| MFN^M02 | Master file – staff practitioner | |
| MFN^M03 | Master file – test/observation (for backward compatibility only) | |
| MFN^M04 | Master files charge description | |
| MFN^M05 | Patient location master file | |
| MFN^M06 | Clinical study with phases and schedules master file | |
| MFN^M07 | Clinical study without phases but with schedules master file | |
| MFN^M08 | Test/observation (numeric) master file | |
| MFN^M09 | Test/observation (categorical) master file | |
| MFN^M10 | Test /observation batteries master file | |
| MFN^M11 | Test/calculated observations master file | |
| MFN^M12 | Master file notification message | |
| MFN^M13 | Master file notification – general | |
| MFN^M15 | Inventory item master file notification | |
| MFN^M14 | Master file notification – site defined | |
| MFN^Znn | ||
| MFR^M01 | ||
| NMD^N02 | Application management data message (unsolicited) | |
| NMQ^N01 | Application management query message | |
| NMR^N01 | Application Management Query Message – Response | |
| OMB^O27 | Blood product order | |
| OMD^O03 | Diet order | |
| OMG^O19 | General clinical order | |
| OMI^O23 | Imaging order | |
| OML^O21 | Laboratory order | |
| OML^O33 | Laboratory order for multiple orders related to a single specimen | |
| OML^O35 | Laboratory order for multiple orders related to a single container of a sp | |
| OMN^O07 | Non-stock requisition order | |
| OMP^O09 | Pharmacy/treatment order | |
| OMS^O05 | Stock requisition order | |
| ORB^O28 | Blood product order acknowledgment | |
| ORD^O04 | Diet order acknowledgment | |
| ORF^R04 | Response to query; transmission of requested observation | |
| ORG^O20 | General clinical order response | |
| ORI^O24 | Imaging order response message to any OMI | |
| ORL^O22 | General laboratory order response message to any OML | |
| ORL^O34 | Laboratory order response message to a multiple order related to single sp | |
| ORL^O36 | Laboratory order response message to a single container of a specimen OML | |
| ORM^O01 | Order message (also RDE, RDS, RGV, RAS) | |
| ORN^O08 | Non-stock requisition acknowledgment | |
| ORP^O10 | Pharmacy/treatment order acknowledgment | |
| ORR^O02 | Order response (also RRE, RRD, RRG, RRA) | |
| ORS^O06 | Stock requisition acknowledgment | |
| ORU^R01 | Unsolicited transmission of an observation message | |
| ORU^R31 | Unsolicited New Point-Of-Care Observation Message – Search For An Order | |
| ORU^R30 | Unsolicited Point-Of-Care Observation Message Without Existing Order – Pla | |
| ORU^R32 | Unsolicited Pre-Ordered Point-Of-Care Observation | |
| OSQ^Q06 | Query for order status | |
| OSR^Q06 | Query For Order Status – Response | |
| OUL^R21 | Unsolicited laboratory observation | |
| OUL^R22 | Unsolicited Specimen Oriented Observation Message | |
| OUL^R23 | Unsolicited Specimen Container Oriented Observation Message | |
| OUL^R24 | Unsolicited Order Oriented Observation Message | |
| PEX^P07 | Unsolicited initial individual product experience report | |
| PEX^P08 | Unsolicited update individual product experience report | |
| PGL^PC6 | PC/ goal add | |
| PGL^PC8 | PC/ goal delete | |
| PGL^PC7 | PC/ goal update | |
| PMU^B01 | Add personnel record | |
| PMU^B02 | Update personnel record | |
| PMU^B03 | Delete personnel re cord | |
| PMU^B04 | Active practicing person | |
| PMU^B05 | Deactivate practicing person | |
| PMU^B06 | Terminate practicing person | |
| PMU^B07 | Grant Certificate/Permission | |
| PMU^B08 | Revoke Certificate/Permission | |
| PPG^PCG | PC/ pathway (goal-oriented) add | |
| PPG^PCJ | PC/ pathway (goal-oriented) delete | |
| PPG^PCH | PC/ pathway (goal-oriented) update | |
| PPP^PCB | PC/ pathway (problem-oriented) add | |
| PPP^PCD | PC/ pathway (problem-oriented) delete | |
| PPP^PCC | PC/ pathway (problem-oriented) update | |
| PPR^PC1 | PC/ problem add | |
| PPR^PC3 | PC/ problem delete | |
| PPR^PC2 | PC/ problem update | |
| PPT^PCL | PC/ pathway (goal-oriented) query response | |
| PPV^PCA | PC/ goal response | |
| PRR^PC5 | PC/ problem response | |
| PTR^PCF | PC/ pathway (problem-oriented) query response | |
| QBP^Z81 | Dispense History | |
| QBP^Z87 | Dispense Information | |
| QBP^Z89 | Lab Results History | |
| QBP^Z85 | Pharmacy Information Comprehensive | |
| QBP^Q11 | Query by parameter requesting an RSP segment pattern response | |
| QBP^Q31 | QBP Query Dispense history | |
| QBP^Q13 | Query by parameter requesting an RTB – tabular response | |
| QBP^Z93 | Tabular Dispense History | |
| QBP^Z95 | Tabular Dispense History | |
| QBP^Z75 | Tabular Patient List | |
| QBP^Z77 | Tabular Patient List | |
| QBP^Z91 | Who Am I | |
| QBP^Z99 | Who Am I | |
| QBP^Z97 | Dispense History | |
| QBP^Z79 | Dispense Information | |
| QBP^Q15 | Query by parameter requesting an RDY display response | |
| QBP^Q24 | Allocate identifiers | |
| QBP^Q22 | Find candidates | |
| QBP^Q23 | Get corresponding identifiers | |
| QBP^Q21 | Get person demographics | |
| QBP^Q25 | Personnel Information by Segment Query | |
| QBP^Z73 | Information about Phone Calls | |
| QCN^J01 | Cancel query/acknowledge message | |
| QSX^J02 | Cancel subscription/acknowledge message | |
| QRY^A19 | Patient query | |
| QRY^PC9 | PC/ goal query | |
| QRY^PCK | PC/ pathway (goal-oriented) query | |
| QRY^PCE | PC/ pathway (problem-oriented) query | |
| QRY^PC4 | PC/ problem query | |
| QRY^Q27 | Pharmacy/treatment administration information | |
| QRY^Q28 | Pharmacy/treatment dispense information | |
| QRY^Q29 | Pharmacy/treatment encoded order information | |
| QRY^Q30 | Pharmacy/treatment dose information | |
| QRY^Q26 | Pharmacy/treatment order response | |
| QRY^R02 | Query for results of observation | |
| QRY^T12 | Document query | |
| QSB^Z83 | ORU Subscription | |
| QSB^Q16 | Create subscription | |
| QVR^Q17 | Query for previous events | |
| RAR^RAR | Pharmacy/Treatment Administration Information | |
| RAS^O17 | Pharmacy/treatment administration | |
| RCL^I06 | Request/Receipt Of Clinical Data Listing – Response | |
| RDE^O11 | Pharmacy/treatment encoded order | |
| RDE^O25 | Pharmacy/treatment refill authorization request | |
| RDR^RDR | Pharmacy/Treatment Dispense Information – Response | |
| RDS^O13 | Pharmacy/treatment dispense | |
| RDY^Z98 | Dispense History (Response) | |
| RDY^K15 | Display response in response to QBP^Q15 | |
| REF^I12 | Patient referral | |
| RER^RER | Pharmacy/Treatment Encoded Order Information | |
| RGR^RGR | Pharmacy/Treatment Dose Information | |
| RGV^O15 | Pharmacy/treatment give | |
| ROR^ROR | Pharmacy prescription order query response | |
| RPA^I08 | Request For Treatment Authorization Information – Response | |
| RPI^I01 | Request For Insurance Information – Response | |
| RPI^I04 | Request For Patient Demographic Data – Response | |
| RPL^I02 | Request/Receipt Of Patient Selection Display List – Response | |
| RPR^I03 | Request/Receipt Of Patient Selection List – Response | |
| RRI^I12 | Patient Referral – Response | |
| RQA^I11 | Request for cancellation of an authorization | |
| RQA^I09 | Request for modification to an authorization | |
| RQA^I10 | Request for resubmission of an authorization | |
| RQA^I08 | Request for treatment authorization information | |
| RQC^I05 | Request for patient clinical information | |
| RQC^I06 | Request/receipt of clinical data listing | |
| PIN^I07 | Unsolicited insurance information | |
| RQI^I01 | Request for insurance information | |
| RQI^I02 | Request/receipt of patient selection display list | |
| RQI^I03 | Request/receipt of patient selection list | |
| RQP^I04 | Request for patient demographic data | |
| RRA^O18 | Pharmacy/treatment administration acknowledgment | |
| RRD^O14 | Pharmacy/treatment dispense acknowledgment | |
| RRE^O12 | Pharmacy/treatment encoded order acknowledgment | |
| RRE^O26 | Pharmacy/Treatment Refill Authorization Acknowledgement | |
| RRG^O16 | Pharmacy/treatment give acknowledgment | |
| RDY^Z80 | Dispense Information (Response) | |
| RSP^K11 | Segment pattern response in response to QBP^Q11 | |
| RSP^Z84 | Who Am I (Response) | |
| RSP^K22 | Find candidates response | |
| RSP^K21 | Get person demographics response | |
| RSP^K24 | Allocate identifiers response | |
| RSP^K23 | Get corresponding identifiers response | |
| RSP^K25 | Personnel Information by Segment Response | |
| RSP^K31 | Dispense History Response | |
| RSP^Z82 | Dispense History (Response) | |
| RSP^Z86 | Pharmacy Information Comprehensive (Response) | |
| RSP^Z88 | Dispense Information (Response) | |
| RSP^Z90 | Lab Results History (Response) | |
| RTB^K13 | Tabular response in response to QBP^Q13 | |
| RTB^Z94 | Tabular Dispense History (Response) | |
| RTB^Z96 | Tabular Dispense History (Response) | |
| RTB^Z76 | Tabular Patient List (Response) | |
| RTB^Z78 | Tabular Patient List (Response) | |
| RTB^Z92 | Who Am I (Response) | |
| RTB^Z74 | Information about Phone Calls (Response) | |
| SIU^S18 | Notification of addition of service/resource on appointment | |
| SIU^S15 | Notification of appointment cancellation | |
| SIU^S17 | Notification of appointment deletion | |
| SIU^S16 | Notification of appointment discontinuation | |
| SIU^S14 | Notification of appointment modification | |
| SIU^S13 | Notification of appointment rescheduling | |
| SIU^S23 | Notification of blocked schedule time slot(s) | |
| SIU^S20 | Notification of cancellation of service/resource on appointment | |
| SIU^S22 | Notification of deletion of service/resource on appointment | |
| SIU^S21 | Notification of discontinuation of service/resource on appointment | |
| SIU^S19 | Notification of modification of service/resource on appointment | |
| SIU^S12 | Notification of new appointment booking | |
| SIU^S24 | Notification of opened (“unblocked”) schedule time slot(s) | |
| SIU^S26 | SIU/ACK Notification that patient did not show up for schedule appointment | |
| SQR^S25 | Schedule Query Message And Responsem | |
| SQM^S25 | Schedule query message and response | |
| SRM^S07 | Request addition of service/resource on appointment | |
| SRM^S04 | Request appointment cancellation | |
| SRM^S06 | Request appointment deletion | |
| SRM^S05 | Request appointment discontinuation | |
| SRM^S03 | Request appointment modification | |
| SRM^S02 | Request appointment rescheduling | |
| SRM^S09 | Request cancellation of service/resource on appointment | |
| SRM^S11 | Request deletion of service/resource on appointment | |
| SRM^S10 | Request discontinuation of service/resource on appointment | |
| SRM^S08 | Request modification of service/resource on appointment | |
| SRM^S01 | Request new appointment booking | |
| SRR^S01 | Request New Appointment Booking – Response | |
| SSR^U04 | specimen status request | |
| SSU^U03 | Specimen status update | |
| SUR^P09 | Summary product experience report | |
| TCR^U11 | Automated equipment test code settings request | |
| TCU^U10 | Automated equipment test code settings update | |
| VXQ^V01 | Query for vaccination record | |
| VXR^V03 | Vaccination record response | |
| VXU^V04 | Unsolicited vaccination record update | |
| VXX^V02 | Response to vaccination query returning multiple PID matches |
Table删除所有行
1.用jquery的话,还是很简单的
$("#tbid").empty();
2.但如果要保留前几行,比如前两行的话
function ClearTableData(tbid){
var rows = document.getElementById(tbid).getElementsByTagName('tr');
if(rows==null || rows.length<3)return;
for(var i=2;i<rows.length;i++)
{
rows[i].parentNode.removeChild(rows[i]);
}
}
点击Table一行变色
function ExpendInstance(tbid,srow){
var ctrl = document.getElementById(tbid);
if(ctrl==null)return;
try
{
for(var i = 0; i < ctrl.rows.length;i++){
ctrl.rows[i].bgColor = "#ffffff";
}
srow.bgColor = "#f7fac5";
}
catch(ex)
{
alert(ex);
}
DoSomething();
}
JQuery动态加载Table
用于在同一Table显示两级内容
点击一次,会用ajax从服务器加载json数据,并添加到该行下面
再点击一次,会利用name属性,删除对应的行
function ExpendPatient(srow,pid){
var imgc = "#p"+pid+"imgc";
var imgo = "#p"+pid+"imgo";
if($(imgo).is(":visible"))
{
$(imgo).hide();
$(imgc).show();
delrows = document.getElementsByName("p"+pid+"study");
for (var i=0;i<delrows.length;i++)
{
delrows[i].parentNode.removeChild(delrows[i]);
}
return;
}
$(imgc).hide();
$(imgo).show();
aurl="xxxxxxxxxxxx?patPk="+pid;
try
{
$.ajax({
url: aurl,
dataType: 'json',
error: function(XMLHttpRequest, textStatus, errorThrown){
alert('错误原因 ' + textStatus);
alert('错误堆栈 ' + errorThrown);
alert('返回字符 ' + XMLHttpRequest.responseText);
},
success: function(data) {
$.each(data,function(i,record){
r = '<tr height="30" name="p'+pid+'study" onclick="DoSomeThing(this,'+record["pk"]+');"]';
r += '<td></td>';
r += '<td>'+record["a"]+'</td>';
r += '<td>'+record["b"]+'</td>';
r += '<td>'+record["c"]+'</td>';
r += '<td>'+record["d"]+'</td>';
r += '<td>'+record["e"]+'</td>';
r += '<td>'+record["f"]+'</td>';
r += "</tr>";
$(srow).after(r);
});
}
});
}
catch(e)
{
alert(e);
}
}
在Servlet中使用Spring
要添加org.springframework.web-3.x.x.RELEASE.jar
ServletContext application;
WebApplicationContext wac;
application = getServletContext();
wac = WebApplicationContextUtils.getWebApplicationContext(application);
wac.getBean("...");