-
Notifications
You must be signed in to change notification settings - Fork 51
Home
Johannes Geppert edited this page Dec 6, 2016
·
11 revisions
A Plugin for the popular java web framework struts2 to provide ajax functionality and UI Widgets based on the jQuery javascript framework.
[News and Developer Blog] (https://www.jgeppert.com)
[Showcase] (http://struts.jgeppert.com/struts2-jquery-showcase/)
[Showcase Grid Plugin] (http://struts.jgeppert.com/struts2-jquery-grid-showcase/)
Easy AJAX Form submission and remote call with the anchor and div tag. Support for AJAX in the Tabs.
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head/>
</head>
<body>
<div id="div1">Div 1</div>
<s:url id="ajaxTest" value="/AjaxTest.action"/>
<sj:a id="link1" href="%{ajaxTest}" targets="div1">
Update Content
</sj:a>
</body>
</html>
Built in themes from jQuery
- black-tie
- blitzer
- cupertino
- dot-luv
- eggplant
- excite-bike
- flick
- hot-sneaks
- humanity
- le-frog
- mint-choc
- overcast
- pepper-grinder
- redmond
- smoothness
- start
- sunny
- swanky-purse
- trontastic
- ui-darkness
- ui-lightness
- vader
- Your custom theme create with jQuery ThemeRoller
More about themes see the Head Tag.
Use of Build in themes:
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head jqueryui="true" jquerytheme="cupertino"/>
</head>
<body>
</body>
</html>
Use of your costume theme:
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head jqueryui="true" jquerytheme="mytheme" customBasepath="template/themes"/>
</head>
<body>
</body>
</html>
- Tabbed Panel
- Datepicker
- Dialog
- Accordion
- Autocompleter
- Progressbar
- Slider
- Spinner
- Menu
- MenuItem
- Chart
- Grid
- Tree
- Button
- Buttonset
- Richtext Editor
- UI interactions
- Resizable for Divs
- Drag and Drop for Divs
- Selectable for Divs
- Sortable for Divs
- Download the struts2-jquery-plugin-x.x.x.jar
- Put it into your Classpath (WEB-INF/lib)
- Add the Tag-Lib to your JSP
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
- Place the HeadTag inside your html head tags
Since version 1.8.3 the plugin is found in the central Maven repository. Just add to your dependencies section:
<dependencies>
...
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-plugin</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-grid-plugin</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-datatables-plugin</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-richtext-plugin</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-tree-plugin</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-mobile-plugin</artifactId>
<version>4.0.1</version>
</dependency>
...
</dependencies>
To access SNAPSHOT builds, you need to declare the snapshot repository lookup in your pom.xml:
...
<repositories>
...
<repository>
<id>sonatype.oss.snapshots</id>
<name>Sonatype OSS Snapshot Repository</name>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<releases>false</releases>
<snapshots>true</snapshots>
</repository>
</repositories>
...
- Home
- Ajax
- UI widgets
- UI interactions
- Resizable for Divs
- Drag and Drop for Divs
- Selectable for Divs
- Sortable for Divs
- Form Elements
- Tasks