简体   繁体   English

将jsp文件添加到耳朵

[英]Add jsp file to ear

I wanted to add a .jsp file to an ear that is deployed at a client site. 我想将.jsp文件添加到部署在客户端站点的耳朵中。 What would be the process for doing this? 这样做的过程是什么? Keep in mind I'm very new to the java world. 请记住,我是Java世界的新手。 It's going to be a simple keepalive page that doesn't have to interact with other pages. 这将是一个简单的keepalive页面,无需与其他页面进行交互。 It would be ideal to not have to recreate/redeploy the entire ear because there is stress involved in getting it back to the secured client site. 理想的情况是不必重新创建/重新部署整个耳朵,因为在将其返回到受保护的客户端站点时会遇到压力。 We'd rather give the client instructions to add the page we send them into the ear they have. 我们希望为客户提供说明,以将我们发送给他们的页面添加到他们拥有的耳朵中。 They can then redeploy it. 然后,他们可以重新部署它。

Thanks. 谢谢。 If I missed any information let me know. 如果我错过任何信息,请告诉我。

JSPs have to sit inside a WAR, which in turn sits inside the EAR. JSP必须位于WAR内部,而WAR又位于EAR内部。 If you already have a WAR inside the EAR, then put it in that, or add another WAR with just the JSP inside. 如果您在EAR中已经有一个WAR,则将其放在其中,或者在其中仅包含JSP的情况下添加另一个WAR。 It can't sit directly in the EAR itself. 它不能直接放在EAR本身中。

If rapid redeployment is what you need, then an EAR really isn't the best approach... 如果您需要快速重新部署,那么EAR确实不是最好的方法。

A JSP page is the source file that is compiled to a Java object by your application server. JSP页面是由您的应用程序服务器编译为Java对象的源文件。 While deploying via an EAR or WAR is the traditional way, some servers, like Tomcat, can also deploy from an expanded EAR or WAR file. 尽管通过EAR或WAR进行部署是传统方式,但是某些服务器(例如Tomcat)也可以从扩展的EAR或WAR文件进行部署。 This is because EAR and WAR files actually just ZIP files, with a specific folder structure and information files in them. 这是因为EAR和WAR文件实际上只是ZIP文件,其中包含特定的文件夹结构和信息文件。

You could always just try to send them the JSP page and simply have them copy and paste it into the deployment folder, overwriting the old file. 您总是可以尝试向他们发送JSP页面,只需让他们将其复制并粘贴到部署文件夹中,以覆盖旧文件。 Your application container should recognise that the source is newer than the compiled JSP page and recompile it for you on the fly when you refresh that page. 您的应用程序容器识别出源代码比已编译的JSP页面要新,并在刷新该页面时为您即时重新编译它。

This works quite well in Tomcat - we often simply paste JSP files during development into the deployed application folder to test small changes. 这在Tomcat中非常有效-我们经常在开发过程中简单地将JSP文件粘贴到已部署的应用程序文件夹中以测试小的更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM