Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Introduction

Struts 2 Plugin for JetBrains IntelliJ IDEA provides tight and feature-rich integration to develop Struts 2 applications. Real productivity features (including refactoring support) and , smart assistance just everywhere as well as being a tool understanding the structure and framework will make you more productive instantly. No more countless wizards just generating some XML or code without much intelligence!

Info
titleNEW Screencasts @jetbrains.tv

To get a quick overview watch these screencasts to see Struts 2 support "in action"

Navigation and Autocompletion: demonstrates basic navigation and autocompletion features
Spring integration: setting up Spring integration for your Struts 2 project
(star) Validator integration: new features in IDEA 11

more to follow soon...

Section
Column
width50%
Info
titleIDEA versions

Some features may not be available in all versions.
IDEA 8+ means "IDEA 8 or any higher version"

Please see Struts2PluginChangeNotes for detailed information.

Column
width50%
Tip
titleGetting started

"Hello World" with Struts 2 and IntelliJ IDEA 8 - Detailed introductory blog post by Tabrez Iqbal

About this page

All (main) features are grouped and listed below. Please check the following table to understand the status indicators.

Symbol

Status

(minus)

planned

(plus)

in progress/mostly done

(tick)

done

(question)

future planning

Info
titleScreenshots

Starting with IntelliJ IDEA 12.1 icons have changed slightly.

Struts 2 facet

All plugin configuration settings are bundled in a dedicated facet. Simply attach a new Struts 2-facet to an existing Web-facet, create a fileset and add your struts.xml-files from all auto-scanned configuration files in your project and the plugin is ready to work.

...

IDEA 11+
A bundled dictionary providing Struts-specific words and acronyms integrates with IDEA's builtin spellchecker.

(tick) Dedicated icons

...

Struts elements

Recognize Struts related configuration files /classes or code at a glance throughout the IDE (Project/Packages View, Editor tabs, Autocompletion, ..):

struts.xml/validation.xml

...

(tick) Autocompletion

...

Please see this screencast to see it "in action" .Auto-completion (a small part only!).

Autocompletion (CTRL+Space) is available for virtually all tags and attributes, just give it a try:

(tick) Rename refactoring/Find Usages

...

Need to refactor your S2 application? No more manual search and replace - just use Rename refactoring (Shift+F6) or perform Find Usages (Alt+F7 or /Ctrl+Alt+F7):

(tick) Navigation to referenced elements

Simply Ctrl-click (or press Ctrl+B) on any element to navigate to its declaration - or take a peek without leaving the current editor using Quick Definition Lookup (Ctrl+Shift+I).

(plus) (tick) Highlighting of configuration/reference errors

...

IDEA 10+
Completion will only show resources relevant for the given (or inherited) result type.

(plus)

...

Configuration errors

Highlight common configuration errors or possible problems on-the-fly - while you're editing. Catch the bugs before time-consuming deploy & manual-test.

(tick) Structure View

Visually groups all relevant info with Autoscroll from/to source. Searching Hint: searching for something in the tree? Just start typing its name to find it.

(tick)

...

struts.xml

...

: Pageflow graph

IDEA 8+
Graph of all actions and results makes it easy to understand the structure of your application.

validation.xml

Please see this screencast to see it in action: Validator integration

(tick) Navigation to/from corresponding Action-class

IDEA 11+
Autocompletion/Navigation to Action-class properties in <field> "name"
"Navigate -> Related File" from Action-class to corresponding validation.xml file(s).

(minus) Show validation.xml node(s) under corresponding Action-class (like GUI-Designer forms)

...

Simply click on the action icon in the left editor bar to quickly open up the corresponding mapping(s) in struts.xml:
IDEA 8.1.1+: also for Groovy support added

(tick) Navigate to result

IDEA 10.5+
Use the gutter icon (or use Navigate->Related File) to directly navigate to any result(s) from your action method:

...

JSP

(tick) Navigation to Action-declaration/class

Click on the Action-class icon to quickly open the corresponding JAVA/GroovyAction-class or Ctrl+click on the "action"-attribute to go to the open its struts.xml-definition:

(tick) Autocompletion/navigation for form properties

IDEA 11+
Form properties will be autocompleted/resolved in "surrounding" Action class. Ofcourse, rename refactoring and finding usages is supported here as well .- no more manual search and replace necessary when updating your forms!

(plus) Autocompletion/navigation for other tags

...

Please see Struts 2 Plugin OGNL Support for details.

Image Added

Plugins/3rd Party Extensions

Info

Make sure to include struts-plugin.xml from corresponding plugin JAR to your Struts 2 fileset (configured in S2 facet in module settings).

(tick)

...

Spring plugin

(plugin "Spring Support" must be enabled and Spring facet configured setup properly)

Please see this screencast to see Spring integration "in action".

...

Autocompletion/navigation/usage search in annotations (WIP):

(tick)

...

Tiles 2 plugin

Blog post

(plugin "Struts 1.x" must be enabled)
IDEA 8.1.1+
struts2-tiles-plugin.jar must be present as well as Tiles libraries. Configured tiles.xml-files will be set automatically as described in http://struts.apache.org/2.x/docs/tiles-plugin.html.

...

(plugin "Velocity support" must be enabled)
IDEA 10.x+
Add all global macros (struts.vm in struts2-core.jar) automatically.
Autocomplete all global variables.
Blog post incl. with screen-shots

(plus)

...

struts2-jQuery plugin

IDEA 9+
Provides autocompletion, navigation for JSP tags.
Blog post showing off some features

...