JAVA Web Engineering relies on engineering issues __java in Eclipse

Source: Internet
Author: User
Tags java web
Java Web Engineering relies on engineering issues in Eclipse
Web Engineering has references to classes in other Java projects, and the Java classes in dependent engineering are not found when Tomcat is running.
1. Confirm that the Web worker has the correct import dependency engineering, as follows:
Web Guide Right---Select Properties, find Java build Path, select the second tab "Projects", click the "Add ..." button, pop-up "Required Project Selection" box, It will appear in this workspace in addition to the current project other than the project, the selected dependent engineering is OK.
2.WEB Right Key---Select Properties, find Deloyment assmbly, right click Add Tick "Projects" can see other works, at this time to select dependent Works ( That is, it will be OK to automatically generate dependent engineering jars in the Web-inf lib directory of Web Engineering in the Tomcat environment.
one of the JavaScript Browser Objects window objects
Window objects represent open windows in the browser; The Document object represents the Documents object in the browser that loads the page; The Location object contains the current URL information of the browser; The navigation object contains the information of the browser itself;     The Screen object contains information about the client screens and rendering capabilities, and the history object contains historical information about the browser's access to the Web page. In addition to the Window object, the other 5 objects are properties of the Window object, and their relationships are as follows:

One, Window object

The Window object is the global object of JavaScript, so the properties and methods of using the Window object do not need to be specified specifically. For example, alert, in fact, the complete call is Window.alert, and usually omits a reference to the Window object.

1. Properties, methods, and events for Windows objects

Properties of Window objects
Property name Role Demo
Name Specify the name of the window
Parent The parent window of the current window (frame) that uses it to return the object's methods and properties
Opener Returns the Window object that produces the current window, using it to return the object's methods and properties
Top Represents the main window, is the topmost window, and is the parent window for all other windows. The methods and properties of the current window can be accessed through this object
Self Returns an object in the current window through which to access the methods and properties of the current window
Defaultstatus Returns or sets the default content that will be displayed in the browser status bar
Status Returns or sets the specified content that will be displayed in the browser status bar

Method of Window Object
Method Name function Demo
Alert () Displays a warning dialog box that contains a message and a confirmation button
Confirm () Display a confirmation dialog box
Prompt () Displays a prompt dialog box that prompts the user to enter data
Open () Open a window that already exists, or create a new window and load a document in that window
Close () Close an open window
Navigate () Displays the specified page in the current window
SetTimeout () Set a timer to call a function after a specified interval
Cleartimeout () Resets the specified timer
Focus () To get the current focus on a Window object
Blur () Causes a Window object to lose the current focus

Window object Events
Events Description Demo
OnLoad Occurs when an HTML file is loaded into the browser
OnUnload Occurs when an HTML file is deleted from the browser
onfocus Occurs when the window receives focus
Onblur Occurs when the window loses focus
OnHelp Occurs when the user presses the F1 key
OnResize Occurs when the user adjusts the window size
Onscroll Occurs when the user scrolls the window
OnError Occurs when an error occurred loading an HTML file

2. Window objects provide the main features:

Adjust the size and position of the window, open a new window, the System prompt box, status bar control, timed operation, the following 5 features in detail.

(1)   Resize and position the window              

Method

Usage

Description

Window.moveby

Moves the browser window to the specified location (relative positioning)

Window.moveby (Dx,dy)

For security and good user considerations, JavaScript scripts are not allowed to move windows beyond the viewable area, and the browser window must always be visible on the screen.

Window.moveto

Move the browser window to the specified location

(absolute positioning)

Window.moveby (X,y)

If you specify a coordinate (x,y) that places some or all of the windows outside the viewable area, the window stays closest to the edge of the screen.

Window.resizeby

Changes the size of the browser window to the specified width and height (relative resizing of the window)

Window.resizeby (DW,DH)

Window.resizeto

Change the size of the browser window to the specified width and height (absolute resize window)

Window.resizeto (W,H)

The width and height specified cannot be negative

(2) Open a new window

Usage: window.open ([url],[target],[options])

Parameter URL: Opens the URL that the new window will load. If no parameters are specified, blank pages are loaded by default. such as: window.open ("test.htm");

Parameter target: the location target or name of the newly opened window

_self load a new page in the current window

_blank load new page in new window

_parent load new page in parent window

_top load new page in top window

Argument options: The properties of a newly opened window are made up of several options, separated by commas, each containing the name and value of the option.

Whether the address bar is displayed, the default is yes

tr> windows upper edge position td>

option

description

Heigh T

Window height, Unit pixel

width

window width, Unit pixel

Left

Window position

Top

Fullscreen

Is full screen, default No. no

Location

MenuBar

Whether the menu bar is displayed, default Yes

Resizable

Whether to allow changes to the window size, the default is yes

ScrollBars

Show scroll bars, default yes

Status

Show status bar, default Yes

TitleBar

To display the title bar, the default is yes

Toolbar

Show the toolbar, the default is yes

(3) The System prompt box Window.alert Displays the message prompt box, uses window.alert ([message]);           (Note: The Window object is generally omitted, directly using alert) window.confirm displays a confirmation dialog box, which includes the OK and Cancel buttons.         WINDOW.PROMPT displays a message balloon that contains a text entry box.      Usage: window.prompt ([Message],[default]); The message is the text that appears on the prompt box, and default is to set the text box defaults.

(4) Status bar control

Controlled by the Window.status property.    such as: window.status= "error hint"; This can affect the user experience, so it is not recommended to modify the status bar information.

(5) Timed operation

Timing operation is a common function in web development, in the development of Ajax technology, there is a class of applications that require regular access to the backend server and update the foreground page, such applications usually depend on the timing operation function.

There are four timer operation functions: Window.setinterval, Window.clearinterval, Window.settimeout, Window.cleartimeout, these four functions are all methods of the Window object, which means that the timer operation in the browser is done by the browser window.

The following is a detailed introduction to the usage of these four methods.

Window.setinterval sets the timer, executes the specified code window.setinterval (code,time) at intervals; Description: The code parameter can be a function, or it can be a string form of JavaScript code. The time parameter is the interval at which code is executed, in units of Ms.

Window.clearinterval clears the Timer window for the SetInterval function setting. Clearinterval (time);

Window.settimeout sets the timer, executes the specified code window.settimeout (code,time) at intervals;

Description: The code parameter can be a function, or it can be a string of JavaScript code, settimeout differs from setinterval in that settimeout executes only once for the specified code. The time parameter is the interval at which code is executed, in units of Ms.

Window.cleartimeout clears the Timer window for the Settiimeout function setting. Cleartimeout (time);

Related Article

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.