Programming Tutorials

Struts Tutorials

11. FAQ: Why are my checkboxes not being set from ON to OFF?

By: Apache Foundation : 2008-09-20

Description: A problem with a checkbox is that the browser will only include it in the request when it is checked. If it is not checked, the HTML specification suggests that it not be sent (i.e. omitted from the request). If the value of the checkbox is being persisted, either in a session bean or in the model, a checked box can never unchecked by a HTML form -- because the form can never send a signal to uncheck the box. The application must somehow ascertain that since the element was not sent that the corresponding value is unchecked.


12. FAQ: Why was reload removed from Struts (since 1.1)?

By: Apache Foundation : 2008-09-20

Description: The problem with ReloadAction was that Struts was trying to act like a container, but it couldn't do a proper job of it. For example, you can't reload classes that have been modified, or (portably) add new classes to a running web application (even if the container supported it).


13. What is a Plug-in and how to use Java plug-ins with Struts?

By: Emiley J. : 2008-09-17

Description: Any Java class that you want to initialize when Struts application starts up and destroy when the application shuts down is a Java Plug-in. You can create a Java Plug-in by creating a Java class that implements org.apache.struts.action.Plugin interface.


14. 7 Best Practices of Struts

By: Emiley J. : 2008-08-13

Description: This tutorial lists 7 Best practices of Struts.


15. Origin and Architecture of Struts

By: Fanny Ong : 2007-10-12

Description: Craig McClanahan originally wrote the Struts framework, mostly while on his Memorial Day vacation in 2000! The framework was subsequently donated by Craig to the Apache Software Foundation. The fact that it was mostly written in one weekend should suggest to you that it's a very simple framework.


16. XDoclet struts-config.xml in Struts

By: Kamini : 2007-10-01

Description: XDoclet based management of struts-config.xml is a entirely different concept. In XDoclet approach, there is no struts-config.xml at all! In the XDoclet approach, there is no struts-config.xml at all! All the requisite information linked to the and are specified in the Action and Form


17. Struts-GUI and Struts Console

By: Lakshmi : 2007-10-01

Description: When the development begins, the struts-config.xml is always small and manageable. But as time passes and features are added, the file continues to grow to become a monster. Splitting the application into modules definitely helps, but modules can be relatively large too. There are better ways to mange the strutsconfig.xml than simply editing by hand or even an XML editor. Some of the


18. Protecting JSPs from direct access in Struts

By: Emiley J : 2007-10-01

Description: According to the Model 2 paradigm, the view is always served by the controller and should not be requested explicitly from any other view. In reality a JSP can always navigate to another JSP when the JSPs are placed anywhere in a WAR other than the WEB-INF directory (or its sub-directories). Similarly a user can type in the name of the JSP in the URL bar and invoke the JSP. The web application specification does not disallow such access. Actually this makes sense. The specification should not prevent anybody from coding using the Model 1 paradigm. Consequently your JSPs are exposed to the external world for nosy users to cause unnecessary problems, for hackers to exploit any vulnerability in the system. If you are wondering what the problem is with allowing direct access to JSPs, well, here are some.


19. ForwardAction in Struts

By: Daniel Malcolm : 2007-10-01

Description: ForwardAction is the one of the most frequently used built-in Action classes. The primary reason behind this is that ForwardAction allows you to adhere to MVC paradigm when designing JSP navigation. Most of the times you will perform some processing when you navigate from one page to another. In Struts, this processing is encapsulated in the Action instances. There are times however when all you want to do is navigate from one page to another without performing any processing. You would be tempted to add a hyperlink on the first page for direct navigation to the second. Watch out! In Model 2 paradigm, a straight JSP invocation from another JSP is discouraged, although not prohibited. For instance, suppose you want to go from PageA.jsp to PageB.jsp in your Struts application. The easy way of achieving this is to add a hyperlink in PageA.jsp as follows:


20. Handling multiple buttons in HTML Form in Struts

By: Charles : 2007-10-01

Description: You will frequently face situations where there are more than one or two buttons submitting the form. You would want to execute different code based on the buttons clicked. If you are thinking, "No problem. I will have different ActionMapping (and hence different Actions) for different buttons", you are out of luck! Clicking any of the buttons in a HTML Form always submits the same Form, with the same URL. The Form submission URL is found in the action attribute of the form tag as: