The STS and Virgo environments have been configured above, and the Virgo server can be successfully run. Next we will use STS to build several projects.
We simulate an example of registration. In our actual case, data is sometimes written to the database, written to a file, or written to the memory, which is convenient for different operations. This example may not completely explain the problem, but it is enough to explain how to build a project through STs.
We will create four bundle, one is the bundle registered through the page, and the other is the bundle of the input interface, one is the bundle that writes files to the database (of course, it is only a simple implementation and is not actually written into the database), and the other is the bundle that writes files.
Interface Project Creation
Create a vigro plug-in Project
Enter the project name, click Next, and wait until the project is completed. Select the default one. No additional modifications are required.
Because it is an interface project, no additional configuration is required. You only need to export the directory to be exported.
Create an istore interface to identify the interface to store login information. The interface content is as follows:
View code
Public InterfaceIstore {VoidStore (loginbean );}
Javabean is used to name loginbean, which is used to simulate the storage of login information,CodeAs follows:
View code
Public Class Loginbean { Private String name; Private String pass; Private String repass; Private Int Age; Public String getname (){ Return Name ;} Public Void Setname (string name ){ This . Name = Name ;} Public String getpass (){ Return Pass ;} Public Void Setpass (string pass ){ This . Pass = Pass ;} Public String getrepass (){ Return Repass ;} Public Void Setrepass (string repass ){ This . Repass = Repass ;} Public Int Getage (){ Return Age ;} Public Void Setage ( Int Age ){ This . Age = Age ;}}
Then double-click the manifest. MF file under the META-INF, set the exported directory, that is, other modules can access the directory or interface
Select the runtime tag and add the directory you just set
Then read the content in mainifest. MF:
View code
Manifest-version: 1.0Bundle-Version: 1.0.0Bundle-Name: registerbundle-Manifestversion: 2Bundle-Description: tgytbundle-Symbolicname: COM. tgyt. Test. registerexport-Package: COM. tgyt. Test. Register
Create a database storage project
The purpose of this project is to store data in the database. Of course, it is only a schematic project, and the data is not actually stored.
The creation method is the same as above. Modify the project name and then import the interface created above in the import package.
Here, you need to reference the above project, right-click the new project, select project reference, and reference the project created above