I need to load some data from a table to show in a JSP page.
Then, when the user pushes on a button, they'll send the form to save in a database.
I wonder if I can create a method to load the
You can create a method in action class call it whatever you want and map this method to the action. This method should return a JSP page as a result. All you have configure in the same file.
prepare is extremely useful when you need to return a result without action execution, like an input result when validation fails.
In Struts2 every request that is mapped by the filter is an action and it has an action context. A request has two methods that most popular
POST. You create two separate actions for GET and POST request. This is actually needed to follow PRG pattern.