Use of Container Control, Use of hbox and vbox layout manager, ajaxaction frontend and background event response, and browser debug

Source: Internet
Author: User

1. Because of the frontend and backend interaction function, you need to register a bean for service provision in the spring context. For this bean, use the @ component annotation provided by spring. If
To use the @ component annotation, add a configuration in the project's webcontent-> WEB-INF-> Dorado-home directory's app-context.xml file, as shown in
Below:
<Context: component-scan base-package = "com. bstek. Dorado. sample"/>

2. container is a container control. As a container control, we can add multiple sub-controls internally. The layout relationship between controls is determined by the layout feature of the iner.
.

3. the value set in the service attribute of the ajaxaaction control is called a service locating expression. In dorado7, a service locating expression is used to describe the service searching method,
That is, dorado7 finds a specific service through a service positioning expression, so that it can call the service.

The [email protected] Mark is a specific annotation provided by dorado7 to define the exposed service. According to this rule, dorado7 will automatically register this method in
In exposedservicemanager, the service name is systeminfoservice and the service expression is
Systeminfoservice # getsysteminfo. The service name is the ID of the bean registered by systeminfoservice. Java in beanfactory. The annotation mechanism will
Automatically converts Ajax s to lowercase letters.

5. There are two ways to debug JS scripts in projects:
Alert debugging method
First, alert is the most primitive and simplest to use. Add the alert function to the output of the required variables on the page to display the variables:
Alert is simple, but debugging is cumbersome. If too many variables need to be monitored, a large number of pop-up boxes will pop up, and the user experience is quite poor. Currently, alert debugging is not recommended.
.
Browser debugging tool Method
The second is to use browser debugging tools. Chrome, ie, and Firefox both come with browser debugging tools, especially Firefox and debugging plug-in firebug. The following uses the Chrome browser
As an example.
Open the Chrome browser and enter: http: // localhost: 8080/standardlesson/COM. bstek. Dorado. sample. standardlesson. Junior. System
. Systeminfo. d
After the page is loaded, use the [F12] shortcut to open the chrome debugging tool,
Switch to the sources page, place a breakpoint with the left mouse button on line 1, and click the get system information button on the page. The page is paused at the breakpoint.
You can choose to use the shortcut key [F8] to continue JavaScript code execution or jump to the next breakpoint, or you can use the shortcut key [F10] to skip the method and expression in the statement,
The shortcut key F11 is one-statement-by-statement debugging, that is, one-step debugging. The method and expression are jumped into for statement-by-statement tracing debugging. You can also use buttons in addition to the shortcut keys.
Click [F10] to execute the next JS Code. Double-click info and hover it over for a moment. The variables in info are displayed.
We can see that res contains three variables. If you need to add monitoring, right-click and choose add to watch from the pop-up menu to add monitoring.
In the watch expressions monitoring area on the right, you can monitor the variables in Res:
This debugging method is powerful and convenient, but you need to be familiar with the source code output from the view to the page. After all, it takes some time to find the specific JS and break the breakpoint.
(Strongly recommended) debugger keyword debugging method
Next we will introduce you to a debugging method that is convenient and convenient. You do not need to find the JS to be debugged on The View output page. This is also the debugging method we strongly recommend.
Add the debugger keyword to the JS to be debugged.
Open the chrome page to load the page and use the [F12] shortcut key to open the debugging tool, click the [get system information] button on the page, we found that the breakpoint automatically stops at the debugger
Key field:
The next debugging is the same as method 2. We find that the advantage of this method is that you do not need to break points on the page, and it is more convenient and convenient.

6. knowledge points in this section mainly include the use of the Container Control, the use of the hbox and vbox layout manager, and the ajaxaction frontend and backend event response.

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.