I am creating a jnlp
file but I need to receive some URL parameters.
I have a method that captures the URL from a jsp
file:
String getParameter (HttpServletRequest request, String param)
The problem is how to add parameters to the jnlp
file:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" codebase="https://localhost:8443/java-web-start/test/" href="start.jnlp">
<information>
<title>TestApp</title>
<vendor>Oracle</vendor>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<java version="1.5+"/>
<jar href="start.jar" main="true"/>
</resources>
<application-desc main-class="com.Main"/>
</jnlp>
Here's the index.jsp
file:
<%!
String getParameter(HttpServletRequest request, String param) {
String result = request.getParameter(param);
return result.replace("&", "&").replace("\"", """).replace("<", "<").replace(">", ">").replace("'","$#039;");
}
%>
<%=getParameter(request, "requestURL")%>
I want this in my jnlp
File and then Download and execute:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" codebase="https://localhost:8443/java-web-start/test/" href="start.jnlp">
<information>
<title>TestApp</title>
<vendor>Oracle</vendor>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<java version="1.5+"/>
<jar href="start.jar" main="true"/>
</resources>
<application-desc main-class="com.Main">
<argument><%= clientCount %></argument>
<argument><%=getParameter(request, "requestURL")%></argument>
</<application-desc>
</jnlp>