2 Replies Latest reply on Mar 14, 2007 3:19 AM by Louise Liddell

    Generating JNLP file in portlet

    Louise Liddell Newbie

      Hi everyone

      I am trying to generate a JNLP file for Java Web Start inside a portlet. In the doView method I have the following:

      rResponse.setContentType("application/x-java-jnlp-file");
      javax.portlet.PortletRequestDispatcher pRD = this.getPortletContext().getRequestDispatcher(JSP_PATH + "/my_jnlp.jsp");


      My jsp contains the following code:
      <%@ page contentType="application/x-java-jnlp-file" %>
      <%@ page session="false"%>
      
      <%
      //get some application variables here
      ...
      ...
      System.out.println("Executing the JSP");
      %>
      
      <jnlp spec="1.0+" codebase="<%=codebase %>">
      
       <information>
       <title>ABC</title>
       <vendor>XYZ</vendor>
       <description>Foo</description>
       </information>
      
       <resources>
       <j2se version="1.5+" />
       <jar href="ABC.jar" />
       </resources>
      
       <applet-desc documentBase="http://<%=web_host %>" name="RST" main-class="MyClass" width="527" height="428">
       <param name="a" value="<%=a_val %>"/>
       <param name="b" value="<%=b_val%>"/>
       </applet-desc>
      
      </jnlp>


      I have added the following to portlet.xml under the appropriate portlet:
      <supports>
       <mime-type>application/x-java-jnlp-file</mime-type>
       <portlet-mode>VIEW</portlet-mode>
      </supports>


      Also, in the web.xml file in jboss-portal-2.2.0-bundled\server\default\deploy\jbossweb-tomcat55.sar\conf, I have added:
      <mime-mapping>
       <extension>jnlp</extension>
       <mime-type>application/x-java-jnlp-file</mime-type>
       </mime-mapping>
       <mime-mapping>
       <extension>jar</extension>
       <mime-type>application/x-java-archive</mime-type>
       </mime-mapping>
       <mime-mapping>
       <extension>jardiff</extension>
       <mime-type>application/x-java-archive-diff</mime-type>
       </mime-mapping>
      


      The problem is that when I open the page that the portlet is on, nothing happens. The portlet does not even get rendered. Please, can anyone help?