Questions tagged [struts2-convention-plugin]

The Struts 2 Convention Plugin provides Struts 2 with convention-based actions and views, allowing zero-config Struts 2 applications, while providing customization at multiple levels.

The Struts 2 Convention Plugin provides Struts 2 with convention-based actions and views, allowing zero-config Struts 2 applications, while providing customization at multiple levels.

Features include:

  • Action location by package naming conventions
  • Result (JSP, FreeMarker, etc) location by naming conventions
  • Class name to URL naming convention
  • Package name to namespace convention
  • SEO compliant URLs (i.e. my-action rather than MyAction)
  • Action name overrides using annotations
  • Interceptor overrides using annotations
  • Namespace overrides using annotations
  • XWork package overrides using annotations
  • Default action and result handling (i.e. /products will try com.example.actions.Products as well as com.example.actions.products.Index)

This plugin can provide additional configuration based on convention. It also uses annotations to replace or override the configuration settings made by this plugin. All annotations that could be used in the code you can find under the package org.apache.struts2.convention.annotation.

80 questions
1
vote
1 answer

Manage struts actions (which configured by convention plugin) with spring

We are using Struts 2 + Spring 4 and we want to setup the spring to manage our struts 2 actions. The spring beans are defined by annotations. The struts actions are located with convention plugin, so we do not have any actions in the struts.xml…
1
vote
1 answer

Struts 2 with annotations error: Unable to locate parent package

I am trying to use tiles along with Struts 2. I am using annotations on action classes as shown below. I have defined a default parent package using the Convention Plugin and also defined the package rcg.console which extends from struts-default and…
1
vote
1 answer

How to validate Boolean fields in Struts2 using annotations?

Given a Boolean field in an action class like so. @Namespace("/admin_side") @ResultPath("/WEB-INF/content") @ParentPackage(value="struts-default") public final class TestAction extends ActionSupport implements Serializable, ValidationAware,…
Tiny
  • 27,221
  • 105
  • 339
  • 599
1
vote
2 answers

How to invoke a method on submit button in Struts 2 using convention plugin?

In the following piece of code about Struts action class, @Namespace("/admin_side") @ResultPath("/WEB-INF/content") // Default. public final class TestAction extends ActionSupport implements Serializable { private static final long…
Tiny
  • 27,221
  • 105
  • 339
  • 599
1
vote
1 answer

Struts2 Annotaion Based Action configuration

What is the cause of this exception, whats wrong with it? Thanks in Advance. WARNING: No configuration found for the specified action: 'ActionAnnotation' in namespace: '/'. Form action defaulting to 'action' attribute's literal value. HTML: …
sunleo
  • 10,589
  • 35
  • 116
  • 196
1
vote
1 answer

Unable to Submit form In struts 2 when using validations

I have been facing a problem for past few hours, that whenever I use validations in my application I get empty values on server-side. My action file seems like this: @ParentPackage("interceptions") @InterceptorRefs({ …
1
vote
1 answer

struts2-convention and struts2-config-browser-plugin cannot work if i change struts.xml path

I use struts2-convention-plugin and struts2-config-browser-plugin in struts2, if i change the default struts.xml path in web.xml: struts2
1
vote
1 answer

Struts 2 error - com.opensymphony.xwork2.util.logging.commons.CommonsLogger error

I'm trying to run Struts2 sample application.While starting the server I'm getting below error and code which using from here. I implemented same code same jars over here. struts2-convention-plugin-2.3.1.2.jar, asm.jar, antlr-2.7.6.jar, …
1
vote
2 answers

Struts 2 convention plugin - upload a file of more than 2 MB

If i try to upload a file of more than 2 MB size its error-ed. I found in apache web site saying "There are two separate file size limits. First is struts.multipart.maxSize which comes from the Struts 2 default.properties file. This setting exists…
user2371505
  • 97
  • 1
  • 2
  • 10
1
vote
1 answer

Struts2 not worked with annotated action

I just start to learn some Struts2 and try to create simple web page. I made a Action class, add some annotation, them I made some JSP and set filter in web.xml file, but when I try to get page I just see work of JSP not any…
Andrew
  • 266
  • 6
  • 18
1
vote
1 answer

How to change the default mapping rules of struts-rest-pulgin

I'm using struts2 + convention + rest to build my Web project. There are many jsp files in the content folder. So I want to classify them by folders. For example, I want to put user.jsp, user-list.jsp and user-edit.jsp in \content\user folder. And I…
Kirin Yao
  • 1,606
  • 2
  • 14
  • 21
1
vote
3 answers

Struts 2 annotation issues in action

I have used Struts2 Annotation My web.xml is: index.jsp struts2
Rohit R.K.
  • 309
  • 1
  • 4
  • 14
1
vote
1 answer

Removing convention.annotation - replace with config in struts.xml

I'm having an issue removing the @Action and @Result Convention plugin annotations from an action and replacing them with the equivalent config in struts.xml. package com.microed.cars.web; import…
Ken Alton
  • 686
  • 1
  • 9
  • 21
1
vote
2 answers

Struts 2 Convention Plugin Define Multiple Parent Packages

I'm working on Struts 2 web application, using the Convention Plugin to configure everything via annotations. I'm hitting a snag with some of my action classes, where I'd like to use multiple parent packages. I did find a means of doing it on…
Curtis Snowden
  • 407
  • 1
  • 4
  • 20
0
votes
1 answer

Struts 2 post back default

In the Struts documentation, it says: Another common workflow stategy is to first render a page using an alternate method, like input and then have it submit back to the default execute…
user13254659