Disclaimer: I reserve all the rights of this article.
Part Four: test session Bean
The previous three sections already complete the process of establishing a session bean. Here's how to build a test project.
To add a test class:
In the right tree menu select Com.inspiresky.trader Right 〉new〉package, the dialog box in the input box at the end of the add user, new Com.inspiresky.trader.user package.
Select the Com.inspiresky.trader.user right key 〉new〉class, create the Userinfo.java class, the code is as follows.
Right-click Etader〉rebuilder in the Tree menu. The compilation succeeds without the error message.
Start JBoss:
Run D:\jboss-4.0.2RC1\bin\run.bat, start JBoss. Because we set paths in path, you can also run the Run command directly under the command line.
To deploy the application:
Right-click etader〉deploy option for "Etrader.ear" 〉deploy in the tree menu.
The following two commands are used when redeploying and uninstalling applications respectively.
To run the program:
Open IE Browser, enter in the address bar
Http://localhost:8080/WebTrader/test
At this point, you will see
{Username=jak, logintime=wed Mar 11:26:18 CST, userage=12}
Indicates that our program is running properly.
OK, a simple session bean application is developed to this end. There is less theory here, just hope to use examples to give you some inspiration, to better understand and apply some of the theories we have seen about Java, better familiar with the tools we use.
In the written haste, it is inevitable that there are mistakes to be overlooked.
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.