简体   繁体   English

HttpUtil,logger.debug

[英]HttpUtil, logger.debug

I am implementing facebook connect for my web application using facebook-java-api.我正在使用 facebook-java-api 为我的 web 应用程序实现 facebook 连接。 I am actually following a tutorial from this site我实际上正在关注这个网站的教程

I have written a servlet to implement step 4 which is given in the tutorial, but I am not able to resolve 2 errors thats我编写了一个 servlet 来实现教程中给出的第 4 步,但我无法解决 2 个错误

HttpUtil HttpUtil

logger.debug logger.debug

I have imported all the packages to the project build path but I am not able to resolve those errors,我已将所有包导入项目构建路径,但我无法解决这些错误,

The site itself mentions that the implementation of HttpUtil ought to be obvious to the reader.该网站本身提到 HttpUtil 的实现对读者来说应该是显而易见的。 Going by the comments posted on the site, HttpUtil ought to do the following (pseudocode):根据网站上发布的评论,HttpUtil 应该执行以下操作(伪代码):

method getCookieValue(String cookieValue) 1. Obtain the cookies from the request.方法 getCookieValue(String cookieValue) 1. 从请求中获取 cookies。 2. Return null, if no cookies were found. 2. 如果没有找到 cookies,则返回 null。 3. Iterate through all the cookies, and return the value of the cookie matching the argument cookieValue. 3、遍历所有的cookies,返回与参数cookieValue匹配的cookie的值。

logger.debug is fairly easy to figure out if you've used log4j. logger.debug 很容易判断您是否使用过 log4j。 But since you haven't, here's a very simple usecase.但既然你还没有,这里有一个非常简单的用例。 You'll need to create a logger object and invoke the debug method on it as:您需要创建一个记录器 object 并在其上调用调试方法:

private static final Logger logger = Logger.getLogger(yourClassName.class.getName()); //this is a class member declaration
...
void someMethod()
{
     logger.debug("debug message");
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM