Struts Section Index | Page 3
As default, I18N Struts-applications are managed by the language in the browser. I would like it to be based on a language-code in the users login and thus I need to set the locale/language designation that controls Struts. .
As far as I know, by default, Struts applications are governed by the default locale of the container/JVM hosting the application. (The last thing Struts is going to do is trust what some whacky b...more
The problem I am noticing is that when the second action is being invoked, the form is being 'repopulated' with the initial form values that the form had when it was passed to the first action.
This is an excellent example of what we mean when we talk about "Action chaining", or, as I like to call it, the "dark side of Struts". There is a very fine design pattern called "Chain of Respon...more
I would like to isolate the business logic to a bean class and use the scaffold ProcessAction class ala the Artimus app in Struts in Action. Since the bean class has all the business logic, how do I communicate errors?
Excellent question! The Scaffold solution is to use a ProcessResult object that encapsulates the typical things that the Model might want to send back to the Controller/View. So far, it can transf...more
If you are using EJBs for the business logic layer, then yes, it's perfectly all right to bind your Actions to the EJB interfaces. Though, some people do prefer to use EJBs as a persistence laye...more
Do all the ActionMappings share one action instance? What happens when I have a custom Action that uses property setters from the struts-config.xml to set properties during use of that action.
Yes, all the ActionMappings share one Action instance. But, you wouldn't be setting the properties of the Action object here but the *ActionMapping* bean. To get to your custom properties, you wou...more
Is there a way to lock a form if the form is in use? The intention is to avoid two users submitting the same form.
Your options here are the same as with any enterprise application. Pessimistic locking, and Optimistic locking For a pessimistic lock, you need some flag on the record that says someone has ch...more
I have a button on my form that's suppose to submit the form. The script works on other forms, but not when I use it with Struts. Why would this be?
By default, the <html:submit> button is also named (surprise) Submit. To avoid conflicts, give the Submit button another name. <html:submit property="submitButton:/> HTH, Ted. -...more
A "switch case" tag - Maybe Tedd knows??? Hi, Is there some sort of "switch case" tag existing? My point is that I want to avoid to use plenty of: <logic:equal name="theBean" parameter="thePar...more
I use the tag IMG to display images on my site - It however looks like I am limited in what I attempt to do because this tag can only access images that are located within the application directory.
IMG tag Hello, I use the tag IMG to display images on my site - It however looks like I am limited in what I attempt to do because this tag can only access images that are located within the appli...more
How to open a new browser window with new new page from action class. Very Very urgent Hi: I am using struts and tiles framwork for my application. I have a confirmation page where i am submitting...more
Enterprise JavaBeans (EJBs) are designed to represent the model layer of an application. Developers often choose EJBs when building applications that will be distributed over several...more
Many Struts applications can get by with a simple <html:error/> tag at the top of a page. If any error messages are present, it's this tag's job to print them all out. To hel...more
Each radio button element requires an assigned value that distinguishes it from the other radio buttons. When creating a static array of radio buttons, you need to indicate which one...more
testing a struts application i wan't to test a struts-application can somebody tell me whats the best way to do this? i'm thankfull for any solution
Many Java mavens recommend that business objects throw their own exceptions. Internally, a component may catching a SQL or IO exception, but what we really need to tell the user is t...more