![]() In addition, you should try to avoid using a similar ".", "./", ". Therefore, in general, it is best to add before attributes such as jsp/html pages, such as Css,javascript.action, to ensure that the referenced files belong to the Web The directory in the application. Submitting to the servlet for actiom = "/webapp/handleservlet" Javascript is also resolved on the client side, so its relative path is the same as the form form. The address of the form's action attribute in Html should be relative to the server root (HTTP://192.168.0.1/), so if the commit to a.jsp is: action = "/webapp/user/a.jsp" or action = ""/user/a.jsp ![]() The relative addresses in all HTML pages are relative to the server root (HTTP://192.168.0.1/) rather than to the directory of the Web application (in the directory). įorward:servlet in the Request.getrequestdispatcher (address) This address is resolved on the server side, so you have to forward to a.jsp should write this: Request.getrequestdispatcher ("/user/a.jsp") this/relative to the current Web application WebApp, its The absolute address is. The relative address on the server side refers to the address of your Web application, which is resolved on the server side (unlike the relative addresses in HTML and JavaScript, which are parsed by the client browser) that means that at this point in the JSP and servlet The relative address in should be relative to your Web application, that is, relative to. about relative and absolute paths in Jsp/servlet This similar representation is also a relative path.Ģ. For example: "./" represents the current directory, ". Contains the relative path of the web (relative directories in HTML), for example: In a Servlet, "/" represents the directory for Web applications, and the relative representation of the physical path. ![]() Relative path: The path relative to a base directory. Http://also represents a URL absolute path. Absolute path: Absolute path is the true path of the file or directory on your home page on your hard disk, (URL and physical path) For example: C:/xyz/est.txt represents the absolute path of the Test.txt file.
0 Comments
Leave a Reply. |