All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mindscapehq.raygun4java.webprovider.RaygunRequestMessage Maven / Gradle / Ivy

Go to download

The official provider for the Raygun Crash Reporting service. This is the web provider that sends errors caught from your servlet/JSP application. Used in conjunction with raygun4java.core.

There is a newer version: 4.1.0
Show newest version
package com.mindscapehq.raygun4java.webprovider;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

public class RaygunRequestMessage {

	private String hostName;
	private String url;
	private String httpMethod;
	private String ipAddress;
	private Map queryString;
	private Map data;
	private Map form;
	private Map headers;
	private String rawData;	
	
	public RaygunRequestMessage(HttpServletRequest request)
	{			
		httpMethod = request.getMethod();
		ipAddress = request.getRemoteAddr();
		hostName = request.getRemoteHost();
		url = request.getRequestURI();
		queryString = QueryStringToMap(request.getQueryString());
	}
	
	public Map QueryStringToMap(String query)
	{	   
	    String[] params = query.split("&");
	    Map map = new HashMap();
	    for (String param : params)
	    {
	        String name = param.split("=")[0];
	        String value = param.split("=")[1];
	        map.put(name, value);
	    }
	    return map;
	}	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy