Can servlet attribute names contain a hyphen -?

后端 未结 2 1357
自闭症患者
自闭症患者 2021-01-24 03:25

Can servlet attribute names contain a hyphen -?

Because, I tried to retrieve the attributes from the request set in the doPost in my servlet, b

2条回答
  •  遇见更好的自我
    2021-01-24 04:11

    You can use implicit object of jsp as

    response.getAttribute("X-User");
    response.getAttribute("Y-Code");
    

    As you're setting attribute from servlet there is no need to get it via jstl.

提交回复
热议问题