首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Vaadin 7示例,在部署到tomcat 7时显示"Cookies Disabled“消息

Vaadin 7示例,在部署到tomcat 7时显示"Cookies Disabled“消息
EN

Stack Overflow用户
提问于 2014-04-08 06:39:25
回答 1查看 2.5K关注 0票数 1

我正在努力解决一个让我困惑的问题,并让我思考问题是来自tomcat还是vaadin。

应用程序:我创建的应用程序是您可以使用eclipse和vaadin7插件构建的启动项目,它构建一个带有按钮的页面。无论何时单击该按钮,都会在下方显示一行文本,单击次数越多,就会添加更多行。

问题:这个应用程序在eclipse上运行,就像一个带有tomcat服务器的护身符。然而,当我部署到运行在apache服务器上的tomcat 7服务器上时,无论我使用什么浏览器(IE、Firefox和chrome),我都会检索到"Cookies Disabled“消息,甚至从每个浏览器移除所有安全性并接受所有cookies,似乎都不起作用。

它生成的代码如下: EvotestUI.java

代码语言:javascript
运行
复制
import javax.servlet.annotation.WebServlet;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

@SuppressWarnings("serial")
@Theme("evotest")
public class EvotestUI extends UI {

@WebServlet(value = "/*", asyncSupported = false)
@VaadinServletConfiguration(productionMode = false, ui = EvotestUI.class)
public static class Servlet extends VaadinServlet {
}

@Override
protected void init(VaadinRequest request) {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    setContent(layout);

    Button button = new Button("Click Me");
    button.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            layout.addComponent(new Label("Thank you for clicking"));
        }
    });
    layout.addComponent(button);
}

}

ivysettings.xml

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
<settings defaultResolver="default" />
<resolvers>
<chain name="default">
<!-- Public Maven repository -->
<ibiblio name="public" m2compatible="true" />
<!-- Vaadin Add-on repository -->
<ibiblio name="vaadin-addons" usepoms="true" m2compatible="true"root="http://maven.vaadin.com/vaadin-addons" />
<!-- Vaadin snapshots repository -->
<ibiblio name="vaadin-snapshots" usepoms="true" m2compatible="true" root="https://oss.sonatype.org/content/repositories/vaadin-snapshots" />
<!-- Repository used for Vaadin modified smartsprites library -->
<dual name="custom-smartsprites">
<filesystem name="smartsprites-ivy">
<ivy pattern="${basedir}/ivymodule/[module]-ivy-[revision].xml" />
</filesystem>
<url name="smartsprites-artifact">
<artifact pattern="http://dev.vaadin.com/svn/versions/6.8/build/smartsprites/lib/[artifact](-[revision]).[ext]" />
</url>
</dual>
</chain>
</resolvers>
<modules>
<!-- Vaadin patched SmartSprites -->
<module organisation="com.carrotsearch" name="smartsprites" revision="0.2.3-itmill" resolver="custom-smartsprites" />
</modules>
</ivysettings>

ivy.xml

代码语言:javascript
运行
复制
<?xml version="1.0"?>
<!DOCTYPE ivy-module [<!ENTITY vaadin.version "7.1.12">]>
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="com.example" module="v7proj" />
<configurations>
    <!-- The default configuration, which should be deployed to the server -->
    <conf name="default" />
    <!-- A configuration only needed when compiling the widget set. Should 
        not be deployed to the server -->
    <conf name="widgetset-compile" />
    <!-- A configuration used in compilation of server side classes only.
        Should be deployed to the server -->
    <conf name="nodeploy" />
</configurations>
<dependencies defaultconf="default" defaultconfmapping="default->default">
    <!-- The core server part of Vaadin -->
    <dependency org="com.vaadin" name="vaadin-server" rev="&vaadin.version;" />

    <!-- Vaadin themes -->
    <dependency org="com.vaadin" name="vaadin-themes" rev="&vaadin.version;" />

    <!-- Push support -->
    <dependency org="com.vaadin" name="vaadin-push" rev="&vaadin.version;" />

    <!-- Servlet 3.0 API -->
    <dependency org="javax.servlet" name="javax.servlet-api" rev="3.0.1" conf="nodeploy->default" />

    <!-- Precompiled DefaultWidgetSet -->
    <dependency org="com.vaadin" name="vaadin-client-compiled"
        rev="&vaadin.version;" />

    <!-- Vaadin client side, needed for widget set compilation -->
    <dependency org="com.vaadin" name="vaadin-client" rev="&vaadin.version;"
         conf="widgetset-compile->default" />

    <!-- Compiler for custom widget sets. Should not be deployed -->
    <dependency org="com.vaadin" name="vaadin-client-compiler"
        rev="&vaadin.version;" conf="widgetset-compile->default" />
</dependencies>
</ivy-module>
EN

回答 1

Stack Overflow用户

发布于 2015-02-13 18:09:43

这是使用httponly的tomcat服务器中的一个bug。更改服务器配置后解决了问题。谢谢

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22924411

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档