<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Struts 2 jQuery Autocomplete</title>
<link rel="stylesheet"
	href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" />
<script type="text/javascript"
	src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$(function() {
			$("#autocomplete").autocomplete({
				source : function(request, response) {
					$.ajax({
						url : "autoCompleteAction",
						type : "POST",
						data : {
							term : request.term
						},
						dataType : "json",
						success : function(serverJsonResponse) {
							response(serverJsonResponse.jasonList);
						}
					});
				}
			});
		});
	});
</script>
<s:head />
</head>

<body>
	<h2 style="color: green">
		<s:text name="label.welcome" />
	</h2>
	<s:form action="welcomeAction" namespace="/" method="post"
		name="strutsForm">
		<s:textfield id="autocomplete" size="30" maxlength="50" label="Enter Name" />
	</s:form>
</body>
</html>
