简体   繁体   中英

How to Point Apache Towards a Vaadin (Java) Project?

Sorry if this is the wrong kind of question but currently I have an Apache server which is configured for Pyjamas. All I used to have to do was: pyjsbuild example.py and the GUI would appear in my browser.

I decided to switch to Java, so I picked Vaadin as my framework. How do I do the equivalent for Vaadin? All I want to do is compile the java and have Apache recognise it.

I'm using linux and I'm very new to building web applications, previously I only ever built the GUI side of things, I never had to touch the server.

You need Apache Tomcat to serve java pages. Install it separatly or see http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html for information on how to hook them together.

Vaadin projects work just as any web project. You have to crate a WAR file.

For example, if you are using Eclipse, right-click on the project, choose "Export..." and under "Web" choose "WAR file".

If you are using Netbeans or something else, google "create war in netbeans/intellij/..." to find out how to do this step.

This will generate a file with the extension .war, which you will have to copy in the "webbaps" folder of your Tomcat installation. Restart Tomcat and the application will be automatically deployed.

If you do not have access to the webapps folder, go to Tocatmcat's "Manager App" in the browser and under the section "Fichier WAR à déployer"(WAR file to depploy) choose the generated file and click Deploy.

To start with, make sure that go through Getting Started chapter in Book of Vaadin . In this chapter you will find overview of the required toolchain and step-by-step installation instructions. Your Linux distribution might have more documentation about installing JDK (For example, see Ubuntu wiki for Oracle JDK installation).

It will be convenient for you to connect Tomcat to Eclipse IDE. This makes starting Tomcat and updating your application easy. For example, see this [blog] for some videos about connecting Eclipse to Tomcat.

Please note that using Eclipse is just one approach and later you might want to see if IntelliJ IDEA or command line works better for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM