Use eclipse to develop Web applications (2)

Source: Internet
Author: User
Tags jboss server

First, open file-> New-> lomboz J2EE project and create a J2EE project named testj2ee.

Click Next. The default settings are displayed. Click Next to enter the next dialog box. Add the configured server to the targeted server, for example:

 

Create a web module and an EJB module in web modules and EJB modules respectively. In this example, we name them myweb and myejb respectively, and then click Finish. In this way, the framework of a J2EE project is automatically generated.

Under the myweb module, two JSP files are automatically generated: index. jsp and error. jsp, And the configuration file under the WEB-INF file. We can add our own JSP file and servlet on this basis, and then build the project.

On the eclipse toolbar, click the lomboz J2EE project outliner button:

 

 

In this way, the lomboz J2EE view appears in eclipse, as shown in:

 

 

Because I have already deployed another Web server: tomcat, the two servers bound to the module "myweb" appear, the red icon next to JBoss 3.0 all indicates that it is the default server. You can right-click the web module and choose to change the default server, for example:

 

 

After selecting the server, right-click the server in the lomboz J2EE view and select the running server. After the server is started, right-click the web module and choose deploy module, this completes the deployment of the web module on the server. Open the IE browser and type http: // 127.0.0.1: 8080/myweb to view your web application.

It should be noted that if Tomcat is used as the Web server, if the web module needs to be re-deployed, the Tomcat server must be restarted, and JBoss does not need.

Note:

If you encounter this problem when starting the JBoss server from Eclipse:

 Error occurred during initialization of VM  java/lang/NoClassDefFoundError: java/lang/Object 

This problem occurs generally Because JRE is not properly configured. In the preference dialog box of Eclipse, expand Java-> installed jres to check whether JRE has been set; open the Project Properties dialog box and check whether JRE system library exists in the library of Java build path. If not, click Add library to add JRE system library.

 

 

 

 

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.