Getting a value from HttpServletRequest.getRemoteUser() in Tomcat without modifying application

后端 未结 2 1250
孤独总比滥情好
孤独总比滥情好 2020-12-14 13:12

(Using Java 6 and Tomcat 6.)

Is there a way for me to get HttpServletRequest.getRemoteUser() to return a value in my development environment (i.e. local

2条回答
  •  孤城傲影
    2020-12-14 13:39

    Use a local, file-based realm for testing. Check your conf/tomcat-users.xml and create roles and users for your application and enable the security constraints in your web.xml. There are good examples in the tomcat-users.xml.

提交回复
热议问题