JNLP
개요
Java Network Launching Protocol (JNLP) 은 Java Web Start 기술과 관련된 파일 형식 입니다. 웹 브라우저 에서 Java 응용 프로그램을 배포 할 수 있다는 것 입니다.
응용 프로그램과 그 종속성을 설명하는 웹 사이트에 jnlp 파일을 놓은 다음 응용 프로그램을 직접 배포하기 위해이 파일을 가리키는 링크를 놓습니다. 이 작업을 수행하려면 Java가 클라이언트 컴퓨터에 설치되어 있어야합니다.
Exemple
<?xml version="1.0" encoding="utf-8"?> <!-- JNLP File for PSNext Application --> <jnlp spec="1.0+" codebase="url de base de l'application" href="fichier jnlp"> <information> <title>Nom de l'application</title> <vendor></vendor> <homepage href="http://www.homepage.com"/> <description>Description de l'application</description> <icon href="AppIcon.gif"/> </information> <security> <all-permissions/> </security> <resources> <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4.2+" max-heap-size="128m"/> <jar href="lib1.jar"/> <jar href="lib2.jar"/> <jar href="utilities.jar"/> </resources> <application-desc main-class="com.test.gui.Main"> <argument>-showSavePwd</argument> </application-desc> </jnlp>
HTML 실행
Exemple-1
var iframe = $("<iframe id=\"ifameApp\"/>").attr("src" , "jnlp://1.241.70.128/app/upload/serverApp.jnlp")
$(document).find("body").append(iframe);
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.5+" codebase="http://1.241.70.128/app/upload/" href="http://1.241.70.128/app/upload/serverApp.jnlp">
<information>
<title>File Upload Applet</title>
<vendor>KRRI.BIM</vendor>
<homepage href="http://1.241.70.128/app/upload/"/>
<icon href="images/h3_log.jpg" width="64" height="64"/>
<offline-allowed/>
<shortcut online="true">
<desktop/>
</shortcut>
</information>
<security><all-permissions/></security>
<resources os="Windows">
<j2se version="1.6+" java-vm-args="-Xincgc" initial-heap-size="512m" max-heap-size="512m"/>
</resources>
<resources os="Windows" arch="x86">
<jar href="applet.jar"/>
<jar href="javaws.jar"/>
<jar href="servlet-api-2.5.jar"/>
</resources>
<resources os="Windows" arch="x86_64 amd64">
<jar href="applet.jar"/>
<jar href="javaws.jar"/>
<jar href="servlet-api-2.5.jar"/>
</resources>
<application-desc name="WebStart" main-class="applet.IoApplication" width="625" height="595">
<argument>-session</argument>
<argument>player</argument>
<argument>-play</argument>
</application-desc>
<update check="always" policy="always"/>
</jnlp>
$("#jnlpform").attr("action" , "jnlp://1.241.70.128/sgp/idx/appRun.do");
$("#jnlpform").attr("method" , "post");
$("#jnlpform").submit();
@RequestMapping(value = "/sgp/idx/appRun.do")
public ModelAndView appRun(
@RequestParam(value="filePath", required=false)String filePath,
@RequestParam(value="arg1", required=false)String arg1,
@RequestParam(value="arg2", required=false)String arg2,
@RequestParam(value="arg3", required=false)String arg3,
@RequestParam(value="arg4", required=false)String arg4,
HttpServletRequest req, HttpServletResponse resp
) throws Exception {
ModelAndView model = new ModelAndView();
model.addObject("filePath",filePath);
model.setViewName("/applet/appRun");
return model;
}
<%@ page contentType="application/x-java-jnlp-file" %>
<%@ page import="java.io.*"%>
<%@ page import="javax.servlet.ServletOutputStream"%>
<%@ page trimDirectiveWhitespaces = "true"%>
<%
%>
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" codebase="http://1.241.70.128/app/cs">
<information>
<title>Viewer</title>
<vendor>KRRI</vendor>
</information>
<security><all-permissions/></security>
<resources os="Windows">
<j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="appRun.jar"/>
<jar href="javaws.jar"/>
<jar href="servlet-api-2.5.jar"/>
</resources>
<application-desc name="WebStart" main-class="appRun.appRun" width="625" height="595">
<%
if(!"".equals(request.getParameter("arg1"))){
%><argument><%=request.getParameter("arg1")%></argument><%
}
%>
<%
if(!"".equals(request.getParameter("arg2"))){
%><argument><%=request.getParameter("arg2")%></argument><%
}
%>
<%
if(!"".equals(request.getParameter("arg3"))){
%><argument><%=request.getParameter("arg3")%></argument><%
}
%>
<%
if(!"".equals(request.getParameter("arg4"))){
%><argument><%=request.getParameter("arg4")%></argument><%
}
%>
</application-desc>
</jnlp>
'IT > script' 카테고리의 다른 글
ES6 (0) | 2023.11.16 |
---|---|
HTML 외부 프로그램 실행 (0) | 2018.11.16 |
jstl (0) | 2016.10.05 |
jquery 함수 (0) | 2016.10.05 |
window property 커스텀 (0) | 2016.10.05 |