检查其中一个应用程序的代码,发现这一行:
out.print(context.getFormattedValue(context.webRoot(),null));
我试图通过 Google 找到方法的描述:
context.webRoot()
context.getFormattedValue()
但我找不到这些方法的官方描述。为什么?
这是什么,很具体的方法吗? 这种方法已经过时了吗?
最佳答案
代码中的“上下文”是一个对象;您需要找出该对象的类。例如,HttpServlet 有一个“ServletContext”对象,它维护 servlet 的上下文。您的代码可能有一些东西将“context”声明为特定的 Java 类型——一旦您知道这一点,您就可以在“ObjectClassname.webRoot()”上进行网络搜索,并希望弄清楚发生了什么。
关于 java 。 context.getFormattedValue() 和 context.webRoot() 方法 : what they do?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4971448/