calling vaadin application from php page jquery

Dear all…
I create page in php and I want to send some parameter to my vaadin application and I use Jquery ajax to do this but when I send it I get problem instead of the out put
I tried many many datatype and contenttype and same result :

XMLHttpRequest cannot load http://localhost:8080/FTTBManager/?restartApplication&activate=1&username=Ahmed1.Hiwa%40gold. Request header field Content-Type is not allowed by Access-Control-Allow-Headers.

This is my page in php:

[code]

<title>Gorannet Company: Activate Numbers</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<link href="../Style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="jquery-1.7.2.min.js" ></script>
<script type="text/javascript">
	$(document).ready(function() {
	

		$('#btnClick').click(
		

			function ()
			{
				/*$.get(//"http://localhost:5472/index.aspx"
						"http://localhost:8080/FTTBManager/?restartApplication"
					,
						{activate:"1",username:"Ahmed1.Hiwa@gold" }, 
						function(result) 
						{ 
						//	alert ("Result Was : " + result);
							$('#divout').html(result); 
						}, 
						"text" 
					  )*/
					  $.ajax
				     (
					 {
						type:"GET",
						url:"http://localhost:8080/FTTBManager/?restartApplication",
						data:
						{
						activate:"1",
						username:"Ahmed1.Hiwa@gold"
						},
						dataType: 'json',
						contentType: "text/xml",
						success:
							function(data, textStatus)
							{
								//alert ("test");
								$('#divout').text(textStatus);
							},
						error:
						function(html, textStatus)
						{
							alert(textStatus);
							$('.result').html(html);
							alert("Data: " + html);
						}
					}
				);
				
			}
		);
    });
</script>
Gorannet Company
Gorannet Database System
| Main | Log out |

The numbers that should be activated
								</table>						
						<table border="0" width="700">
								<tr>
									<td width="100">Phone no.</td>
									<td colspan="2" align="left" width="600">
									<!--	<select onChange="find_site()" name="phone">
										<option value='21518'>3184250</option><option value='20551'>3201812</option><option value='24106'>3205616</option><option value='18487'>3209868</option><option value='1233'>3211295</option><option value='10010'>3230366</option><option value='27240'>3267513</option><option value='15814'>3281042</option><option value='26129'>3281915</option><option value='24105'>3291897</option>											</select>
									-->
									</td>
								</tr>
								<tr bgcolor="#CCCCCC">
									<td  align="center" colspan="3">
										<!--<input type='submit' name='submit' value='Activate'>-->&nbsp;&nbsp;&nbsp;
										<input type='submit' name='all' value='Activate all'>
									</td>
								</tr>
						</table>
						</form>
									  			</td>
		  		</tr>
		  	</table>
			<div style="text-align:center" id="divout">
			<?php
			if(isset($_POST['all']

))
{
$selections=$_POST[‘options’]
;
echo sizeof($selections);
for ($i=0;$i<sizeof($selections);$i++)
{
echo $selections[$i]
.“
”;
}
}
?>

			</div>
             <input type="submit" id="btnClick" value="click" />
		  	<FONT FACE="Tahoma"><br></FONT>
		  	<table width="700" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td>
						<div align="left">
						</div>
						<DIV ALIGN="CENTER">
							<FONT SIZE="2" FACE="Tahoma">Copyright 2007 Gorannet Company. All Rights Reserved</FONT>
						</DIV>
						<TABLE WIDTH="700" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="20" ALIGN="center">
							<TR BGCOLOR="#000000">
								<TD BGCOLOR="#336666">&nbsp;</TD>
							</TR>
						</TABLE>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<FONT FACE="Tahoma"></FONT>

[/code]:

and this is my code in vaadin:

package net.gorannet.fttx.manager.application;

import java.io.ByteArrayInputStream;
import java.net.URL;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.vaadin.Application;
import com.vaadin.terminal.DownloadStream;
import com.vaadin.terminal.ParameterHandler;
import com.vaadin.terminal.URIHandler;
import com.vaadin.terminal.gwt.server.HttpServletRequestListener;
import com.vaadin.ui.Window;


public class FTTxManagerApplication extends Application implements  URIHandler,ParameterHandler,HttpServletRequestListener
{

