0

ext jsのボタンのクリックイベントで新しいjspページをロードする必要があります。私はこのようにコードを置きます

    listeners: {
       'click': function(){
          alert("hai");
          window.open('<%=request.getContextPath()%>/jsp/dashboard/helpwindow.jsp','_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=700,height=600');
       }
   }

しかし、それは私に結果を与えません。'<%=request.getContextPath()%>' で問題が発生します。

今、URLで新しいウィンドウが開きます

http://localhost:8080/hiring/%3C%=request.getContextPath%28%29%%3E/jsp/dashboard/helpwindow.jsp

しかし、私はURLが必要です

http://localhost:8080/hiring/jsp/dashboard/helpwindow.jsp

これを解決するのを手伝ってください。

4

1 に答える 1

0
listeners: {

  'click': function() {                 
       var serverPath = window.location.href;
       var serverPathIndex = serverPath.lastIndexOf("/");
       window.open(serverPath.substring(0, serverPathIndex) + '/jsp/dashboard/helpwindow.jsp','_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=700,height=600');
   }
}
于 2012-07-10T03:35:37.400 に答える