亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

JavaWeb問題

JavaWeb問題

慕粉4349795 2017-05-23 11:37:06
一個簡單的JavaWeb程序,但是在瀏覽器中不能運行,提示Invalid location of tag (form),但是我找不到原因是什么????<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>? <head>? ? <base href="<%=basePath%>">? ??? ? <title>request獲取表單數據示例</title>? ?? <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> ? ? <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> -->? </head>??? <body>? ? <font size="2">? ? 下面是表單內容:? ? <form action="Form.jsp" ?method="post">? ? 用戶名:<input type="text" name="userName" size="10"/>? ? 密碼:<input type="password" name="password" size="10"/>? ? <input type="submit" value="提交">? ? </form>? ? 下面是表單提交以后用request取到的表單數據:<br>? ? <%? ? out.println("表單輸入userName的值:"+request.getParameter("userName")+"<br>");? ? out.println("表單輸入password的值:"+request.getParameter("password")+"<br>");? ? %>? ? </font>? </body></html>
查看完整描述

1 回答

已采納
?
呦呦米

TA貢獻90條經驗 獲得超59個贊

在jsp頁面使用標簽過程中有時候不注意規則的話,會提示一些錯誤。

Invalid location of tag (form),主要是因為<form>和<table>標簽使用混亂,form 應該寫到table外面去,并且form標簽里面也不能套form標簽??梢栽趂orm標簽里 把input都放到table中試試?

查看完整回答
2 反對 回復 2017-05-23
  • 1 回答
  • 0 關注
  • 1662 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號