java xampp 和 tomcat 和 jsp 哦,我的.. 我怎么知道它是否工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7136556/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 18:46:49  来源:igfitidea点击:

xampp and tomcat and jsp oh my.. how do i tell if its working

javajsptomcatxampp

提问by chris

Ok recently installed a wamp xammp to be specific.. I have a requirment to use jsp for some server side communications instead of other stuff like php. My main issue is not knowing jsp enough or java for that matter to know whether or not what I'm trying to do is working or if its not and if its not is it cause of the code I'm tempting to try which is a copy and paste solution via Google for "jsp hello world". Xampp reports tomcat as active and running but I copy and paste the jsp code I find to see if it works and when I go to it in my browser I just see the source as if I were looking at it in notepad, so anyone got some advice? This is a stock install if the latest xammp.. the server runs fine other wise php and mysql included.

好的,最近安装了一个 wamp xammp 来具体化.. 我需要使用 jsp 来进行一些服务器端通信,而不是像 php 这样的其他东西。我的主要问题是不知道足够多的 jsp 或 java 来知道我正在尝试做的是否有效,如果不是,如果不是,这是我很想尝试的代码的原因,这是一个通过 Google 复制和粘贴“jsp hello world”的解决方案。Xampp 报告 tomcat 处于活动状态并正在运行,但我复制并粘贴我找到的 jsp 代码以查看它是否有效,当我在浏览器中访问它时,我只看到源代码,就像我在记事本中查看它一样,所以任何人都得到了一些建议?如果是最新的 xammp,这是一个库存安装。服务器运行良好,其他明智的 php 和 mysql 包括在内。

回答by BalusC

Make sure that the file has the .jspextension and that it's been placed in a subfolder of /xampp/tomcat/webapps(and thus not there where you usually drop PHP files).

确保该文件具有.jsp扩展名,并且已放置在 的子文件夹中/xampp/tomcat/webapps(因此不在通常放置 PHP 文件的地方)。

See also:

也可以看看:

回答by jirka.pinkas

Install NetBeans IDE and follow this tutorial: http://netbeans.org/kb/docs/web/quickstart-webapps.html(before running application in this tutorial you must stop your XAMPP Tomcat).

安装 NetBeans IDE 并按照本教程进行操作:http: //netbeans.org/kb/docs/web/quickstart-webapps.html(在本教程中运行应用程序之前,您必须停止 XAMPP Tomcat)。

Or if you want to use your XAMPP Tomcat, integrate it with NetBeans, create a web project using that tutorial, create a WAR file (by clicking on button Clean and Build) - this will create a WAR file in your project directory in directory "dist" and then copy this WAR file to your XAMPP Tomcat into directory webapps.

或者,如果您想使用您的 XAMPP Tomcat,将其与 NetBeans 集成,使用该教程创建一个 Web 项目,创建一个 WAR 文件(通过单击“清理和构建”按钮) - 这将在您的项目目录中创建一个 WAR 文件目录“ dist”,然后将此 WAR 文件复制到您的 XAMPP Tomcat 目录中的 webapps.dist。

Start small, use NetBeans IDE, read some tutorials and experiment. Later you can switch to Eclipse IDE (IMHO buch better IDE, but requires much more customization than NetBeans).

从小处着手,使用 NetBeans IDE,阅读一些教程和实验。稍后您可以切换到 Eclipse IDE(恕我直言,这是更好的 IDE,但比 NetBeans 需要更多的自定义)。

Dont use Notepad.

不要使用记事本。