无法在浏览器中使用 Tomcat 服务器 7 的 Eclipse 中运行简单的 JSP 程序
在 Eclipse 中编写了以下代码,并将该文件存储在以下位置:tomcat/webapps/jsp/sample.jsp。
我 jsp 文件夹。
我第一次在 google chrome 浏览器中给出了这个 url,下次在 Internet Explorer 中都显示了 404 错误及其描述:
请求的资源(/jsp/sample.jsp)不可用**。
我的代码是:
<%@ page language="java" import="java.io.*" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
hello
</body>
</html>
谢谢先生,这是步骤;
1. Tomcat 安装在 c:\Program files\Apache\tomcat 7.0\
我使用 Eclipse helio zip 文件并将其提取到 c:\eclipse...
然后我按照“http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html”中的步骤进行设置服务器在 然后我按照“http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html”中的步骤在eclipse
4.然后我从“文件->新建->其他->向导->web->jsp文件启动jsp文件。然后我在eclipse编辑器中打开jsp文件。
之后我启动 [tomcat7.0 server at localhost]
我保存文件并从 eclipse 工作区复制 jsp 文件并将其粘贴到webapps 文件夹。
这些是我遵循的步骤,
先生。
I have written the following code in Eclipse, and store this file in this location: tomcat/webapps/jsp/sample.jsp.
I have also included the Sub directories WEB-INF and classes and lib in this jsp folder.
And I have given this url in the google chrome browser first time and next time in Internet Explorer both shows the 404 error with description:
The requested resource(/jsp/sample.jsp) is not available**.
My code is:
<%@ page language="java" import="java.io.*" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
hello
</body>
</html>
Thank you sir, here are the steps;
1. Tomcat is installed in c:\Program files\Apache\tomcat 7.0\
I am using Eclipse helio zip file and extracted that in c:\eclipse...
Then I have followed the steps from "http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html" to set up server in eclipse.
4.Then I start the jsp file from "file->new->other->wizard->web->jsp file. Then I open the jsp file in the eclipse editor.
After that I start the [tomcat7.0 server at localhost]
I save the file and copy the jsp file from the eclipse workspace and paste it in the webapps folder.
these were the steps I have followed.
can you help me sir.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了我的问题。
这里我们要右键单击这个 eclipse ROOT 文件夹并粘贴它。
I have solved my problem.
here we want to right click in this eclipse ROOT folder and paste it.