欢迎光临
我们一直在努力

建立ejb各个接口和bean的文件-JSP教程,J2EE/EJB/服务器

建站超值云服务器,限时71元/月

<%@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");
    
    file myfile=new file(ejb_name);
    myfile.mkdir();
    myfile=new file(ejb_name+"//"+ejb_name+"home.java");
    myfile.createnewfile();
    myfile=new file(ejb_name+"//"+ejb_name+"remote.java");
    myfile.createnewfile();
    myfile=new file(ejb_name+"//"+ejb_name+"ejb.java");
    myfile.createnewfile();
    %>
    <html>
    <body>

    <script language="javascript">
    function err(form)
    {
        return true;
    }
    function stringfilter(strfilter)
    {
        for (i=0;i<strfilter.length;i++)
        {
            if((strfilter.charat(i)>="a" && strfilter.charat(i)<="z")||(strfilter.charat(i)>="a"&&strfilter.charat(i)<="z")||(strfilter.charat(i)>="0"&&strfilter.charat(i)<="9")||(strfilter.charat(i)=="_"))
            {}
            else
            {
                window.alert ("您的输入中有非法字符");
                return 1;
            }
        }
        return 0;
    }
    </script>

    <center>
    <form action="createfile.jsp?ejb_type=<%=ejb_type%>&ejb_name=<%=ejb_name%>&server_type=<%=request.getparameter("server_type")%>" method="post" name="form1" onsubmit="return err(form1)">
    <table border="1" width="700">
        <tr>
            <td align="right" width="300">
                请输入您要将它创建的包名:
            </td>
            <td align="left" width="400">
                <input type="text" name="package_name">
            </td>
        </tr>

        <%if (ejb_type.equals("entity"))
        {%>
            <tr>
                <td align="right" width="300">
                    请输入您要创建的entity bean的主键类型:
                </td>
                <td align="left" width="400">
                    <select name="primarykey">
                        <option value="string">string</option>
                        <option value="integer">integer</option>
                        <option value="long">long</option>
                        <option value="float">float</option>
                        <option value="date">date</option>
                    </select>
                </td>
            </tr>
        <%}%>

        <tr>
            <td align="right" width="300">
                请输入您要创建的home接口中的方法:
                <br><font color="red">(请先写方法名称,空格后输入返回类型;以回车来分割不同方法)</font>
            </td>
            <td align="left" width="400">
                <%if (ejb_type.equals("entity"))
                {%>
                    <textarea name="home_method" rows="4" cols="50">create() <%=ejb_name+"remote"%>
findbyprimarykey() <%=ejb_name+"remote"%></textarea>
                <%}else{%>
                    <textarea name="home_method" rows="4" cols="50">create() <%=ejb_name+"remote"%></textarea>
                <%}%>
            </td>
        </tr>

        <tr>
            <td align="right" width="300">
                请输入您要创建的remote接口中的方法:
                <br><font color="red">(请先写方法名称,空格后输入返回类型;以回车来分割不同方法)</font>
            </td>
            <td align="left" width="400">
                <textarea name="remote_method" rows="4" cols="50"></textarea>
            </td>
        </tr>

        <tr>
            <td colspan="2" align="center"><input type="submit" value="提交">   <input type="reset" value="重填"></td>
        </tr>
    </table>
    <form>
    </center>

    </body>
    </html>
    <%
}
catch(exception e)
{
    out.print(e.getmessage());
}%>

这个文件是createejb.jsp。主页面是index.jsp 

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 建立ejb各个接口和bean的文件-JSP教程,J2EE/EJB/服务器
分享到: 更多 (0)

相关推荐

  • 暂无文章