문제

I'm new of vaadin and this is the first time that I try to use an add-on EasyUpload add-on

I'm using maven to build my project, and i modified my pom.xml in ths way:

<project>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>My-vaadin-webapp</artifactId>
  <packaging>war</packaging>

<!-- Add-On Repository -->
<repositories>
    <repository>
        <id>vaadin-addons</id>
        <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>
</repositories>


<dependencies>
    <dependency>
        <groupId>org.vaadin.addon</groupId>
        <artifactId>easyuploads</artifactId>
        <version>7.0.1</version>
    </dependency>   
</dependencies>

</project>

But when to try

MultiFileUpload

i get the following result:

enter image description here

I read the I should compile my widget-set, but I don't use a custom widget-set, I'm using a default widget-Set.

This is my web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
<web-app>
    <display-name>MyApp</display-name>



    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

    <listener>
      <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>

    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>

    <servlet>
        <servlet-name>MyServlet</servlet-name>
        <servlet-class>com.myApplication.AutowiringApplicationServlet</servlet-class>
        <init-param>
            <description>Vaadin UI class to use</description>
            <param-name>UI</param-name>
            <param-value>com.myApplication.Application</param-value>
        </init-param>   

    </servlet>


    <servlet-mapping>
        <servlet-name>VaadinApplication</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

</web-app>

Where am I doing wrong? How to can I do to solve my problem?

도움이 되었습니까?

해결책

Create a widgetset in the src/main/resources folder under an arbitrary package (x.y for example). Name it AppWidgetSet.gwt.xml for example.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module>
    <inherits name="com.vaadin.DefaultWidgetSet" />

    <set-property name="user.agent" value="safari"/>  

    <inherits name="org.vaadin.easyuploads.Widgetset" />
</module>

Annotate your custom UI with the following:

@Widgetset("x.y.AppWidgetSet")

The "inherits" part is autogenerated by the mvn vaadin:update-widgetset goal based on the dependencies of your pom. Since I included the multifileupload here you don't need to call it this time.

Do a mvn vaadin:compile. Refresh your project and your server.

다른 팁

When you use addon widgets, you will have to recompile the whole widget set. Depending on your maven targets there should exist one such...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top