Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "{ Apache - Click By, By, Anupam Mundale. Anupam Mundale. Viraj Kulkarni. Viraj Kulkarni."— Presentation transcript:

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

2 JEE Web Application Framework JEE Web Application Framework Method to build Web Applications without MVC and JSP’s. Method to build Web Applications without MVC and JSP’s. Java Language support Java Language support Uses HTML templates and POJO’s. Uses HTML templates and POJO’s. Apache Velocity Engine to support HTML templates Apache Velocity Engine to support HTML templates Built on Java servlet API Built on Java servlet API Open source Project (Apache license 2.0) Open source Project (Apache license 2.0) Simple, easy to use, good performance and scalability Simple, easy to use, good performance and scalability Competing Frameworks – JSF, Tapestry, WebObjects and Apache Wicket 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 is an eclipse plugin for developing Click Web Applications. Click IDE Dependency – Eclipse 3.5.x and WTP 3.1.x 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 Org.apache.click.page – Base Class - It contains methods and allow to handle events. - It contains methods and allow to handle events. - You can override in-built methods to provide custom - You can override in-built methods to provide custom functions. functions. Control Components – setEventListner () Control Components – setEventListner () - Example :– - Example :– Submit submitButton = new Submit("Submit Me", this, "onClick"); 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 templating engine Page Templates are matched automatically with the classes that extend Page in your application using some default mapping rules Click Basics

5 1) Create Application Select New > Other from the Eclipse menu. From Select 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. Select General / File System from the list and click Next. Browse to the directory in which you expanded the Apache Click files and select the dist directory. 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 ClickServlet 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 com.example.myfirstclick.pages 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 org.apache.click.Page 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. - Select Web / WAR file and click Next. -In the Destination field, browse to the Tomcat webapps folder. -Make sure Overwrite existing files is selected and click Finish. Running the Sample App

10 Very easy to learn Component and Page Oriented design Event base programming model Stateless (with support for light-weight stateful components) 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/ https://click.apache.org/ https://click.apache.org/ http://www.ibm.com/developerworks/opensource/library/w a-apacheclick/ http://www.ibm.com/developerworks/opensource/library/w a-apacheclick/ http://www.ibm.com/developerworks/opensource/library/w a-apacheclick/ http://www.ibm.com/developerworks/opensource/library/w a-apacheclick/References

12 Thank You !!!


Download ppt "{ Apache - Click By, By, Anupam Mundale. Anupam Mundale. Viraj Kulkarni. Viraj Kulkarni."

Similar presentations


Ads by Google