2012-05-02 12 views
0

私は.jspを生きていて、アプレットでjavascriptを使用していますが、ポートレットに送信された後、ポートレットはログには追加のメッセージは表示されません。Liferayはポートレットのフォームをキャッチせず、処理しません

JSPページの抜粋:

<script type="text/javascript"> 
    function processSigning(){ 
     var applet = document.applets["SignApplet"]; 
     var path_to_certificate = document.getElementById("certificate").value; 
     var pass = document.getElementById("password").value; 
     var filePath = document.getElementById("documentSign").value; 
     applet.filePath = document.getElementById("documentSign").value; 
     applet.profileTestPKCS12(path_to_certificate, pass); 

     document.getElementById("file").value = applet.getDocumentString(filePath); 
     document.getElementById("sign").value = applet.getSignString(); 
     document.getElementById("cert").value = applet.getCertificateString(); 
     document.getElementById("mainForm").submit(); 


    } 
</script> 

<form id="mainForm" action="<portlet:actionURL> 
      <portlet:param name="COMMAND" value="LOAD"/> 
     </portlet:actionURL>"> 

    <hidden id="file" value="asdf"></hidden> 
    <hidden id="cert" value="asdf"></hidden> 
    <hidden id="sign" value="asdf"></hidden> 
    <input type="button" onClick="processSigning();" value="click here!" > 
</form> 

ポートレットはスニペット:ポートレット・クラスはMVCPortletまたはカスタムポートレットクラスを指している場合

public void processAction(ActionRequest request, ActionResponse response) throws PortletException { 
    session = request.getPortletSession(true); 
    String command = request.getParameter("COMMAND"); 
    System.out.println("command=" + command); 
    log.info("command=" + command); 


if ("LOAD".equals(command)) { 

{ 
System.out.println("file"); 
log.info("file"); 
String fileBase64 = request.getParameter("file"); 
System.out.println(request.getParameter("file")); 
log.info(request.getParameter("file")); 
} 
} 
} 

答えて

1

はあなたのportlet.xmlを確認してください。カスタム・ポートレット・クラスを指す必要があります。 Liferay Portalは「ポスト」方式で動作するので、

+0

portlet.xmlが作成したクラスを指しています – test1604

0

フォームの方法がありますが、IDS

1
、要求は名前で動作するため、隠しパラメータの名前は、「name」属性と一緒に使用する必要がありますまた、ではなく、指定する必要があります

このフォームを試してみてください。

<portlet:actionURL var="myActionURL"></portlet:actionURL> 

<form id="mainForm" action="${myActionURL}" method="post"> 
    <input type="hidden" name="COMMAND" id="COMMAND" value="LOAD" /> 
    <input type="hidden" name="file" id="file" value="asdf" /> 
    <input type="hidden" name="cert" id="cert" value="asdf" /> 
    <input type="hidden" name="sign" id="sign" value="asdf" /> 
    <input type="button" onClick="processSigning();" value="click here!" > 
</form> 

希望します。

関連する問題