Struts Section Index | Page 2
I have 3 buttons in JSP page(next, previous, save). How can I identify which was clicked and where should that particular identification and associated action be within a Struts application?
The correct struts approach is to use LookupDispatchAction or MappedDispatchAction, which automatically identify which button was clicked and which dispatch method in the action class to call. more
In the setter for myField of the form: this.myField = ( someParameter != null ? someParameter.trim() : null);
How can I have a data field of type "Date" in my struts form (corresponding to an entry in a jsp page)? The form class generally has getters and setters for String and Boolean, not "Date".
Create a field as Date and in the setter convert the String parameter to a Date. To quickly convert the date, use: theDate = DateFormat.getDateInstance().parse(myDateParameter); In the getter, for...more
http://strutstestcase.sourceforge.net See also this FAQ
Preventing users from accesing action. I am writing a web app to manage administrators and profiles. Administrators may access to the web app based on the profiles they have. The profiles, determi...more
indexed properties I am confused by the indexed properties of Struts. What I wanted to do is iterate through a collection of String in jsp and for each element there is a radio button with value= t...more
By default logic:iterate will increment the loop by 1. What do i need to do if i need to increment the loop by 2?
Iterate Increment Hi by default logic:iterate will increment the loop by 1. What do i need to do if i need to increment the loop by 2?
I have an application which has around 30 forms.We are using dyna action forms. I have one action which has to be called from all these 30 forms. So do I need to have to need 30 mappings in the config file for each form? How will I handle that.. Thanks for the help, Manoj.
It mainly depends on the validation needs. In practice, you do need an action-mapping each distinct validation that Struts must handle itself. Each of these action-mappings then need either a Acti...more
I have a jsp associated with an ActionForm. I want a parameter passed in the url become an hidden field of the actionForm.
I have a jsp associated with an ActionForm. I want a parameter passed in the url become an hidden field of the actionForm. ex: I call /form.jsp?para=123 the result is <form action="/betaForm....more
struts GenericDataSource Just a general question - I'm building an application that will run stand-alone, not in an application server. I need to manage some database connections. Is the struts Gen...more
Whither ActionMappings? We write applications to do things for people. We might say, for example, that we want the appication to create a mail-merge job for us. Some developers call these top-lev...more
I'm in the process of converting a webapp to using struts, am trying to use "best" practices to make sure that I keep presentation split from business, and I was wondering what all of you experts do to handle the data transition from model business logic beans to the presentation.
I'm in the process of converting a webapp to using struts, am trying to use "best" practices to make sure that I keep presentation split from business, and I was wondering what all of you experts d...more
Dynamic pages using struts Is it possible to create the elements of a page(jsp) dynamically based on the results of a data base query, when using struts framework?
How to display a confirmation dialog I am using an <html:image> tag for logout submit action. Before logout, using the onclick event, I am displaying a confirmation dialog box. I wish to dis...more
I need to populate property lists in an ActionForm from a database. For different application user, I store the userid in session attribute. The data is based on userid. How can I get the userid session attribute within the ActionForm? I know it's easy to do this in an Action class, but I would like to do it in the JSP.
The HttpServletRequest is passed to the reset method, which gives you access to the session. It's preferred to do such things in an Action, but you can access database in the reset (or validate) m...more