The long line of code:
String
myFile=getServletConfig().getServletContext().getRealPath(myRequestFile);
is the same as:
ServletConfig servletConfig = getServletConfig();
ServletContext servletContext = servletConfig.getServletContext();
String myFile = servletContext .getRealPath(myRequestFile);
Its just all chained together.
The object first in the chain, pulls on the next in line which pulls the
next in line without having to explicitly giving a name for each step of
the way.
You can chain the methods and shorten your code.
After a point its gets less readable, from the programmer's point of view.
It all could also be shortened to:
String
pathToMyFile=getServletConfig().getServletContext().getRealPath(request.getServl\
etPath());
I was looking at the documentation and it appeared that
getServletConfig().getServletContext().
was redundant.