Scheduled XAgent - NON SSL


import java.net.HttpURLConnection;
import java.net.URL;

import lotus.domino.AgentBase;

public class JavaAgent extends AgentBase {

	// Change these settings below to your setup as required.
	static final String	targetURL	= "http://URL_OF_YOUR_XPAGE_AND_OPTIONAL_QUERYSTRING";
	static final String	USER_AGENT	= "Mozilla/5.0";


	public void NotesMain() {
		try {
			final URL url = new URL(JavaAgent.targetURL);
			final HttpURLConnection httpUrlConnection = (HttpURLConnection) url.openConnection();

			httpUrlConnection.setRequestMethod("GET");
			httpUrlConnection.setRequestProperty("User-Agent", JavaAgent.USER_AGENT);
			httpUrlConnection.getResponseCode();

		} catch (final Exception e) {
			// YOUR_EXCEPTION_HANDLING_CODE
		}
	}
}
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...