在 Eclipse IDE 外部使用 JSP 文件

发布于 2024-10-16 02:15:25 字数 586 浏览 2 评论 0 原文

大家好,我是 Eclipse IDE、JSP/Java、HTML、Tomcat 的新手。

在获得 Eclipse 之前,我正在使用记事本制作 HTML 文件,并且我已经完成了网站的该部分的制作。我现在已经有了 Eclipse IDE,我一直用它来为一些动态 html 制作 JSP,现在我也完成了它们。

我现在遇到的问题是:

  • 我不知道如何从 IDE 中提取 JSP,因此我可以将其与 HTML 页面一起放在我的文件夹中

  • 这会给我带来另一个问题,我想将 JSP 放入

  • ,我只教了如何在IDE中建立Tomcat服务器,当我从IDE中提取JSP文件后,如何独立运行Tomcat?

非常感谢,我非常感谢您的时间和精力:)

Hey everyone, I'm new to using the Eclipse IDE, JSP/Java, HTML, Tomcat.

I was making HTML files, using notepad, prior to getting Eclipse, and I've finished with making that part of the website. I've gotten the Eclipse IDE now, which I've been using to make JSPs for some dynamic html, and I've completed them as well now.

The problems I'm having now are:

  • I don't know how to extract the JSPs from the IDE, so I can put it in my folder with the HTML pages

  • Which would bring me into another problem, I want to put the JSPs in an <iframe>, 2 of them make use of <jsp:forward> tags, I'm unsure if all of the forwarding and form submitting will remain within the iframe, because as far as I know <jsp:forward> doesn't have a target attribute, if this is going to be a problem, could anyone point me in the right direction for how to go about this?

  • Finally, I've only been taught how to the Tomcat server within the IDE, after I've extracted the JSP files from the IDE, how do I run Tomcat independently?

Thanks very much, I really appreciate your time and effort :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一个人练习一个人 2024-10-23 02:15:25

我不知道如何从 IDE 中提取 JSP,因此我可以将其与 HTML 页面一起放在我的文件夹中

在 Eclipse 或资源管理器中选择源文件,按 Ctrl+C,打开资源管理器中的目标文件夹,按 Ctrl+V。

这会给我带来另一个问题,我想将 JSP 放入

目前还不清楚你拥有什么以及你正在努力解决什么问题,但所有这些听起来都不太好。看起来你处理事情的方式很错误。我建议开始学习 servlet。我还建议开发不使用

最后,我只教了如何在IDE中使用Tomcat服务器,当我从IDE中提取JSP文件后,如何独立运行Tomcat?

假设你已经正确创建了一个动态 Web 项目,只需右键单击它,选择“导出”> WAR 文件。然后将获得的WAR文件放入Tomcat的/webapps文件夹中并启动它。

I don't know how to extract the JSPs from the IDE, so I can put it in my folder with the HTML pages

Select source file(s) in Eclipse or explorer, hit Ctrl+C, open target folder in explorer, hit Ctrl+V.

Which would bring me into another problem, I want to put the JSPs in an <iframe>, 2 of them make use of <jsp:forward> tags, I'm unsure if all of the forwarding and form submitting will remain within the iframe, because as far as I know <jsp:forward> doesn't have a target attribute, if this is going to be a problem, could anyone point me in the right direction for how to go about this?

It's unclear what you have and what you're struggling with, but all with all this doesn't smell good. It look much like that you're approaching things the wrong way. I'd suggest to start learning servlets. I'd also suggest to develop without <iframe> as long as all pages runs at the same webserver. If you need some kind of head/leftmenu/footer includes, then you should be using server-side includes. JSP offers you the <jsp:include> for this.

Finally, I've only been taught how to the Tomcat server within the IDE, after I've extracted the JSP files from the IDE, how do I run Tomcat independently?

Assuming that you've properly created a dynamic web project, just rightclick it, choose Export > WAR file. Then just drop the obtained WAR file in /webapps folder of Tomcat and start it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文