今天看到message hsm 的 hwdes-transaction-format-single.xml
翻到程式 = = (註: 看不懂 haha)
public static byte[] opcMacData( TransactionData txnData, FieldMap fieldMap ) {
logger.debug("execute opcMacData function....");
BasicData basic = txnData.getBasic();
OpcData body = (OpcData)txnData.getBody();
StringBuffer sb = new StringBuffer();
sb.append(basic.getStan());
String subMsgType = body.getFiscMessageType().substring(2);
sb.append(subMsgType); // message type
..................
這讓我想起當初去其富的考試..
我說時間真的很容易沖淡一切
我已經幾乎將原本會的一滴滴程式都給忘光了 haha
沒考過的考試, 部份應用在專題的如下:
package big5.controller;
import java.io.*;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import org.apache.struts.action.Action;
import big5.model.*;
import big5.view.*;
public class CreateCertAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
CreateCertForm mycertForm = (CreateCertForm) form;
CreateCertBean bean = new CreateCertBean();
bean.setAction(mycertForm.getAction());
bean.setCerttxt(mycertForm.getCerttxt());
String tttt = mycertForm.getCerttxt();
String zzzz = bean.getAction();
if(mycertForm.getAction().equals("createcert")){
String ooo = myFun(tttt)+".cert";
File ff = new File("C:\\Java\\IBMRAD\\cert\\WebContent\\zem", ooo);
PrintWriter pw = new PrintWriter(new FileWriter(ff));
pw.println(tttt);
//System.out.println("ajsdfhasfjklsdajflkajs;lasd = "+tttt);
pw.flush();
pw.close();
request.setAttribute("filename",ooo);
return mapping.findForward("backaddurl");
}
return mapping.findForward("");
}
public static String myFun(String aaa) {
StringBuffer buffer = new StringBuffer();
int len = aaa.length();
String bb = aaa.substring(len-10,len);
int length = bb.length();
for (int i = 1; i
buffer.append(bb.charAt(length - i));
}
return buffer.toString();
}
}
2006.10.16 11:04