我正在开发一个 JWS 应用程序作为小程序的替代品。到目前为止,我已经能够通过 HTML 页面中的链接从其父应用程序启动我的应用程序到静态 JNLP。但是我的应用程序确实需要由动态 JNLP 启动,因为每次执行的参数值都会不同。所以我决定以 [here][1] 所示的方式扩展 JnlpDownloadServlet。我的下载 servlet 被称为download
,它被映射到一个 URL 模式\download
,并在覆盖的方法中引用了一个名为 的 JSP myJnlp.jsp
,它当前包含一些静态 JNLP service
:
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
HttpServletRequest request = (HttpServletRequest) req;
resp.setContentType("application/x-java-jnlp-file");
request.getRequestDispatcher("/myJnlp.jsp").include(request, resp);
}
当我尝试调用我的下载 servlet 时,我收到以下错误:
javax.servlet.ServletException: File "/myJnlp.jsp" not found
org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:384)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
com.myCompany.parentApp.myDownloadServlet.service
我放置myJnlp.jsp
在目录jsp
中,该目录包含父应用程序使用的其他 JSP。我是否将 JNLP 页面放在了错误的位置,或者我是否在我的 servlet 代码中错误地指定了它?