background preloader

Java Development

Facebook Twitter

Quick Start Guide - Stripes - Stripes Framework. Introduction This guide is designed to get you up and running with Stripes as quickly as possible. It contains a section on configuring Stripes in a web application, and another on developing your first Stripes application. Requirements Stripes makes significant use of several features in Java 1.5 such as Annotations and Generics. It is also expected that the reader has some experience with JSP development, and understands that there exists an Expression Language, though not necessarily too much about it. Configuring Stripes Stripes is designed to require as little configuration as possible. <? Next you'll need to drop stripes.jar into your classpath, usually in your /WEB-INF/lib directory. Commons-logging.jar (1.1) - Apache Commons Logging is used to provide an implementation agnostic logging interface. cos.jar - the com.oreilly.servlets package, courtesy of Jason Hunter, is used to manage multi-part file uploads as part of form submissions My First Stripes Application The JSP The ActionBean.

Player - Crying by Roy Orbison. Vaadin Tutorial. Package com.vaadin.tutorial.addressbook; import com.vaadin.annotations.Title; import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.fieldgroup.FieldGroup; import com.vaadin.data.util.IndexedContainer; import com.vaadin.event.FieldEvents.TextChangeEvent; import com.vaadin.event.FieldEvents.TextChangeListener; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.AbstractTextField.TextChangeEventMode; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.FormLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; When you browse to your app a web page showing your UI is automatically generated.

Private void initLayout() { Spring. Struts Getting Started. Follow along with these tutorials to get started using Struts 2. The example project for each tutorial is available online at Google Code - in two different versions: one version with all artifacts using Ant to build the application and one version using Maven to manage the artifacts and build the application. Getting Started How To Create A Struts 2 Web Application Hello World Using Struts 2 Using Struts 2 Tags Coding Struts 2 Actions Processing Forms Form Validation Message Resource Files Exception Handling Debugging Struts Struts 2 Form Tags Form Validation Using XML Wildcard Method Selection Struts 2 Themes Spring and Struts 2 Struts 2 Annotations Introducing Interceptors. Spring MVC - A Bare Essentials Example Using Maven. Spring's MVC is a request based framework like Struts but it clearly separates the presentation, request handling and model layers.

In this post, I'll describe how to get the most simple of examples up and running using Maven, therefore providing a basis upon which to add more features of Spring MVC like handler mappings, complex controllers, commons validator etc.. Let's start with the pom.xml file. This will package up the project as a war file and only requires three dependencies namely the artifacts spring-webmvc, servlet-api and jstl. The spring-webmvc artifact will pull in all the other required spring jars like core, web, etc.

Note that the scope of the servlet-api is provided and therefore excluded from the war file. If deployed as part of the war, there'll be conflict with the servlet jar of the container, and there'll be an error similar to the one below when deploying to Tomcat: Next the web.xml located in the /webapp/WEB-INF folder: The ExampleController class is shown below. Green Beans: Getting Started with Spring MVC. Spring MVC, a part of the core Spring Framework, is a mature and capable action-response style web framework, with a wide range of capabilities and options aimed at handling a variety of UI-focused and non-UI-focused web tier use cases.

All this can potentially be overwhelming to the Spring MVC neophyte. I think it’s useful for this audience to show just how little work there is to get a bare Spring MVC application up and running (i.e. consider my example something akin to the world’s simplest Spring MVC application), and that’s what I’ll spend the rest of this article demonstrating. I’m assuming you are familiar with Java, Spring (basic dependency injection concepts), and the basic Servlet programming model, but do not know Spring MVC.

After reading this blog entry, readers may continue learning about Spring MVC by looking at Keith Donald’s Spring MVC 3 Showcase, or the variety of other online and print resources available that cover Spring and Spring MVC. WEB-INF/web.xml```xml <? <! <? AJAX Java Web Framework for Rapid Application Development of Enterprise Applications - OpenXava. What is servlet mapping? Servlet mapping specifies the web container of which java servlet should be invoked for a url given by client.

It maps url patterns to servlets. When there is a request from a client, servlet container decides to which application it should forward to. Then context path of url is matched for mapping servlets. How is servlet mapping defined? Servlets should be registered with servlet container. <servlet-mapping> <servlet-name>milk</servlet-name> <url-pattern>/drink/*</url-pattern> </servlet-mapping> servlet-mapping has two child tags, url-pattern and servlet-name. url-pattern specifies the type of urls for which, the servlet given in servlet-name should be called.

Syntax for servlet mapping as per servlet specification SRV.11.2: A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used for path mapping. Rule for URL path mapping: It is used in the following order. 1. What is implicit mapping? A servlet container can have a internal JSP container. What is Servlet Invoker? <! Best Java IDE to do more high-quality code in less time. Java 8 & Java EE 7 Support Straightforward User Interface Editor New Features New Tools for Android Developers Refined Gradle Integration New Tools for Database Access IntelliJ IDEA 13.1, the Java IDE with the fastest-growing mindshare, includes support for Java 8 and Java EE 7, new tools for Android development, the editor enhancements, and refined Gradle integration.

IntelliJ IDEA 13 adopts Java 8 and Java EE 7, the latest versions of Oracle's Java language and enterprise platform, along with support for new versions of enterprise application servers. The new editor comes with Sublime Text style multiple selections and also introduces Postfix code completion, a new kind of completion for Java which extends your productivity even more. IntelliJ IDEA 13.1, the Java IDE with the fastest-growing mindshare, includes enhanced support for Java EE 7, better Spring support, new tools for Android development and refined Gradle integration.