jsp与eclipse对接

来自之前cnblog的博客
源地址:https://www.cnblogs.com/This-is-Y/p/13629909.html
先安装好tomcat,双击运行startup.bat启动后,浏览器输入127.0.0.1:8080出现了这只超丑的猫后即配置正常

然后关掉服务
打开eclipse,窗口->首选项

搜索runtime,找到runtime environment,点添加

找到自己安装好的版本,下一步

确定路径,选择jre,完成

最后保存退出
新建文件->Dynamic web Project

起名:testtttt

然后选择版本,路径,JRE

之后下一步,到这里点上Generate web.xml deployment descriptor

之后在左边可以看到testtttt,jsp文件写在WebContent下面

各个目录解释;
- deployment descriptor:部署的描述。
- build:放入编译之后的文件。
- WebContent:放进写入的页面。
创建一个testttt.jsp文件在WebContent下

写入代码
保存,
在窗口->Web Brower中选择浏览器

运行->运行方式 ->Run on Server

跳出来的不需要配置,下一步就好了
运行成功结果如下

要在浏览器访问这个页面
http://127.0.0.1:8080/testtttt/testttt.jsp
参考自菜鸟教程:https://www.runoob.com/jsp/eclipse-jsp.html
评论
评论插件加载失败
正在加载评论插件