	private static final long serialVersionUID = -2809025027084307411L;
	@Override
	public void init()
	{
		
	
		Window mainWindow = new Window("FTTx Manager");
		
		mainWindow.addParameterHandler(this);
		mainWindow.addURIHandler(this);
		setMainWindow(mainWindow);
	}

	
	 String strFinalResult = "";
	 String strUsername="";
	 String strAction="";
	boolean checkIterator(Map parameter,String strKey)
	{
	     for (Iterator<String> iterator = parameter.keySet().iterator(); iterator.hasNext();)
	        {
	        	if(strKey.equalsIgnoreCase((String) iterator.next()) )
	        	{
	        		return true;
	        	}
	        }
		return false;
	}
	@Override
	 public void handleParameters(Map parameters) 
	 {
	 	
	        for (Iterator<String> iterator = parameters.keySet().iterator(); iterator.hasNext();)
	        {
	        	String strKey = (String) iterator.next();
	        	
	        	String strValue = ((String[]) parameters.get(strKey))[0]
;
	        	
	        	System.out.println("\r\nKey: "+strKey);
	        	System.out.println("\r\nValue: "+ strValue);

	        		if(strKey.equalsIgnoreCase("activate") && !checkIterator(parameters, "deactivate"))
	        			
	        		{
	        			strAction=strKey;
	        			
	        		}
	        		else if(strKey.equalsIgnoreCase("deactivate") && !checkIterator(parameters, "activate"))
        			{
	        			strAction=strKey;
        			}
	        		
		        	if(strKey.equalsIgnoreCase("username"))
		        	{
		        		strUsername=((String[]) parameters.get(strKey))[0]
;
		        		
		        	}
		        	if(!strAction.isEmpty() && !strUsername.isEmpty())
		        	{
		        		
		        		FTTBStatus fttbStatus=new FTTBStatus();
		        		if(strAction.equalsIgnoreCase("activate"))
		        		{
		        			
		        			fttbStatus.activate(strUsername);	
		        		}
		        		else	
		        		{
		        			
		        			fttbStatus.deactivate(strUsername);	
		        		}
		        		
		        		fttbStatus=null;
		        	}
		        	
	        		
	        	strFinalResult = test(strKey,strValue);
	        	
	        }
	    	strUsername="";
        	strAction="";
	 }	 
	 
	 public String test(String strKey, String strValue)
	 {
		 if (strKey.equalsIgnoreCase("Activate"))
		 {
			 //do activation
			
			 return ("Activated");
			 
		 }
		 else
		 {
			 return ("Not Activated");
		 }
	 }
	 
	 
	 public DownloadStream handleURI(URL context, String relativeUri)
	 {
		 /*
		 String strResponse = "<!DOCTYPE html>" + "\r\n";
		 strResponse += "<html>" + "\r\n";
		 strResponse += "<head>" + "\r\n";
		 strResponse += "<script>document.domain=\"www.gorannet.net\"; document.write(document.domain); </script>";
		 strResponse += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">" + "\r\n";
		 strResponse += "</head>" + "\r\n";
		 strResponse += "<body>" + "\r\n";
		 strResponse += "<b>Testing</b>" + "\r\n";
		 strResponse += "</body>" + "</html>" + "\r\n";
		*/
		 
		 String strResponse = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + "\r\n";
		 strResponse += "<note>" + "\r\n";
		 strResponse += "<to>" + "HELLO " + "\r\n";
		 strResponse += "</to>" + "\r\n";
		 strResponse += "</note>" + "\r\n";
		 
		 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(strResponse.getBytes());
		 return (new DownloadStream(byteArrayInputStream, "text/xml", null));
	 }
	@Override
	public void onRequestStart(HttpServletRequest request,
			HttpServletResponse response) 
	{
		
		
		request.setAttribute("Access-Control-Allow-Headers", request.getContentType());
		request.setAttribute("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
		request.setAttribute("Access-Control-Allow-Origin", "*");
		
		System.out.println(request.getContentType());
		response.setHeader("Access-Control-Allow-Headers", request.getContentType());
		response.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
		response.setHeader("Access-Control-Allow-Origin", "*");
		
		//System.out.println("Respond");
	}
	@Override
	public void onRequestEnd(HttpServletRequest request,
			HttpServletResponse response) 
	{
	
		// TODO Auto-generated method stub
		
	}
	
	
}
Form no. Phone no. Balance Site Frame Slot Port
2151831842502060512
2055132018121812615
241063205616141046
1848732098684112229
1233321129542111026
100103230366620018

thank you very much i solved the problem with cors-filter . You can find it here just go with instruction it should be working ok

cors filter instrunction