1 / 12

Apache - Click

Apache - Click. By, Anupam Mundale. Viraj Kulkarni. JEE Web Application Framework Method to build Web Applications without MVC and JSP’s. Java Language support Uses HTML templates and POJO’s. Apache Velocity Engine to support HTML templates Built on Java servlet API

dudley
Download Presentation

Apache - Click

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Apache - Click By, Anupam Mundale. Viraj Kulkarni.

  2. JEE Web Application Framework • Method to build Web Applications without MVC and JSP’s. • Java Language support • Uses HTML templates and POJO’s. • Apache Velocity Engine to support HTML templates • Built on Java servlet API • Open source Project (Apache license 2.0) • Simple, easy to use, good performance and scalability • Competing Frameworks – JSF, Tapestry, WebObjects and Apache Wicket Introduction

  3. 1) Install Click -2.3.0 and add required JAR files to the Project and deploy. 2) Click IDE • Click IDE is an eclipse plugin for developing Click Web Applications. • Click IDE Dependency – Eclipse 3.5.x and WTP 3.1.x • Unzip clickide-x.x.x.x.zip and put 2 folders (plugins/ and features/) into your ECLIPSE_HOME. 3) Click IDE Features • Fast switching between Page classes and templates • Project creation wizard • Click page creation wizard • Visual editor for the Click configuration file • Velocity template editor • Spring Framework and Apache Cayenne Integration • Integrated Click documentation Click – Project Environment and Click IDE

  4. Org.apache.click.page – Base Class - It contains methods and allow to handle events. - You can override in-built methods to provide custom functions. • Control Components – setEventListner () - Example :– Submit submitButton = new Submit("Submit Me", this, "onClick"); When the button is clicked, the event is dispatched to your custom Page class’s onClick() • Apache Click uses the Apache Velocity templatingengine • Templates are matched automatically with the classes that extend Page in your application using some default mapping rules Click Basics

  5. 1) Create Application • SelectNew > Other from the Eclipse menu. • FromSelect a Wizard, choose Web / Dynamic Web Project and click Next. • Type a name for Project Name (for example, MyFirstClick). • Select a Target Runtime, such as Apache Tomcat 6.0. 2) Import Click Libraries • Click File > Import. • SelectGeneral / File System from the list and click Next. • Browse to the directory in which you expanded the Apache Click files and select the distdirectory. • From the list of files, select the click-{version}.jar and click-{version}-extras.jar files (see Figure 2).  • Make sure the WebContent/WEB-INF/lib folder is selected in the Into folder Create Web Application using Eclipse and import Click Libraries

  6. Now that you have the JAR files in your WEB-INF directory, modify the Web application's web.xml file to include the ClickServlet, which is the single servlet used by Apache Click to dispatch events. Create Sample Application

  7. Now create a package into which your page classes will go (for example, com.example.myfirstclick.pages). After you create the package, create a new file called click.xml in your Web project's WEB-INF folder. Put the name of the package you just created in the click.xml file. • Now that your project is set up, you are ready to start writing classes that extend the Apache Click classes. Continued….

  8. Create the new class in the package you created by selecting File > New > Other and selecting Java / Class. Make sure to enter org.apache.click.Page as the Superclass • Create the new HTML page—called welcome.html Continued..

  9. You can deploy the application by exporting the files as a Web Archive (WAR) to the Tomcat webapps folder. • Steps to perform in Eclipse to deploy the app – - Click on the project and select File > Export. - SelectWeb / WAR file and click Next. -In the Destination field, browse to the Tomcat webapps folder. -Make sure Overwrite existing files is selected and clickFinish. Running the Sample App

  10. Very easy to learn • Component and Page Oriented design • Event base programming model • Stateless (with support for light-weight statefulcomponents) • Server-side Ajax support • Exceptional performance • Automatic form rendering and client/server side validation • Supports Velocity, JSP or FreeMarker page rendering • Supports Java 1.5 and up Conclusion

  11. https://click.apache.org/ • http://www.ibm.com/developerworks/opensource/library/wa-apacheclick/ References

  12. Thank You !!!

More Related