0
我有一個網頁,有幾個文本框和一個提交按鈕。提交時,目標網址與SSL的網址格式匹配。目標頁面以HTTPS打開,但文本框值丟失。tomcat SSL請求參數丟失
request.getParameter("txtUser") is null
有什麼方法可以從以前的jsp訪問/檢索提交/請求參數嗎?
的web.xml
<security-constraint>
<display-name>Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/content/account/passrecover/*</url-pattern>
</web-resource-collection>
<role-name>custom-report-user</role-name>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Thx。如何將表單發佈到HTTPS?該URL實際上是相對的,所以超鏈接就像/content/account/passrecover/index.jsp,我不認爲它可以改變爲像https:// www .website.com/abc/content/account/passrecover/index.jsp – 2012-08-02 15:34:05
您需要以某種方式絕對地使表單的提交網址。如果您的當前頁面已經使用HTTPS協議,則它只能用作相對URL。有多種方式可以做到這一點。 1)將絕對HTTPS URL基礎存儲爲配置變量。 2)動態計算服務器上的HTTPS URL,可能使用ServletRequest.getRequestURL()。 3)使用JavaScript根據當前頁面的URL計算HTTPS URL,然後修改表單的提交操作。如果您還需要支持超過80和443的端口,動態選項可能難以以可重用的方式實現。 – kaliatech 2012-08-02 15:49:52