当前位置:编程学习 > JSP >>

创建部署的xml文件和bat文件

createxml.jsp
<%@page contenttype="text/html;charset=gb2312"%>
<%@page import="java.io.*"%>
<%
try
{
    String ejb_type=request.getParameter("ejb_type");
    String ejb_name=request.getParameter("ejb_name");
    String server_type=request.getParameter("server_type");
    String prim_key_class=request.getParameter("prim_key_class");
    String transaction_type=request.getParameter("transaction_type");
    String trans_attribute=request.getParameter("trans_attribute");
    String package_name=request.getParameter("package_name");
    File myFile=new File(ejb_name+"//ejb-jar.xml");
    myFile.createNewFile();
    PrintWriter pw_jar_xml=new PrintWriter(new FileWriter(myFile));
    pw_jar_xml.println("<?xml version="1.0"?>");
    pw_jar_xml.println("<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>");
    pw_jar_xml.println("<ejb-jar>");
    pw_jar_xml.println("    <enterprise-beans>");
    if(!ejb_type.equals("entity"))
    {
        pw_jar_xml.println("        <session>");
        pw_jar_xml.println("            <ejb-name>"+ejb_name+"</ejb-name>");
补充:Jsp教程,J2EE/EJB/服务器
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,