Questions tagged [interceptorstack]

A bundle of interceptors invoked on an action in the order specified in the configuration.

A bundle of interceptors invoked on an action in the order specified in the configuration. Most web applications needed to apply the same set of Interceptors over and over again. Rather than reiterate the same list of interceptors, it's possible to bundle these interceptors together using an Interceptor Stack.

The default interceptor stacks are configured in the struts-default.xml. The interceptor stack should be applied on each action invocation, by default the defaultStack is applied which include a rich set of interceptors needed by the most applications. But it could be customized on the project level or by the plug-ins in their own configuration files. The interceptor stack is composed by referencing other interceptors or interceptor stacks. The interceptors in the stack are invoked in the order as followed in the configuration for the interceptor stack. The interceptor stack could be referenced by the action configuration elements to define it's own interceptor stack and override the default stack.

76 questions
7
votes
2 answers

how to use interceptor defined in different packages in struts 2?

I have defined an interceptor as follows:
ipkiss
  • 13,311
  • 33
  • 88
  • 123
7
votes
4 answers

Struts 2 File Upload Interceptor configuration problems

I'm having two problems when trying to configure the Struts 2 File Upload Interceptor in my application. I want to change the parameter maximumSize (the default value is 2 MB, I need it to be 5 MB) and the message resource…
6
votes
2 answers

Unexpected Exception caught setting 'xxx' on 'class xxx: Error setting expression 'xxx' with value ['x', ]

I'm passing some parameters to an action class implementing ModelDriven through a query-string.
Tiny
  • 27,221
  • 105
  • 339
  • 599
5
votes
2 answers

Getting Interceptor Parameters in Struts 2

I have following action mapping ... one two ... nth-number ... I can get parameter map using following…
Bilal Mirza
  • 2,576
  • 4
  • 30
  • 57
4
votes
1 answer

Struts 2: excluding method from validation from just the defaultStack interceptor

I want to be able to disable form validation for one action in Struts 2, but have the rest of the interceptor stack still be able to run. I have an interceptor that checks to see if the user is logged in, which I always want execute, but for some…
Jengerer
  • 1,163
  • 11
  • 27
4
votes
2 answers

Delete interceptor from stack in Struts2

In struts.xml, I have included tokenSession interceptor to my interceptor-stack to validate token for each request. Unfortunately, the same isn't working well for AJAX requests. I got invalid.token response when it executes…
4
votes
2 answers

Changing parameters after bind in Struts 2

I have an action that receives some parameters from user (e.g. date). This action produces many different reports, so it has many different methods. I need to tune those parameters (set a time to midnight) before every method. The prepare method is…
piotrek
  • 13,982
  • 13
  • 79
  • 165
3
votes
1 answer

why my custom interceptor does not work

I define a custom interceptor used to log time, but it doesn't work. here is my custom interceptor code: public class TimeConsumedInterceptor extends AbstractInterceptor { /* * {@inheritDoc} */ @Override public String intercept(ActionInvocation…
hiway
  • 3,906
  • 10
  • 34
  • 57
3
votes
2 answers

Struts 2 interceptor redirect JSP page

Using Struts 2, I have this interceptor: public class AccessInterceptor extends AbstractInterceptor { @Override public String intercept(ActionInvocation ai) throws Exception { ActionContext actionContext = ai.getInvocationContext(); …
Petr
  • 1,159
  • 10
  • 20
3
votes
1 answer

Struts2 parameters is coming null in action class when using Interceptors

When I am using Interceptors, the values on Action class coming as null. I have removed the Interceptors, the values coming perfect from the JSP page. Login.jsp
SANSSAN
  • 91
  • 1
  • 5
2
votes
1 answer

Skipping default interceptor stack only on specific class

Hi We have created a customized interceptor stack called appInterceptorStack and referred it as a , appInterceptorStack -> dont have validation and workflow interceptors attached to them. But now…
Rengasami Ramanujam
  • 1,858
  • 4
  • 19
  • 29
2
votes
2 answers

Problems catching the root with interceptor in struts2

I have an intercetpor that checks if the user is logged in before serving the requested action. I have tried setting this as default for all action. For all addresses except one this works like a charm. When I go to my root URL…
Skadlig
  • 1,569
  • 1
  • 14
  • 16
2
votes
1 answer

struts2 default interceptor stack configuration

I want to configure a parameter for the exception interceptor to log exceptions. So I created a package in struts.xml and copied the default-stack from struts-default.xml. However it doesn't log exceptions and seems to still use the…
user1
  • 21
  • 1
  • 2
2
votes
2 answers

Struts 2 how to run a validation before every action

In a Struts 2 application, I want to run a logic before all project actions. The logic will generate a field error or let the action continue. I tried to develop an interceptor for this case. But here is my problem: In a validator we call…
Alireza Fattahi
  • 42,517
  • 14
  • 123
  • 173
2
votes
1 answer

How to exclude One action from default interceptor in Struts 2

I want to exclude login action from my default interceptor without putting it a diffrent package the action that i want to exclude is Login Action
1
2 3 4 5 6