Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jsp:useBean重复id检查_Java_Jsp_Tomcat7 - Fatal编程技术网

Java jsp:useBean重复id检查

Java jsp:useBean重复id检查,java,jsp,tomcat7,Java,Jsp,Tomcat7,在我的jsp页面中,我有以下代码片段。在我的流程中,此页面以递归方式出现。在流中间执行JSP时,我得到了一个重复的bean ID错误。你能帮我检查一下下面代码的bean id是否已经存在吗 完整的代码已经给出 code.jsp <%@ page language="java" %> <%@ page import="com.ubsw.risk.AUT_Authenticator.*" %> <% String path= System.get

在我的jsp页面中,我有以下代码片段。在我的流程中,此页面以递归方式出现。在流中间执行JSP时,我得到了一个重复的bean ID错误。你能帮我检查一下下面代码的bean id是否已经存在吗

完整的代码已经给出

    code.jsp

<%@ page language="java" %>   
<%@ page import="com.ubsw.risk.AUT_Authenticator.*" %>

<%
   String path= System.getProperty("dev_property_path");   
   System.out.println("dev_property_path----->"+path); 
%>
<jsp:useBean id="orbinfra" scope="session" class="com.ubsw.risk.Creation.web.OrbinfraBean" >
<jsp:setProperty name="orbinfra" property="propertiesFile" value="<%=path%>"/>
<%
    System.out.println("B4 init of Orbinfra");
    try {
        orbinfra.init();
            System.out.println("after init of Orbinfra");
    } catch( Exception ex ) {
        System.out.println("error in Orbinfra"+ex);
        ex.printStackTrace();
%>
    <html>
        Caught exception while creating orbinfra <%= ex %>
    </html>
<%
    }
%>
</jsp:useBean>
<jsp:useBean id="security" scope="session" class="com.ubsw.risk.Creation.web.AuthenticatorBean" >
</jsp:useBean> 

<%
    boolean showLogin;
    showLogin = true;
    boolean additionalMessage = false;
    String message = "Warning - Users login has expired";
    boolean hasAdminRights = false;
    // is there a command being sent
    String checkcommand = request.getParameter("command");

    // does user want to login
    if( checkcommand != null ) {
        if( checkcommand.equals("login") ) {
            try {
                    String authenticatorModuleLookupValue= System.getProperty("authenticatorModuleLookupValue");
                    String cookieNamevalue= System.getProperty("cookieNamevalue");
                    System.out.println(request.getParameter("User_Name"));              
                    System.out.println(request.getRemoteAddr());                
                    System.out.println(request.getLocalAddr()); 
                    System.out.println("hello P"); 
                //HttpSession session1 = request.getSession(true);
                 System.out.println(authenticatorModuleLookupValue+":"+cookieNamevalue);
                                security.setloginInfo(authenticatorModuleLookupValue,cookieNamevalue);
                security.logon(request.getParameter("User_Name"), request.getParameter("Password"), request.getRemoteAddr(), response );            
                System.out.println("what happened?");System.out.println(security);
                showLogin = false;
            } catch( LogonFailure le ) {
                additionalMessage = true;
                message = "Logon failed : " + le.reason;
            } catch( Exception ex ) {
                additionalMessage = true;
                message = "Failed, caught an exception : " + ex;
            }
        }
    }

    if( showLogin ) {   
        try {
            showLogin = !security.hasPermission( request );
            if( ! showLogin ) {
                hasAdminRights = security.hasAdminPermission( request );
            }
        } catch( TicketIsExpired te ) {
            additionalMessage = true;
            message = "Warning - Users login has expired";
        } catch( Exception ex ) {
            additionalMessage = true;
            message = "Exception - " + ex;
        }
    } 
