What will happen if action class returns the null in struts?
If it displays null jsp page,then if you want to diplay something how can we achieve it?
What will happen if action class returns the null in struts?
If it displays null jsp page,then if you want to diplay something how can we achieve it?
If the Action returns null, no further processing/forwarding will be done, and the response so far will be sent to the client.
Useful if you just want to send error responses, or create the output directly in the Action instead of forwarding to a view (which of course you are discouraged to do).
If you want to display something, don't return null.
If the Struts code is somehow beyond your control (but why would that happen, even if you don't want to touch the source you could subclass for example), I guess you could install a ServletFilter to inject some additional post-processing.
I think one can take advantage of making AJAX calls to the server and populating data in client browser without reloading the page.
© 2022 - 2024 — McMap. All rights reserved.