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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.