Summary of paths and summary of paths

Source: Internet
Author: User

Summary of paths and summary of paths

 





../Indicates the upper-level directory./indicates the root directory of the current directory/website





Absolute path

Java code
  1. Use the complete URL address. This link path is an absolute path, which is characteristic of being independent of the source point of The Link site.


Example of absolute path

Java code
  1. To create about. aspx pointing to the about directory, the link address is:
  2. <A href = "http://www.asp.net/about/about.aspx”> </a>
  3. The path to the database. aspx document is:
  4. <A href = "http://www.asp.net/product/other/database.aspx”> </a>


Disadvantages of absolute path

Java code
  1. The biggest disadvantage of using absolute paths is that it is not conducive to porting, for example, the current site address is http://www.asp.net,
  2. If one day the site changes the http://www.asp.com,
  3. All links are invalid and need to be modified, which is difficult to maintain.






Relative Path :............... ../Indicates the upper-level directory./indicates the current directory
The relationship between the source and target endpoints.

First, the source and target endpoints are in the same directory.

Java code
  1. The source and target endpoints are in the same directory. You only need to specify the document name of the target endpoint in the link. For example, in Figure 3-5, if you want to create a link to develop. aspx in the about. aspx document, you can write it as follows:
  2. <A href = "develop. aspx">



Case 2: the source and target endpoints are not in the same directory

Java code
  1. If the source and target endpoints are not in the same directory, you only need to express the relative relationship of the directories. If the document to which the link points is not in the sub-directory of the current directory, you can use ".. symbol to indicate the current parent directory, multiple .. symbol can represent the parent-level directory of the root, and thus build the relative location of the directory.
  2. For example, if you want to create a link in the about. aspx document to the software. aspx document in the product directory, you can use the following code:
  3. <A href = "../product/software. aspx">
  4. If you want to create a link to the about. aspx document in the database. aspx document, you can use the following path
  5. <A href = ".../../about. aspx">


The advantage of using the relative directory is that the link will not go wrong as long as the structure and document of the site remain unchanged. However, if you move the file or the relative relationship changes, an error will occur.


Path based on the following directory: ----/root directory of the website
It can be seen as a compromise between the absolute path and the relative path. In this expression, all the paths start from the site and the directory, and their single-origin endpoint locations are irrelevant.

Java code
  1. For example, in Figure 3-5, the link to About. aspx under the about folder is
  2. <A href = "/about. aspx">
  3. Set the link to database. aspx
  4. <A href = "/product/other/database. aspx">
  5. In addition, if you point to the home page, you can write it
  6. <A href = "/"> or <a href = "/default. aspx">


Note: To determine whether a path is relative or relative to a directory, check whether the link address starts from "/".


"~" Of ASP. NET Path
Added a new expression "~" in ASP. NET. "~" Indicates the path of the current application. "~" The biggest difference from the "/" mentioned above is that the server dynamically interprets the data. Because "~" Is relative to the root directory of the application.


For J2EE web projects, how do I set and obtain absolute and relative paths?

This is a J2EE web project that I sorted out and summarized based on some materials in March to solve all the path problems. I hope it will help you and more people:
------------------------------
The paths used in Java are divided into absolute paths and relative paths. In essence, Java can only use absolute paths to find resources. All relative paths are just some convenient methods to find resources. However, the API helps us build an absolute path at the underlying level to find resources!

When developing Web applications, you often need to obtain the physical path of the current WebRoot on the server.

For Servlet, Action, Controller, Filter, Listener, interceptor, and other related classes, we only need to obtain ServletContext and then use ServletContext. getRealPath ("/") to obtain the physical address of the current application on the server.

If ServletContext is not obtained in the class, there are two ways to do this:

1) Use the class loading mechanism of Java: Call XXX. class. getClassLoader (). getResource (""); to obtain the ClassPath, and then obtain the WebRoot directory.
This method takes effect only when the class is in WebRoot/WEB-INF/classes and fails if the class is packaged into a jar file. In this case, we should use the following method.

2) spring framework ideas in WEB-INF/web. in xml, create a webAppRootKey param and specify a value (default: webapp. root) as the key value, and then use Listener, Filter, or Servlet to execute String webAppRootKey = getServletContext (). getRealPath. the root serves as the Key and the Value is written to the System Properties. Then, use System. getProperty ("webapp. root") in the program to obtain the physical path of WebRoot.

Based on the second idea, we can expand it. However, for applications deployed on a server, if you do not need them yet, please read them further.

The following are some methods to obtain the absolute path of classpath and the current class. You can use some of these methods to obtain the absolute path of the required resources:

1. DebitNoteAction. class. getResource ("")
The URI Directory of the current FileTest. class file is obtained. Not yourself!
For example: file:/D:/eclipse/springTest/WebRoot/WEB-INF/classes/
Atacarnet/src/com/evi/modules/atacarnet/action/

2. DebitNoteAction. class. getResource ("/")
Obtain the absolute URI path of the current classpath.
For example, file:/D:/eclipse/springTest/WebRoot/WEB-...... the remaining full text>

How to calculate the Key Path

Critical path

The Key Path is a term used for progress control in project management.
In the project network diagram, there are many paths from the project start to the project completion, just as from the 798 Art District to Peking University (1 ). If 20 people depart from the 798 Art Zone at the same time, each person takes a different road (by subway, bus or self-driving), but only 20 people arrive at Peking University to complete the meeting. The last person to arrive is the person who takes the longest path (the most time spent.

Figure 1
Similarly, the project ends only when the longest (most time-consuming) path is complete. The longest path in the entire network is the Key path (critical path ).
First, we will give you a general concept of the Key Path. The following describes several key terms:
(1) the earliest start time (ES) indicates the earliest start time of an activity.
(2) The earliest End Time (EF) refers to the earliest time that an activity can be completed.
EF = ES + estimated duration
EF is obtained based on the estimation of elasticsearch and the estimated duration.
(3) The latest End Time (LF) refers to the time required to complete an activity at the required time node.
(4) The latest start time (LS) indicates the time required to complete an activity at the required time node.
LS = LF-estimated Construction Period
LS is obtained by Reverse Estimation Based on LF and construction period estimation.
(5) Total time difference (TS): The difference between the project EF and the project requirement completion time is also a float)
Total time difference = LF-EF or always Difference = LS-ES, the results of the two calculation methods are equal.
Well, let's go back and talk about the Key Path. One way to determine the key path is to find out the activities with the minimum difference. With the LF-EF (or LS-ES, the results are the same) for each activity, and then find out the minimum value (either the smallest positive time difference or the largest negative time difference) for the activity, these activities are all activities on the Key Path.

Figure 2

The time difference is accumulated to minimize the time difference of the Red Line. Therefore, the Key Path of the yellow line for this project is (2 ). Meanwhile, task D is parallel with task E. the time difference of task D is 7 days, while that of task E is 8 days. Therefore, task D has a one-day floating time (3 ).

Figure 3

It is worth noting that if the project is large, there will be many paths in a Project Network Diagram from the start to the end. Some paths may always have a positive time difference, while others may have a negative time difference. The paths with positive time difference are called noncritical paths, and those with always 0 or negative values are called critical paths. In this case, the path with the longest time consumption is called the most critical path (most noncritical paths ).

Finally, let's summarize the four key points of the Key Path Method:
(1) The Key Path is the longest path in the project network diagram. It determines the total time consumed by the project;
(2) The project manager must focus on tasks with higher priorities to ensure that they are completed on time. Any delays in any activities on Critical Paths will delay the entire project;
(3) time is required for a Key Path and resources are required for a non-key path;
(4) Adjust the progress and balance resources.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.