Questions tagged [struts-action]

An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request.

Action classes act as the controller in the MVC pattern. Action classes respond to a user action, execute business logic (or call upon other classes to do that), and then return a result that tells Struts what view to render.

One of the most common responsibilities of the Action class is to process user input on a form and then make the result of the processing available to the view page. When the form is submitted, Struts will call any set methods of the Action class that match the form field names.

98 questions
3
votes
4 answers

Break ArrayList and display in Struts 1

I'm stuck with a problem of displaying an ArrayList that carries 2750 rows. The struts code to display row is :
Survivor - 2012
  • 300
  • 4
  • 19
3
votes
3 answers

Should I retrieve database record in Struts2 view layer?

I have a edit page in which I want to retrieve the subjects and levels from database and display as select option for user to edit the course. When the form is submitted, it will make a new request , the user input is captured by courseBean with…
code4j
  • 4,208
  • 5
  • 34
  • 51
3
votes
1 answer

struts tag for button call Action

Just wondering if anyone has ever seen or written a customer tag to call Struts2 Actions. What I'm looking for is something like this:-
KPS
  • 41
  • 1
  • 2
  • 3
2
votes
2 answers

how retrieve only selected checkbox values in action class in struts 1.3

i am new struts i am developing web application in which i have a requirement that i have to show records in tabular format i have made use of display tag in struts with every record i have a checkbox now i need to retrieve the values of those…
zohaib siddiqui
  • 129
  • 1
  • 6
  • 18
2
votes
1 answer

Upgrading from Struts2 2.1 to 2.5

I am trying to do a redirectAction to another class, and to invoke a specific method in that class. Basically, when the user hits an "Edit" link in a cell in a table, we get that object and put it into the Session, and then invoke the Editor…
Tom
  • 51
  • 1
  • 3
2
votes
1 answer

Problems in migrating Struts 2.3 to 2.5

I'm trying migrate from Struts 2.3 to 2.5.2 but I have two weird problems. They were good in 2.3 so maybe the problem is about Convention plugin. Let's assume I have two actions: mypackage.actions.LimitAction mypackage.actions.user.UserAction In…
2
votes
1 answer

There is no Action mapped for namespace [/] and action name [viewBooks] associated with context path [/SampleTC_test]. - [unknown location]

I know that there are several other threads with the same error, but trust me, non of them helped me in solving my issue. I have a web application built on Java using Struts2 version struts-2.3.16 and Hibernate. My issue is, in my application I have…
Ghost Rider
  • 688
  • 3
  • 17
  • 38
2
votes
2 answers

How to pass an object inside a jsp page [s:iterator] to an action class?

I have a JSP page displaying an object called docsFacebook. I need to pass this object to an action class in order to process its content. How to do it? JSP

2
votes
2 answers

Will a singleton created in struts action persist?

If I instantiate a Singleton class in a Struts action, will it be persistent for other request firing up that action ? I mean, if I'm in a Struts action code and I write: Singleton object = Singleton.getInstance(); will the object exist when…
2
votes
1 answer

Struts2 + JPA: how to correctly edit/update entity accross actions?

As the title suggests, I'm using Apache Struts2 with JPA Eclipselink on my web application. Let's say that I have a couple of edit options there, in which most of them span only a single action and a single JSP page. In that cases that the approach…
João Fernandes
  • 558
  • 3
  • 11
  • 29
2
votes
2 answers

How to use parameters, request and session objects present in ActionContext?

Here in this code I am using ActionContext to get Session and ServletActionContext from Request object. I feel this is bad practice, as one must use ActionContext only for Request object. Is ActionContext's Request object equivalent to the Request…
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101
2
votes
2 answers

Struts 2 file upload without Struts tags

Do I need to make use the Struts tags: to make use of File upload functionality that Struts 2 is providing…
Laxmikanth Samudrala
  • 2,203
  • 5
  • 28
  • 45
2
votes
1 answer

Struts 1 action forward from struts-config calling to another action from another struts-config file

I'm trying to call using action forward property in struts 1 from struts-config, and I would like to invoke another action, which it's located in another struts.config file. And obviously it doesn't work! My code is: In "struts-misExpedientes.xml"…
David
  • 23
  • 1
  • 7
2
votes
2 answers

Is it best practice to map multiple actions to the same class struts 2.3

I am developing contact manager in struts with options(add,delete,modify,print). I am thinking to map multiple actions(map multiple actions to the same class struts 2.3) to the same class(ContactManager). I want to know whether it is correct or…
Satish Kadu
  • 29
  • 1
  • 4
2
votes
3 answers

Passing variable number of parameters from form in to action in struts 2

I am using struts2 in my application and have a form in a jsp which is submitted to a action class. The number of input fields in the form can vary at runtime and hence the action class can not have fixed setter and getter for the parameters. I am…
iCrus
  • 1,210
  • 16
  • 30