SPRINGMVC Controller FAQs

Source: Internet
Author: User

The various operations of the controller are dependent on the server boot and then inject a lot of functionality, so hot deployment often has no effect (because it is not injected, unless the object is defined in parentheses in the method name () [For example:

HttpServletResponse response

], because that is the way to access the method when the pass injection, but even in this way are prone to the problem of no effect, so this time to restart the server can be no effect when restarting the server can

1. Do not use a modelandview as a redirect, because it is used to specify the view, if you want to redirect to the. Action end or no suffix controller, then the return String to redirect the way,

Specifies that the view is Modelandview (through Test discovery: the way the direct return String is still stuck in the controller, so you need to use response for redirection in a special scenario)

2. The Controller class must write the @Controller annotation before it is created, or the controller will not be found

SPRINGMVC Controller FAQs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.