The following error occurs in the Java file: Cannot return from outside a function or method ?, Outsidemethod

Source: Internet
Author: User

The following error occurs in the Java file: Cannot return from outside a function or method ?, Outsidemethod

1. Open> Myeclipse or Eclipse. (Myeclipse is used)

2. Open> Window> Preferences 1:

Figure 1

3. Open> Preferences> MyEclipse> Validation> JavaScript validator for JS files (remove "√" in Bulid) 2:

Figure 2

4. Apply> OK!

* 5. Another method: Right-click the project> MyEclipse> Exclude From Validation ("√ ")


Cannot return from outside a function or method appears in the Java Project

This "return checkSubmit ()" means to check when you click "OK" to submit. If checkSubmit () returns true, the system submits the request and returns false without submitting the request, 404 the path you submitted may be incorrect.

[Development based on SSH framework] What is the error of Cannot return from outside a function or method?

The Myeclipse compiler does not support js. You write and imaging your code like return.
<Input type = "submit" value = "log" onclick = "checkForm ();"/>
In this way, no error will be reported, and then judgment will be made in the checkForm (). If it does not meet the conditions, return directly. If it meets the conditions added, it will jump to the background for execution. I have been doing this all the time.

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.