Pass dynamic params via JNLP

后端 未结 2 1064
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 12:58

I am using JavaScript in order to execute JNLP which in the end will execute my client.

I am trying to pass parameters via JavaScript execution to the JNLP and havin

2条回答
  •  孤街浪徒
    2020-12-09 13:23

    To be able to insert the http-parameters into the argument of your application, the .jnlp file need to be 'constructed' dynamicly on request, because it is not until then you know which http-parameters that will be used.

    The way java-web-start works is that it will download the .jnlp several times, but the apart from the first time it will download the file from the url specified in the codebase and href attributes of the jnlp element.

    So it is not enough to add the argument-element dynamicly in the element, you also need to add it to the codebase/href attributes

     
          href="jnlpfile.jnlp?username=<%=request.getParameter("username")%>&clienttoken=<%=request.getParameter("clienttoken")%>">
    
        ...
        
           <%=request.getParameter("username")%>
        
    
    

提交回复
热议问题