concept jQuery in category java

appears as: jQuery, jQuery
Spring Roo in Action

This is an excerpt from Manning's book Spring Roo in Action.

  • Installing the jQuery UI component library, styles, and images
  • Listing 11.3. Installing the jQuery UI
    public void installjQueryUIApi() { copyDirectoryContents("js/jqueryui/*.js", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "/js"), true); copyDirectoryContents("images/*.png", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "/images"), true); copyDirectoryContents("styles/*.css", pathResolver.getFocusedIdentifier(Path.SRC_MAIN_WEBAPP, "/styles"), true); String targetDirectory = pathResolver.getFocusedIdentifier( Path.SRC_MAIN_WEBAPP, "/WEB-INF/tags/util"); String loadScriptsTagFile = targetDirectory + "/load-scripts.tagx"; InputStream loadScriptsTagFileStream = fileManager .getInputStream(loadScriptsTagFile); Document document = XmlUtils.readXml(loadScriptsTagFileStream); buildAndAddJSNode(document, "/js/jqueryui/jquery-ui-1.8.14.custom.min.js"); buildAndAddJSNode(document, "/js/jqueryui/jquery.validate.min.js"); buildAndAddJSNode(document, "/js/jqueryui/additional-methods.min.js"); buildAndAddCSSNode(document, "/styles/jquery-ui-1.8.14.custom.css"); IOUtils.closeQuietly(loadScriptsTagFileStream); fileManager.createOrUpdateTextFileIfRequired(loadScriptsTagFile, XmlUtils.nodeToString(document), false); }

    11.8.4. Copying jQuery to the web application

    It’s time to write the installjQueryApi() method, which copies jQuery to your project. Add the following method to the JqueryuiOperations class. The following listing shows your implementation.

    Portlets in Action

    This is an excerpt from Manning's book Portlets in Action.

  • js— Contains the JavaScript files used by the portlet. Portlets may also make use of JavaScript libraries like DWR, Dojo, and jQuery, which are normally packaged in a JAR file and accessed directly by the portlets. In most cases, portlets consist of multiple pages of information, and the JavaScript may be required for creating HTML widgets on the fly or using Ajax.
  • Once you have a good grip on the basics of Ajax and how it can be used to develop portlets, we’ll look at how Ajax can be used to develop rich user interfaces in the context of the Book Catalog portlet. We’ll use the Ajax support available in the Dojo, jQuery, and DWR JavaScript frameworks—the three most popular frameworks for developing applications using Ajax.

    12.8.2. Simplified Ajax with jQuery

    The jQuery JavaScript library provides support for sending Ajax requests and for processing responses. To use jQuery in your portlet, you first need to include the jQuery JavaScript library in your portal page.

    You can download jQuery from the official jQuery website (http://jquery.com/) and include the jquery.js file in the head section of your portal page, as described in chapter 3. If multiple portlets on one or more portal pages need to make use of jQuery, it’s best to add the jquery.js file as part of your portal theme.