session獲取不到值 jsp用a標(biāo)簽提交表單為什么在serlet中獲得的值為null?
jsp用a標(biāo)簽提交表單為什么在serlet中獲得的值為null?您的前臺form method=post,這是post提交方法; 而后臺servlet使用doget方法來接收數(shù)據(jù),而不是post。當(dāng)然
jsp用a標(biāo)簽提交表單為什么在serlet中獲得的值為null?
您的前臺form method=post,這是post提交方法; 而后臺servlet使用doget方法來接收數(shù)據(jù),而不是post。當(dāng)然,get方法不能處理post請求。R有兩種解決方案。建議您在后臺重寫dopost方法,將doget中的代碼復(fù)制到post方法,然后在doget中編寫一個(gè)句子以保留doget這個(gè).doPost(編寫參數(shù)本身)r簡單的方法是將前臺表單的提交方法從post更改為get。試試看