Welcome to the feature description/userguide.
NOTE Some features may be available only in yet unreleased versions, please see Struts2PluginChangeNotes for more information.
"Go To Action/Package" by name
Press Ctrl+Shift+Alt+N to quickly navigate to any Action/Package by simply entering its name (including wildcards):
Dedicated icons for configuration files
Dedicated icons for JAVA files (Actions)
Recognize Struts related files/classes at a glance throughout the IDE (Project/Packages View, Editor tabs, ..):
Struts 2 Plugin for JetBrains IntelliJ IDEA provides tight and feature-rich integration to develop Struts 2 applications. Real productivity features (including refactoring support), 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!
To get a quick overview watch these screencasts to see Struts 2 support "in action"
Navigation and Autocompletion: demonstrates basic navigation and autocompletion features
more to follow soon...
About this page
All (main) features are grouped and listed below. Please check the following table to understand the status indicators.
in progress/mostly done
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 any an existing moduleWeb-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.
Dedicated facet with configuration options
File Set manager
Group and manage your
struts.xml-files with an easy to use editor, providing maximum flexibility w/r to your project setup.
Detect struts.xml files not mapped to file sets
Spot setup errors easily, additionally providing a quickfix to add the unmapped
struts.xml-files to any existing fileset.
Creates IDEA project/module-library and - if required - downloads all necessary JAR files required for Struts 2.
Library validator/setup for standard plugins (Spring, Tiles, JSF, ..)
Autodetection of Struts 2 facets
struts.xml-files are recognized upon opening your project and a new S2 facet is will be created automatically.
Integration with "New Project"
Add a blank ready-to-start Struts 2 application template by selecting Struts 2 from the list of available technologies. A S2-facet with default fileset and an empty
struts.xml-file already mapped in
web.xml will be created automatically, all necessary libraries will be setup as well.
"Go To Action/Package" by name
Ctrl+Shift+Alt+N (Go To -> Symbol) to quickly navigate to any Action/Package by simply entering its name (including wildcards):
"Navigate -> Related File"
Tip: just start typing to narrow down the result list of related items and press ENTER to navigate.
Use this shortcut to quickly navigate from any web-resource used in
<result> to its
<action>-declaration and/or Action-method.
Also vice versa from Action-class to
<action>-declaration and any referenced result(s) files.
Navigate from Action-class to all corresponding
Autocompletion for all possible elements
A bundled dictionary providing Struts-specific words and acronyms integrates with IDEA's builtin spellchecker.
Dedicated icons Struts elements
Recognize Struts related configuration files or code at a glance throughout the IDE (Project/Packages View, Editor tabs, Autocompletion, …):
Please see this screencast to see it "in action" (a small part only!).
CTRL+Space) is available for virtually all tags and attributes, just give it a try:
Rename refactoring/Find Usages
Need to refactor your S2 application? Just use the No more manual search and replace - just use Rename refactoring (
Shift+F6) or perform Find Usages (
Alt+F7 or /
Navigation to referenced elements
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 (
Highlighting of configuration/reference errors
Errors are highlighted immediately in the editor, additional validation is triggered for Make Project (.
IDEA 7: see "Validation" tab in S2 facet for more options).
IDEA 8+: see Settings->Compiler->Validation
Various quickfixes to create missing elements etc.
struts.xml: restrict resolving to
<result> value depending on result-type (e.g. Tiles, Velocity)
Various inspections for common configuration errorsIDEA 10+
Completion will only show resources relevant for the given (or inherited) result type.
Highlight common configuration errors or possible problems on-the-fly - while you're editing. Catch the bugs before time-consuming deploy & manual-test.
Visually groups all relevant info with Autoscroll from/to source you're used from IDEA:
. Hint: searching for something in the tree? Just start typing its name to find it.
struts.xml: Pageflow graph
Graph of all actions and results makes it easy to understand the structure of your application.
Please see this screencast to see it in action: Validator integration
Navigation to/from corresponding Action-class
Autocompletion/Navigation to Action-class properties in
"Navigate -> Related File" from Action-class to corresponding
Show validation.xml node(s) under corresponding Action-class (like GUI-Designer forms)
validation.xml-template from Action
Intention to create new
ActionClassName-validation.xml from file template.
.properties-based I18N for
<message> "key" (can be disabled in S2 facet, tab "Features").
Navigation to Action-declaration in struts.xml
Simply click on the action icon in the left editor bar to quickly open up the corresponding entrymapping(iess) in your
Highlight unused Actions, Quickfixes: Delete, Map in struts.xml
Autocompletion/navigation to result-declaration in struts.xml
IDEA 8.1.1+: Groovy support added
Navigate to result
Use the gutter icon (or use Navigate->Related File) to directly navigate to any result(s) from your action method:
Navigation to Action-declaration/class
Click on the Action-class icon to quickly open the corresponding JAVAAction-code class or Ctrl+click on the "action"-attribute to go to the open its
Image Removed Image Added
Autocompletion/navigation for form properties
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!
Autocompletion is available for (almost) all attributes with static values.
(IDEA 8+: plugin "CSS Support" must be enabled)
Define inline-styles ("
cssStyle") or reference existing CSS classes ("cssClass"
.properties-based I18N for
<s:text> (can be disabled in S2 facet, tab "Features").
Basic syntax highlighting support
Full support for OGNL expressions including resolving of available properties
Integration with Tiles 2 (via Tiles 2 plugin)
Support for sitemesh.xml
(Object Graph Navigation Library) Support
Provides editing, highlighting and autocompletion support for OGNL expressions - not just for Struts 2 applications.
Please see Struts 2 Plugin OGNL Support for details.
Plugins/3rd Party Extensions
Make sure to include
(plugin "Spring Support" must be enabled and Spring facet setup properly)
Please see this screencast to see Spring integration "in action".
Reference Spring beans where supported (e.g. in
Autocompletion/navigation/usage search in annotations (WIP):
Tiles 2 plugin
(plugin "Struts 1.x" must be enabled)
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 "FreeMarker support" must be enabled)
All supported S2 taglibs are automatically available:
Global variables as well as properties provided from corresponding Action-class will be resolved:
(plugin "Velocity support" must be enabled)
Add all global macros (
struts.vm in struts2-core.jar) automatically.
Autocomplete all global variables.
Blog post with screen-shots
Provides autocompletion, navigation for JSP tags.
Blog post showing off some features