简体   繁体   English

/ urlpage和urlpage有什么区别?

[英]What is the difference between the /urlpage and urlpage?

I can't understand why sometimes a '/urlpage' is used over a simple 'urlpage'. 我不明白为什么有时在简单的“ urlpage”上使用“ / urlpage”。

for example on a form, 例如在表格上

<form action="TestServlet">

<form action="/TestServlet">

I want to understand what is the proper way of specifying a path to a html, servlet, jsp, jsf and etc. 我想了解指定html,servlet,jsp,jsf等路径的正确方法是什么。

The first one is relative to the current path. 第一个相对于当前路径。 For example, if you are on /appcontext/abc/def/Something, TestServlet will be on /appcontext/abc/def/TestServlet 例如,如果您在/ appcontext / abc / def / Something上,则TestServlet将在/ appcontext / abc / def / TestServlet上

In the second one, it is relative to the context of your app: if you are on /appcontext/abc/def/Something, /TestServlet will be on /appcontext/TestServlet 在第二个中,它与您的应用程序上下文有关:如果您在/ appcontext / abc / def / Something上,则/ TestServlet将在/ appcontext / TestServlet上

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM