From Documentation

(Difference between revisions)
Jump to: navigation, search
(Create a New ZK Project)
(Running the ZUL File)
Line 54: Line 54:
# Configuring Apache Tomcat for Eclipse:<br/>  
# Configuring Apache Tomcat for Eclipse:<br/>  
-
You are required to create a valid [http://docs.zkoss.org/wiki/QuickStart_Guide#New_to_Servlet_Containers_.28aka..2C_Java_Web_Server.29.3F Apache Tomcat server] configuration.
+
You are required to create a valid [http://books.zkoss.org/wiki/ZK_Installation_Guide/Before_You_Start/New_to_Java_Servlet Apache Tomcat server] configuration.
Configuration of Apache with Eclipse is done in the '''Server/Runtime Environments''' preference page. The screenshot and instruction links below will enable you to setup your server instance with Eclipse.
Configuration of Apache with Eclipse is done in the '''Server/Runtime Environments''' preference page. The screenshot and instruction links below will enable you to setup your server instance with Eclipse.

Revision as of 02:58, 17 December 2010





Contents

Create a New ZK Project

1. Click [File]/[New]/[Other...]/[ZK Project] in Eclipse main menu
2. Type the project name. Eclipse will automatically include the default ZK package configured in the ZK Package preferences, however, you can select any other installed ZK package by selecting it from the combo box

Zk studio 094 create proj 1.JPG

3. Click Next

Zk studio 094 create proj 4.JPG

4. You can modify the following default directories, Context Root, Content Directory or the Java Source Directory if you like. Then, Click Finish.
5. After clicking Finish, the New Project Wizard will setup the ZK Project ready for development.


TIPS

1.The project's top right icon includes a ZK mark to show that the project has ZK support:

HasZKLibrary.png

2.The ZK package source code will be automatically attached to the related jar files

Zk studio 094 source attach.JPG

Creating a New ZUL File

Using the New File Command

You can create new ZUL file using the [File]/[New]/[File] command in Eclipse's main menu.

NewZULFileMethod1-1.png

However, you have to write the ".zul" extension yourself and the newly create zul file will not contain any template code.

NewZULFileMethod1-2.png

Using the New ZUL File Wizard

1. There are two ways to open the New ZUL File Wizard:
1.1. Right click on the opened Dynamic Web Project in "Project Explorer" view or "Package Explorer" view and select [New]/[ZUL].

NewZULFileRightClick.png

1.2. Click [File]/[New]/[Other] in Eclipse's main menu and then using the wizard to filter zul. Select zul from the listbox and then press 『』Next'』.
2. Type the file name and optional page title name, click Finish.

NewZULFileWizard.png


3. The newly created ZUL File will be opened in ZUL Editor.

Running the ZUL File

To run the ZUL File (that is, to run a ZK Web application in Eclipse), please follow the instructions below:

  1. Configuring Apache Tomcat for Eclipse:

You are required to create a valid Apache Tomcat server configuration. Configuration of Apache with Eclipse is done in the Server/Runtime Environments preference page. The screenshot and instruction links below will enable you to setup your server instance with Eclipse.

ServerRuntimePreference1.png


To create a server instance to run a web application the server needs to be defined. For tutorials on how to do this please refer to the "Choose a Server Runtime Environment" section of the article "WTP Tutorials – Building and Running a Web Application".

You can also refer to section 2 ("Define a Server Runtime") of this smalltalk.


Creating a Server instance in Eclipse's Server View:
To create a server instance please follow the "Create a Server" section of the "WTP Tutorials – Building and Running a Web Application" article on Eclipse's website. Alternatively you can refer to section 3 "Define a Server Instance" of this smalltalk to create a run-able server.


To start the server and view the result:
To start the server and view the resulting zul file please refer to the sections "Start the Server" and "Running the Application" of the article "WTP Tutorials – Building and Running a Web Application".


Tips:

There's a detailed step-by-step tutorial on using Tomcat with Eclipse at coreservlets.com: http://www.coreservlets.com/Apache-Tomcat-Tutorial/eclipse.html




Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.