当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: Chapter 3. Creating a Stateless
 

 

    摘要: 编程:编写一个截取字符串的函数,输入为一个字符串和字节数,输出为按字节截取的字符串。 但是要保证汉字不被截半个,如“我abc”4,应该截为“我ab”,输入“我abc汉def”,6,应该输出为“我abc”而不是“我abc+汉的半个”。package string;class s......
 ·eclipse 使用技巧    »显示摘要«
    摘要: 熱鍵篇: template:alt + / 修改處:視窗->喜好設定->工作台->按鍵->編輯->內容輔助。 個人習慣:shift+space(空白)。 簡易說明:編輯程式碼時,打sysout +template啟動鍵,就 會自動出現:system.out.println(); 。 設定template的格式:視窗->喜好設定->java->編輯器......


Tutorial for building J2EE Applications using JBOSS and ECLIPSE(3)

chapter 3.

creating a stateless session bean 【程序编程相关:用Java实现基于SOAP的XML文档网

【推荐阅读:Java Web 服务学习报告—Web简

【扩展信息:Eclipse 运行命令行参数大全

this chapter covers how to create a stateless session ejb component. this bean will be responsible for authenticating the user by communicating with the database using data access object (dao) which encapsulates java database connectivity (jdbc) code. a dao has all attributes (fields) and behavior (methods) corresponding to the bean it is being used for.

all customers, supplier and manager of mystore have been assigned a unique username and userid to access services of mystore, but in order to access these services all these entities have to first login into the system (mystore). the method for authentication is named loginuser, which takes two string parameters, username and password and returns the userid if authentication is successful.

note : this method loginuser is a business method, normally business methods carry out operations or processing on values ejb components. from clients perspective, clients can see only business methods and invoke them on bean.

tasks :

create a j2ee project named mystore.

create a stateless session bean named storeaccess.

add a business method in bean named loginuser with the following signature

public string loginuser (string username, string password)

create a dao named storeaccessdaoimpl under package au.com.tusc.dao. generate the dao interface.

implement the method named loginuser, generated in dao interface, in storeaccessdaoimpl. method signature is

public string loginuser (string username, string password)

add callback methods and implement them.

deploy storeaccess bean.

create your test client named sessionclient under package au.com.tusc.client.

run your client and test the bean.

create j2ee project :

now, lets start to write our first component of this tutorial.

go to file > new > lombozj2ee project, project creation wizard will pop up.

insert project name mystore > next .

under java settings check source, should be mystore/src , libraries pointing to $java_home > go next as shown in fig below.

note: this step is shown in chapter1, as there is a bug in eclipse 2.1, so its important that you check your library settings are right.

under create j2ee module, select web modules tab > add.., enter module name as onlinestore > ok as shown in figure below.

under create j2ee module, select ejb modules tab > add.., enter module name as mystoremgr > ok .


...   下一页
    摘要: chapter 4. creating a stateful session beanthis chapter covers how to create a stateful session ejb component. unlike stateless beans, stateful bean instances are associated with a particular client ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE