创建JavaServer页面Web应用程序
我使用的是Ubuntu虚拟机。我需要根据web浏览器提交的数据创建一个HTML文件 以下是index.HTML的HTML:创建JavaServer页面Web应用程序,java,jsp,tomcat,Java,Jsp,Tomcat,我使用的是Ubuntu虚拟机。我需要根据web浏览器提交的数据创建一个HTML文件 以下是index.HTML的HTML: <html> <body> <h2>My First JSP Application</h2> <form method="post" action="welcome.jsp"> Please enter your name: <input type="text" name="name"/> <b
<html>
<body>
<h2>My First JSP Application</h2>
<form method="post" action="welcome.jsp">
Please enter your name: <input type="text" name="name"/>
<br/>
<input type="submit" value="OK"/>
</form>
</body>
</html>
我把这个文件放在用户>tomcat>webapps>welcomeJSP中,这是我创建的一个文件
我还将文件welcome.JSP放在这个welcomeJSP文件夹中
以下是welcome.JSP的代码:
<html>
<body>
<%
String name = request.getParameter("name");
%>
<h2>Welcome, <%=name%></h2>
</body>
</html>
然后我在虚拟机上的web浏览器中输入
但没有网页显示它无法连接
我的电脑是通过以太网连接的,所以它应该是连接的
有什么想法吗?首先,您应该创建一个web应用程序项目,本教程应该可以帮助您:
显然,我所需要做的就是进入终端并输入tomcat start。我真傻 你能浏览到Tomcat的主页吗?尝试在URL中键入项目名称。或者尝试在没有welcome.jsp的情况下键入它