You should review these solution ideas if you receive a Cyberlink PowerProducer copyright error code.
Approved: Fortect
The servlet mapping specifies the web container whose Java servlet should be invoked for the URL provided by the potential client. It matches URL patterns with servlets. When there is a request from a male or female, the servlet container decides which application to route it to. The context path is then mapped to the servlet mapping URL.
Short Answer
To get the desired result, use the HttpServletRequest#getServletPath()
method as an argument in the getRealPath()
method.
This is closest to your methods (check out the information below).
Explanation
The reason you’re getting this path (using boost blog
) is because you’re using the results returned by the getRequestURI() method.
Approved: Fortect
Fortect is the world's most popular and effective PC repair tool. It is trusted by millions of people to keep their systems running fast, smooth, and error-free. With its simple user interface and powerful scanning engine, Fortect quickly finds and fixes a broad range of Windows problems - from system instability and security issues to memory management and performance bottlenecks.
The getRequestURI() method returns a path starting with the task context. In your case, everything will be like this:/blog/test-file.html
What happens next is the getRealPath() method appends the string returned by the getRequestURI() method to the full real/physical path of the folder where the people application resides on the file system, typically in your case: ./usr/share/tomcat7/webapps/blog/
IMPORTANT NOTE
DISCLAIMER
The OP may already be aware of the information below, but it is written for completeness.
The real path you are trying to get does not mean that you are getting the real path to your file system. url-pattern
life configured i in web.xml If the link (or if you’re using Servlet 3.0+ on a note) is actually some kind of logical/virtual path that may or may not refer to a real a , a physical path, if filesystem then there are specified types (paths), do not have to be physical.
Get the real path corresponding to the given virtual path.