about how to use JavaBean in Tomcat

Source: Internet
Author: User

For users who do not use IDE tools such as Myeclipse,netbean, if you use Java files when writing JSPs, you must configure JavaBean, and there are many examples of configuring JavaBean in Tomcat on the web. Here I simply say the process of my own configuration.

Before this, believe that the beginner has already configured the virtual path of Tomcat, some virtual path is not suitable for using JavaBean, will not stop the error, at this point, first find the WebApps folder in the Tomcat folder, and then cut the virtual path of their previous configuration. For example, my virtual directory is a YSW file, cut over, in the YSW folder under the Web-inf file to create a classes file, (Web-inf has the Web. xml file) and then paste the. class file that you want to use into the classes folder, such as when I want to use the path to a register.class, at which time it's in the way: E:\Program Files\apache The Software Foundation\tomcat 6.0\webapps\ysw\web-inf\classes\yesiwei;yesiwei folder is a package that contains the Register.class files. Then, when invoked in a JSP, use the following statement directly: <jsp:usebean id= "Reg" scope= "request" class= "Yesiwei. Register "/>; At this point, you can successfully call JavaBean in the JSP file (the ID and scope are selected based on the usage, not fixed).

about how to use JavaBean in Tomcat

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.