Integrate UI in html/jsp

Hi,

i started using vaadin just few days ago and i’m try to embedded an ui in a html page. I’m using javascript function vaadin.initApplication. I embedded a simple ui with a button, when i click on the button i have the following error:


“UIDL could not be read from server. Check servlet mappings”

i cant understand where is the error. Can someone help me plz?

This is my web.xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	<display-name>testvaadin7</display-name>
	<context-param>
		<description>
		Vaadin production mode</description>
		<param-name>productionMode</param-name>
		<param-value>false</param-value>
	</context-param>
	
	<servlet>
		<servlet-name>Testvaadin7 Application</servlet-name>
		<servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
		<init-param>
			<description>
			Vaadin UI class to use</description>
			<param-name>UI</param-name>
			<param-value>com.example.testvaadin7.Testvaadin7UI</param-value>
		</init-param>
	</servlet>
	
	<servlet-mapping>
		<servlet-name>Testvaadin7 Application</servlet-name>
		<url-pattern>/ui/*</url-pattern>
	</servlet-mapping>
	
	<servlet-mapping>
		<servlet-name>Testvaadin7 Application</servlet-name>
		<url-pattern>/VAADIN/*</url-pattern>
	</servlet-mapping>
	
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
</web-app>

This is my html page


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9;chrome=1" />
<title>This is my Embedding Page</title>
<!-- Set up the favicon from the Vaadin theme -->
<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/VAADIN/themes/reindeer/favicon.ico" />
<link rel="icon" type="image/vnd.microsoft.icon" href="/VAADIN/themes/reindeer/favicon.ico" />
</head>

<body>
TEST																	
<script type="text/javascript" src="./VAADIN/vaadinBootstrap.js"></script>
<iframe tabindex="-1" id="__gwt_historyFrame" style="position: absolute; width: 0; height: 0; border: 0; overflow: hidden" src="javascript:false"></iframe>
<div id="testui" class="v-app">
	<div class="v-app-loading">
	<NOSCRIPT>Attiva Javascript sul tuo browser per vedere questa finestra</NOSCRIPT>
	</div>
</div>
<script type="text/javascript">//<![CDATA[
	if (!window.vaadin)
		alert("Failed to load the bootstrap JavaScript: VAADIN/vaadinBootstrap.js");
		/* The UI Configuration */
		vaadin.initApplication("testui", {
			"browserDetailsUrl": "/testvaadin7/ui",
			"widgetset": "com.vaadin.DefaultWidgetSet",
			"theme": "test",
			"versionInfo": {"vaadinVersion": "7.0.3"},
			"vaadinDir": "VAADIN/",
			"heartbeatInterval": 300,				
			"debug": true,
			"standalone": false,
			"authErrMsg": {
			"message": "Take note of any unsaved data, "+
			"and <u>click here<\/u> to continue.",
			"caption": "Authentication problem"
			},
			"comErrMsg": {
			"message": "Take note of any unsaved data, "+
			"and <u>click here<\/u> to continue.",
			"caption": "Communication problem"
			},
			"sessExpMsg": {
			"message": "Take note of any unsaved data, "+
			"and <u>click here<\/u> to continue.",
			"caption": "Session Expired"
			}
		});//]] >
</script>

</body>
</html>	

Solved! If someone is interested the code above miss “serviceUrl” parameter in vaadin.initApplication.

Bump!

Hi,

i embedded my ui in an html page and all seam work. But atm i have problem with request.

If i try method like request.getarameter() from my ui all is ok. If i try the same method from html page where the ui is embedded it return null.

I’m under vaadin 7. Someone can help me plz?

Hi,

Did you solve it?
I have same problem.

Please look at this thread:
http://stackoverflow.com/questions/16493773/vaadin-7-url-parameter

Thank you.

I attempted to answer the specific question on stackoverflow. It seems that this question is about exactly the same issue, if not, please specify the question here.