我无法理解为什么有时会出现' / urlpage'用于简单的' urlpage'。
例如在表单上
<form action="TestServlet">
<form action="/TestServlet">
我想了解指定html,servlet,jsp,jsf等路径的正确方法是什么。
答案 0 :(得分:2)
第一个是相对于当前路径。例如,如果你在/ appcontext / abc / def / Something,TestServlet将在/ appcontext / abc / def / TestServlet上
在第二个中,它与您的应用程序的上下文有关:如果您在/ appcontext / abc / def / Something,/ TestServlet将在/ appcontext / TestServlet上