I am trying java networking programming, just for fun during my summer time. i try to connect to a website using java. To test the whether the code actually connect to a website, i put a page view counter in my blog and used the code to connect to it. However, page view counter doesn not increase when the program finishes. Can you give me some suggestions, please? This is my code
What type of page counter have you used? One with Netstat or a similar service?
If so, then those only work if its image is loaded, with the special code in the src tag indicating that it is your site for which the counter is loaded. You should parse the HTML page (HTMlEditorKit.Parser and HTMLEditorKit.ParserCallback may help you out), retrieve the image source and read its data as well.
If the counter is something custom written in PHP / ASP / JSP / servlets / CGI then just accessing the page should work. That should also work if you're using a counter based on the webserver's logs like Webalizer.