还有就是我的hello world程序无论是放到apache tomcat4.0/webapps/examples/jsp/下,还是apache tomcat4.0/webapps/root下都不能正常显示.在apache tomcat4.0/webapps/examples/jsp/下的时候当我打开http://localhost:8080/examples/jsp/HelloWorld.jsp后返回的是:Apache Tomcat/4.0.4 - HTTP Status 404 - /jsp/HelloWorld.jsp--------------------------------------------------------------------------------type Status reportmessage /jsp/HelloWorld.jspdescription The requested resource (/jsp/HelloWorld.jsp) is not available. 请问这是为什么?
out.println(fristname+lastname);才会写在页面上
<html>
<head>
<title>
你好!
</title>
<metahttp-equiv="Content-Type" content="text/html";charset="gb2312">
</head>
<body bgcolor="#FFFFFF">
<form method="post" action="/firstjsp.jsp">
<p>firstname:
</p>
<p>
<input type="text" name="firstname">
</p>
<p>lastname:
</p>
<input type="text" name="lastname">
</p>
<p>
<input type="submit" name="submit" value="提交">
</p>
</form>
</body>
</html>
这是firstjsp.jsp
<!--firstjsp.jsp--->
<%@page contentType="text/html";charset="gb2312"%>
<html><body>
欢迎
<%!String firetname,lastname,s;%>
<%
firstname=request.getParameter("fristname");
lastname=request.getParameter("lastname");
%>
<b><i><font size="7" face="Arial Black"><p>
<%
firstname=new String(firstname.getBytes("ISO-8859-1");
lastname=new String(lastname.getBytes("ISO-8859-1");
%>
<%= firstname%><%=lastname%>
</p></font></i></b>
光临!
</body>
</html>
<input type="text" name="firstname"> //
</p>----------
firstname=request.getParameter("fristname");在html中是firstname 到了后面怎么是fristname呢?
我是椰子,不会说谎的椰子。jsp不精,java不精,就是有点神经。:)
我是椰子,不会说谎的椰子。jsp不精,java不精,就是有点神经。:)
lastname=new String(lastname.getBytes("ISO-8859-1");
这样做也不会报错??奇怪??分明少了一个)!
那么你的form中的action应该是:action="firstjsp.jsp"!!
请问这是为什么?