<%!
private String self( HttpServletRequest request, String param1 ){
	
	return self( request, new String[]{param1});
}

private String self( HttpServletRequest request, String [] params ){

	StringBuffer path = new StringBuffer();
	String url = request.getRequestURL().toString();
	String ctx = request.getContextPath();
	
	path.append( url.substring( url.indexOf( ctx ) ));
	path.append( "?" );
	
	for( int i = 0; i < params.length;i++){
		String param = params[i];
		String value = request.getParameter( param );
	
		if (value != null) {
			path.append(param);
			path.append("=");
			path.append( value );
			path.append( "&" );
		}	
	}

	return path.toString();
}

private String encode( String s ) throws java.io.UnsupportedEncodingException{
	return java.net.URLEncoder.encode( s, "UTF-8");
}
%>