Question about the default class package of JSP Import

Source: Internet
Author: User

Import the custom class in JSP. the user is defined under the default package, as follows:

<% @ Page Language = "Java" Import = "user" %>

 

Then,

<% USER u = new user (); %>

 

Run:

The import user cannot be resolved

 

Change the user class to the class in the Custom package as follows:

Com. Test. importclass. User, run successfully.

 

Google "JSP import default package" found that class must be written in the package, if you cherish your life.

 

"Login people onJavaranch, Including those most prone to answering questions, will quickly lose patience with someone who isn't willing to package all of their classes before trying to debug an issue (any issue ), even if packaging doesn't seem to be related to their current problem."

 

 

Refer:

Http://www.jguru.com/forums/view.jsp? Eid = 1294104

Http://www.coderanch.com/t/292944/JSP/java/Jsp-import

Http://www.coderanch.com/how-to/java/PackageYourBeans

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.