How do I configure a Vaadin Composite Form for deployment?

I am currently developing a J2EE school management system using vaadin. I want to visually design the interface in eclipse but don’t know how to configure the Vaadin composite Forms for deployment. Do I use web.xml like in servlets or do I add the @WebServlet annotation at the top of the Form or which option do I use to configure this so that I can run all the Forms I create using Vaadin Composite Component?
Please help me.
Thanks in advance

Hi,

I’d really suggest to dump J2EE and go to Java EE 6 or 7. They are much easier to get started with. With J2EE server you probably don’t have support for Servlet 3.0 so you must have web.xml to define the Vaadin servlet and the UI class that you wish to use as you entry point.

cheers,
matti

Thanks Matti for your response. I am new to Vaadin but experienced in Java.
I’m using apache 8(apache 8.0_15) as my local server in Kali Linux. I have created a new Vaadin project with Servlet 3.0 and Vaadin 7. & I want to create a menu for all the forms I have and don’t know how to link them as I don’t have a url-pattern to link the menu to the required form. In J2EE all I had to do was to define the parameters in web.xml. Do I still use web.xml or do I use @WebServlet annotation? I’ve read that in Vaadin 7 I don’t need to use web.xml. How do I handle this in Vaadin 7?
Thanks
Allan
Nairobi, Kenya

Hi,

In servlet 3 you most often don’t need web.xml as you can use @WebServlet to define servlets and @WebFilter for filters.

But I’d note that you only need one servlet and it can host multiple Vaadin UIs. With Java EE server and Vaadin CDI this is really easy, just map different UIs with @CDIUI(“pathidentifier”). Or then you could use the Navigator and views for different forms. Check out our book for examples of these.

Instead of going with plain Apache Tomcat, I’d really suggest use e.g. TomEE or some other modern lightweight Java EE server (Wildfly, GlassFish, Liberty). They provide much more than just the servlet engine, they cost the same (~nothing) and are just as fast.

cheers,
matti