//System.out.println("showLogin"+showLogin);
    // do we need to show login or not
    if( showLogin ) {
    %>

    <html>
    <body>
    <FORM NAME="loginForm" ACTION="index.jsp" METHOD="post">
    <center>
    <%
            if( additionalMessage ) {
    %>
                <b> <%= message %> </b><br>
    <%
            }
            //System.out.println("showLogin"+showLogin);
    %>


    <br>
    <br>
    <center>
    <table cellspacing="0" cellpadding="0" border="2" bordercolor="#60A0A0">
        <INPUT TYPE='hidden' NAME='command' VALUE='login'>
        <body>


                    <tr bgcolor="#60A0A0">
                                    <td align="left" height="17"><font face="Verdana" color="white"><span
                                        style="color: white; font-weight: bold; font-variant: normal; font-size: 10pt; text-align: left">
                                        <center>
                                        Creation Web Application
                                        </center>
                                        </span></font></td>
        </tr>
                <tr bgcolor="#60A0A0">
                <td align="left" height="17"><font face="Verdana" color="white"><span
                    style="color: white; font-weight: bold; font-variant: normal; font-size: 10pt; text-align: left">Please 
                Login</span></font></td>
            </tr>
            <tr>
                <td align="left" height="166">
                <table border="0" height="116" width="460">
                    <tbody>
                        <tr>
                            <td height="16" width="70"></td>
                            <td height="16" width="87"></td>
                            <td height="16" width="164"></td>
                            <td height="16" width="136"></td>
                        </tr>
                        <tr>
                            <td height="25" width="70"></td>
                            <td height="25" width="87"><span
                                style="color: black; font-style: normal; font-family: Verdana; font-weight: bold; font-size: 10pt; text-align: center">Username:</span></td>
                            <td height="25" width="164"><input type="text"
                                name="User_Name" maxlength="20"
                                style="height: 25px; font-family: Verdana; width: 153px"></td>

                        </tr>
                        <tr>
                            <td height="1" width="70"></td>
                            <td height="1" width="87"></td>
                            <td height="1" width="164"></td>
                            <td height="1" width="136"></td>
                        </tr>
                        <tr>
                            <td height="25" width="70"></td>
                            <td height="25" width="87"><span
                                style="color: black; font-style: normal; font-family: Verdana; font-weight: bold; font-size: 10pt; text-align: center">Password:</span></td>
                            <td height="25" width="164"><input type="password"
                                name="Password"
                                style="height: 25px; font-family: Verdana; width: 153px"
                                maxlength="25"></td>
                            <td height="25" width="136"></td>
                        </tr>
                        <tr>
                            <td height="19" width="70"></td>
                            <td height="19" width="87"></td>
                            <td height="19" width="164"></td>
                            <td height="19" width="136"></td>
                        </tr>
                        <tr>
                            <td height="27" width="70"></td>
                            <td height="27" width="100"></td>
                            <td height="27" width="136">
                            <center><input type="submit" name="Login"
                                value="Login"
                                style="height: 25px; bottom: auto; right: auto; font-family: Verdana; background-color: #60A0A0; width: 62px; top: auto; left: auto"></center></td>
                        </tr>
                        <tr>
                            <td height="1" width="70"></td>
                            <td height="1" width="87"></td>
                            <td height="1" width="164"></td>
                            <td height="1" width="136"></td>
                        </tr>
                    </tbody>
                </table>
                </td>
            </tr>
        </tbody>
    </table>
    </center>
    </FORM>
    </body>
</html>

    <%
            return;
        }
    %>
code.jsp
创建orbinfra时捕获异常



创建Web应用程序 请 登录 用户名: 密码:
正如您所说的
在我的流程中,此页面以递归方式出现。

尝试将
scope=“page”
更改为
scope=“request”

或者尝试将beanId重命名为
“orbinfra1”



您是否包含任何其他jsp,@nayan?不,没有包含。。下面是NoLock仍在接收的代码:-org.apache.jasper.jaspereException:/jsp/adminOptions/./jspIncludes/check.jsp(第9行,第0列)useBean:Duplicate bean name:{0}您可以使用ide在项目中搜索以下内容:
为什么使用Scriplet而同时使用JSTL&EL实现它?org.apache.jasper.jaspereException:/jsp/adminOptions/./jspIncludes/check.jsp(行:9,列:0)useBean:Duplicate bean name:{0}好的。然后检查页面中是否使用了相同的bean名称。不,它不在任何地方使用。如果你能给我推荐一些代码,让我检查bean id是否存在,那就太好了。再检查一次..你评论过同一行吗。。在前面使用HTML脚本,比如你想说哪一行?请建议
<jsp:useBean id="orbinfra1" scope="session" class="com.ubsw.risk.Creation.web.OrbinfraBean" >    
    <jsp:setProperty name="orbinfra1" property="propertiesFile" value="<%=path%>"/>
</jsp:useBean>