15. Advanced topics Flashcards

1
Q

How would you configure an action to invoke a different method than execute()?

A

When defining your action, add the method=”test” attribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How would you configure dynamic mapping to your Actions?

A

Your action name contains some wildcard, then use that in your method with {1}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How you you dynamically substritue results using the Valuestack?

A

Notice our action stores ‘nextPage’ so it’s on the Valuestack. We then fetch whatever is in nextPage for our result (notice the ${expression} syntax because it’s in XML)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can we preventr duplicate forms from being submitted?

A

Useing the token tag. Put it your form, Struts handles the rest.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Say you have a long running action, you want the user to know that it’s working and to be patient. What’s an easy built in way of doing this?

A

execAndWait, put this as the LAST filter on your stack (it stops running filters and calls the action directly)

Then it redirects user to a please wait page, and refreshes every 2 seconds. When process is complete then page will automatically return to normal!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly