我们需要写一个web.xml文件来说明所有的为web容器进行框架说明。这个文件的内容如下:
<?xml version="1.0">;
<web-app>
<display-name>helloejb web application</display-name>
<servlet>
<servlet-name.net.chinacode.web.helloservlet</servlet-name>
<description>servlet that calls the helloejb bean</description>
<servlet-class.net.chinacode.web.helloservlet</servlet-class>
</servlet>
<ejb-ref>
<ejb-ref-name>ejb/hellohome</ejb-ref-name>
<ejb-ref-type>session</ejb-ref-type>
<home.net.chinacode.hello.hellohome</home>
<remote.net.chinacode.hello.hello</remote>
</ejb-ref>
<servlet-mapping>
<servlet-name.net.chinacode.web.helloservlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
我们将这个文件存入hdsite/src/xml/web/web.xml文件中。这里在最后一段中说明了将helloservlet这个servlet映射到web容器的/下。
一切都完成后我们需要来写一个xml文件提供给orion来说明web和ejb的模块,通过这个模块的说明来让orion正确的明白整个包的架构。这个xml包如下:
<?xml version="1.0"?>
<application>
<display-name>hdbean test application</display-name>
<module>
<ejb>helloejb-ejb.jar</ejb>
</module>
<module>
<web>
<web-uri>helloejb-web.war</web-uri>
<context-root>/helloejb</context-root>
</web>
</module>
</application>
我们将上面这个xml文件存入hdsite/src/xml/application.xml文件中。从这里我们可以知道我们的这个project需要我们最终向orion提供两个包,一个是helloejb-ejb.jar文件,这个文件包括和所有的ejb的文件,包括了所有的接口和实现bean的class文件以及对这个结构说明的xml文件,还有一个叫做helloejb_web.war文件,这个文件包括了所有的servlet的class以及对于web上使用的框架的xml文件。
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器