Creating a bean instance in another bean

hi pals, i need your help on this. i'm havin this compiler error i.e. the bean instance(LoginBean) i created in another bean(LoginDataBean) which is for my database connection for client profile.this is the code & error message:
CODE:
package webclass;
import java.io.*;
import java.sql.*;
import java.util.*;
import webclass.LoginBean.*;
public class LoginDataBean
     private Connection cn;
     private PreparedStatement addRecord;
     public LoginDataBean()throws Exception
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          cn = DriverManager.getConnection("jdbc:odbc:portal");
     public void addClient(LoginBean log)throws SQLException
          addRecord.executeUpdate("insert into clientprofile(firstname,middlename,lastname,address,occupation,organisation,gender,email,username,password)values('"+log.getFNfield()+"','"+log.getMDfield()+"','"+log.getLNfield()+"','"+log.getAdresfield()+"','"+log.getOrgfield()+"','"+log.getEmail()+"','"+log.getUsername()+"','"+(String)log.getPasword()+"'");
          addRecord.close();
          cn.close();
ERROR:
cannot resolve symbol class LoginBean
Location LoginDataBean public void addClient(LoginBean log)throws SQLException

thanks, but look at the new code i modified still given error on not resolving the class LoginBean in the class LoginDataBean. here is the new code.
package webclass;
import java.io.*;
import java.sql.*;
import java.util.*;
public class LoginDataBean
     private Connection cn;
     private PreparedStatement addRecord;
     public LoginDataBean()throws Exception
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          cn = DriverManager.getConnection("jdbc:odbc:portal");
     public void addClient(LoginBean log)throws SQLException
          addRecord.executeUpdate("insert into clientprofile(firstname,middlename,lastname,address,occupation,organisation,gender,email,username,password)values('"+log.getFNfield()+"','"+log.getMDfield()+"','"+log.getLNfield()+"','"+log.getAdresfield()+"','"+log.getOrgfield()+"','"+log.getEmail()+"','"+log.getUsername()+"','"+(String)log.getPasword()+"'");
          addRecord.close();
          cn.close();

Similar Messages

  • Create new process instance

    Hi,
    How can we create a new instance of process other than global activity. Is there any way out for this?

    Hi Anuraq,
    Know I'm leaving out a couple, but here are ways you can create a new work item instance in a process:
    1) Here's how you can create an instance in a process using logic in an Automatic activity's method. This uses the "Fuego.Lib.ProcessInstance.create()" method shown below inside a process:
    // "args" is an associative string array (Any[String])
    argsIn as Any[String]
    // this assumes that the Begin activity has two argument variables
    //   named "nameArg" and "amountArg" and you're setting them
    //   to the variables "name" and "amount" respectively
    argsIn["someArgVarName"] = "Hello"
    argsIn["someBpmObject"] = myBpmObject
    // logic here to determine the name of the process to create an instance in
    idOfProcess as String
    idOfProcess = <hard coded string that has the id (not the name of the process to instantiate>
    ProcessInstance.create(processId : "/" + idOfProcess, arguments : argsIn, argumentsSetName : "BeginIn") ProcessInstance is in the Catalog inside Fuego.Lib.
    The processId parameter (the "idOfProcess" variable in the above logic) is the thing I most commonly screw up with this. It is the text you see when you right mouse click the process in the Project Navigator tab -> "Properties". Look at the value in the "Id" field and not the "Name" field here (the name without any space characters). Prefix it with a "/" as is shown here and if you've deployed this using an organization unit (OU) then prefix this to the string also.
    The third parameter is almost always "BeginIn". Begin activities in a process can have many incoming argument mappings, the default is "BeginIn". To see yours, double click the process's Begin activity and look at the mapping's name in the upper left corner of the dialog.
    "argsIn" is the set of incoming argument variables you want passed into the process. A common mistake is to type in the names of the incoming argument variables without the double quotes like this:
    // this will *NOT* work
    argsIn[someArgVarName] = "Hello"
    argsIn[someBpmObject] = myBpmObject
    . . .Here is the correct syntax:
    // this *WILL* work
    argsIn["someArgVarName"] = "Hello"
    argsIn["someBpmObject"] = myBpmObject
    . . .In this example, the process has two argument variables. It does not matter if the incoming argument variables are primitive type arguments (e.g. String, Integer, Decimal...) or BPM Objects, it is always done the same way. In this example, there is a String incoming argument called "someArgVarName" and a BPM Object incoming argument called "someBpmObject".
    2) Global Creation Activity - automatically creates an instance based on human interaction - requires no logic other than to set the argument variables you want passed into the process mapped to instance variables. If it's decided in the screenflow associated with this activity that you do not want to create an instance after all, it just needs to hit an Automatic task in the Global Creations's screenflow that has the logic "action = CANCEL"
    3) Global Interactive Activity - also based on human interaction it can create an instance if inside the Global Interactive activity's screenflow it hits an Automatic task that has the Instance.create() logic shown above.
    4) Using the Fuego.Papi.Instance.create method using logic inside a process.
    5) Using the Java PAPI:
    fuego.papi.Arguments arguments = Arguments.create();
    arguments.putArgument("inArgument", "MyArgument");
    String consolidatedProcessId = "/SomeProcessNameId";
    String argumentSetName = "BeginIn";
    fuego.papi.InstanceInfo instance = session.createProcessInstance(consolidatedProcessId,argumentSetName,arguments);6) Using the PAPI-WS (Web Service) API you can create an instance in a process using a web service call.
    7) A process can create a new instance in another process using the Subflow activity which synchronously creates an instance in a child subprocess and waits for the result to return once the instance in the child subprocess reaches the End activity in the process. From the parent process, you'd match the incoming and outgoing argument variables of the called child process with instance variables in your parent process.
    8) A process can create a new instance in another process using the Process Creation activity which asynchronously creates an instance in a child subprocess (fire and forget) but does not wait for the child to respond to the parent. Once the child process begins, the parent continues its flow. From the parent process, you'd match the incoming argument variables of the called child process with instance variables in your parent process.
    Dan

  • Unable to create Table Bean advanced search criteria

    Hi,
    I want to create new search criteria for advanced search region. The reason being new search criteria i tried to add by personalization it didnt worked may be guessing construction mode is autocustomization mode. Somewhere i have seen if resultsbased it will work. Can someone confirm on this??
    I'm trying to create new bean for search criteria at the specified location under <oa:table akRegionCode="EAM_AD_ASSET_RESULTS_TABLE" but unable to do so:
    Here is the part of the page
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!-- dbdrv: exec java oracle/jrad/tools/xml/importer XMLImporter.class java &phase=dat+24 checkfile(120.15.12000000.2=120.18)(115.26=120.1):~PROD:~PATH:~FILE &fullpath_~PROD_~PATH_~FILE -username &un_apps -password &pw_apps -dbconnection &jdbc_db_addr -userId "1" -rootPackage /oracle/apps/~PROD -rootdir &fullpath_~PROD_mds_directory -->
    <page xmlns="http://xmlns.oracle.com/jrad" xmlns:ui="http://xmlns.oracle.com/uix/ui" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:user="http://xmlns.oracle.com/jrad/user" file-version="$Header: EAM_AD_ADVSEARCH_PAGE.xml 120.18.12010000.3 2009/02/11 09:21:55 smrsharm ship $" version="10.1.3_1147" xml:lang="en-US" xmlns:jrad="http://xmlns.oracle.com/jrad">
    <content>
    <oa:pageLayout id="EAM_AD_ADVSEARCH_PAGE" akRegionCode="EAM_AD_ADVSEARCH_PAGE" regionName="Asset Search" amDefName="oracle.apps.eam.asset.server.AdvSearchAM" controllerClass="oracle.apps.eam.asset.webui.AdvSearchPageCO" appMenu="EAM_MAIN_SS" amStateRequired="false" helpTarget="EAM_AD_ADVSEARCH_PAGE">
    <ui:corporateBranding>
    <oa:image id="corporateBranding" source="/OA_MEDIA/FNDSSCORP.gif" shortDesc="Oracle"/>
    </ui:corporateBranding>
    <ui:productBranding>
    <oa:image id="productBranding" source="/OA_MEDIA/EAMBRAND.gif" shortDesc="Asset Management"/>
    </ui:productBranding>
    <ui:contents>
    <oa:query id="EamAssetQueryRegion" mode="autoCustomizationCriteria" dispSimple="true" dispCustomized="true" dispAdvanced="true" defaultPanel="customized" controllerClass="oracle.apps.eam.asset.webui.AdvSearchSearchCO" simpleSearchPanelButtonLabel="Simple Search" viewConfPanelButtonLabel="Views" advSearchPanelButtonLabel="Advanced Search" customizePanelTitle="Views" saveSearchButtonText="Save Search">
    <oa:simpleSearchPanel>
    <oa:defaultSingleColumn id="AssetSimpleSearchRegion" headerDisabled="false" text="Simple Search">
    <ui:contents>
    <oa:messageTextInput readOnly="false" columns="25" prompt="Asset Number" rows="1" secret="false" maximumLength="30" shortDesc="Asset Serial Number" id="EamAssetNumber" promptTranslationExpansion="100%" user:akAttributeCode="EAM_ASSET_NUMBER" user:akAttributeApplicationId="426" required="no" selectiveSearchCriteria="true"/>
    <oa:messageLovInput externalListOfValues="/oracle/apps/eam/lov/webui/EAM_ASSET_CATEGORY_LOV" readOnly="false" columns="25" prompt="Category" rows="1" secret="false" id="EamAssetCategory" promptTranslationExpansion="100%" user:akAttributeCode="EAM_ASSET_CATEGORY" user:akAttributeApplicationId="426" selectiveSearchCriteria="true" shortDesc="Category">
    <lovMappings>
    <lovMap criteriaFrom="EamAssetCategory" lovItem="EamAssetCategory" id="lovMap1"/>
    <lovMap resultTo="EamAssetCategory" lovItem="EamAssetCategory" id="lovMap2"/>
    <lovMap id="lovMap39" lovItem="EamAssetCategoryId" resultTo="EamAssetCategoryId"/>
    </lovMappings>
    </oa:messageLovInput>
    <oa:messageChoice readOnly="false" prompt="Asset Route" pickListViewDef="oracle.apps.eam.asset.server.PicklistYesNoVO" pickListDispAttr="Meaning" pickListValAttr="LookupCode" id="EamNetworkAsset" promptTranslationExpansion="100%" user:akAttributeCode="EAM_NETWORK_ASSET" user:akAttributeApplicationId="426" shortDesc="Asset Route" allowBlankValue="false" defaultValue="N"/>
    <oa:formValue id="EamAssetCategoryId" dataType="NUMBER"/>
    </ui:contents>
    </oa:defaultSingleColumn>
    </oa:simpleSearchPanel>
    <oa:simpleSearchMappings>
    <oa:queryCriteriaMap id="AssetNumberMapSS" criteriaItem="EamAssetNumber" resultsItem="AssetNumber1"/>
    <oa:queryCriteriaMap id="AssetCategoryMapSS" criteriaItem="EamAssetCategory" resultsItem="AssetCategory1"/>
    <oa:queryCriteriaMap id="AssetRouteMapSS" criteriaItem="EamNetworkAsset" resultsItem="AssetRoute"/>
    <oa:queryCriteriaMap id="AssetCategoryIdMapSS" criteriaItem="EamAssetCategoryId" resultsItem="AssetCategoryId"/>
    </oa:simpleSearchMappings>
    <ui:contents>
    <oa:tableLayout akRegionCode="EAM_AD_ADVSEARCH_RESULTS" regionName="Results" controllerClass="oracle.apps.eam.asset.webui.AssetResultsCO" addChildren="true" id="EamResultsNr" user:akAttributeCode="EAM_RESULTS_NR" user:akAttributeApplicationId="426">
    <ui:contents>
    <oa:tableLayout id="ResultsTableLayout2" width="100%" rendered="true">
    <ui:contents>
    <oa:rowLayout id="RowLayoutRegion2">
    <ui:contents>
    <oa:cellFormat id="CellFormatRegion2">
    <ui:contents>
    <oa:switcher id="MappedTableRegion">
    <ui:case name="ShowTable" id="ShowTable">
    <oa:table akRegionCode="EAM_AD_ASSET_RESULTS_TABLE" regionName="Asset Search" blockSize="25" standalone="true" height="1" id="MappedTable" user:akAttributeCode="EAM_RESULTS_NR" user:akAttributeApplicationId="426" width="100%" rendered="true" userCustomizable="true" shortDesc="Mapped Table">
    <ui:contents>
    <oa:messageStyledText id="AssetNumber1" viewName="AdvSearchVO" viewAttr="InstanceNumber" shortDesc="Serial Number" prompt="Asset Number"/>
    <oa:messageStyledText id="AssetDescription1" viewName="AdvSearchVO" viewAttr="DescriptiveText" shortDesc="Asset Description" prompt="Asset Description"/>
    <oa:messageStyledText id="AssetCategory1" viewName="AdvSearchVO" viewAttr="AssetCategory" shortDesc="Asset Category" prompt="Asset Category"/>
    I tried several ways :
    OAPageLayoutBean pageLayout = oapagecontext.getPageLayoutBean();
    OAQueryBean query=(OAQueryBean)pageLayout.findChildRecursive("EamAssetQueryRegion");
    OATableBean oawebbeantb = (OATableBean)query.findChildRecursive("EAM_AD_ASSET_RESULTS_TABLE");
    OAMessageLovInputBean ccidbean = (OAMessageLovInputBean)oapagecontext.getWebBeanFactory().createWebBean(oapagecontext, OAWebBeanConstants.LOV_TEXT, null, "xxValidation");
    if (oawebbeantb==null){                    
    throw new OAException("Error this is a test!", OAException.ERROR);
    oawebbeantb.addIndexedChild(ccidbean); --here it getting null
    OR
    OATableBean oawebbeantb = (OATableBean)oawebbean.findIndexedChildRecursive("EAM_AD_ASSET_RESULTS_TABLE");
    OAMessageLovInputBean ccidbean = (OAMessageLovInputBean)oapagecontext.getWebBeanFactory().createWebBean(oapagecontext, OAWebBeanConstants.LOV_TEXT, null, "xxValidation");
    oawebbeantb.addIndexedChild(ccidbean); --here it getting null
    Please someone help me on this..
    thanks,
    mallik

    1) Search panel textinput item should be search allowed true and prompt is need. no other property need to set.
    HERE YOU DONT WANT TO SET VIEW INSTANCE AND ATTRIBUTE SINCE WE ARE DOING FOR EXTENDED VO ITEM AS SEARCH ITEM.THAT'S OK. I TRIED WITH YOUR COMMENTS FOR TEXTINPUT ITEM TOO.
    Comment--
    textinput item created is a simple item without any VO instance , etc.
    There is no question of extended VO item, its a simple textinput item.
    value in this field is going to compare with the values in result table.
    2) Search mapping, only search item id and result item id need to set.
    I'M DOING HERE MAPPING FOR ABOVE SEARCH ITEM ID AND RESULT ITEM ID
    Comment-- Perfect !!
    3) Item created in table , after you extended Vo, view instance and attribute needs to set.
    WHERE DO YOU WANT THIS TO BE SET?? CAN YOU ELABORATE THIS MORE PLEASE.MAY BE I'M MISSING HERE SOMETHING.
    Comment-- you must have created message styled text item in adv table bean, assign VO instance and attribute to it, right?
    4) One more thing Parag, do i need to include where clause for extended VO item in view object??
    for ex:
    where attribute(this is extended vo item)=:4
    Comment-- No need. this will be handled by point#2 above, i.e. criteria and result items.
    --Parag Narkhede                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Error when Create Session Bean in JDeveloper

    Hi All,
    I followed the steps in the SRDemo tutorial to create Session bean SRPublicFacade. I used Create Session Bean wizard. Step 1 was ok. Step 2 when it's supposed to show all the POJOs and all methods (from Queries) it hang there, and skipped to Step 3 and so on... As a result I had an empty Session Bean with only class name and no methods in it. I do have correct database connection, and I have another project with similar Session Bean sucessfully. I just don't know what happened to this project or the way I created session bean this time. Any conflict when create Session Bean to the same database or something(?) Anyone has any idea please let me know.
    Thank you very much,
    John

    Frank,
    Yes, I compiled the project before building the session facade. I used JDeveloper 10.1.3.3.0
    The thing is I once created successfully the session facade in another project, like SRdemo. Now I would like to repeat that in another project say SRdemo2, then it went wrong. It skipped step 2 in the wizard and look like it cannot detect the tables and named queries.
    Thanks,
    John

  • Create jsp/bean webapp deploy fine...  add JSTL library wont deploy!

    winxp
    SJSE8
    PROBLEM:
    Using the new project wizard, I create a simple jsp/bean webapp using the embedded tomcat 5.5.7 as server... It deploys and runs with now issue
    Then, I right-click on project name (in project tree)... click properties... add library... select "JSTL 1.1".... do clean/build.... do deploy - which fails!
    message is: "Failed to deploy application at context path /bcd" (where bcd is my project name)
    Why does this happen?
    --------------simple app---------------
    ***jsp1.jsp****
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
        <h1>JSP Page</h1>
        <h1>get stuff JSP Page</h1>
        <jsp:useBean id="a" class="bcdpkg.IndexBean" scope="request"/>
        <h3>after1...</h3>
        <!--jsp:setProperty name="a" property="stuff" value="xxx" /-->
        <jsp:getProperty name="a" property="stuff" />
        </body>
    </html>***IndexBean.java***
    package bcdpkg;
    public class IndexBean
        /** Creates a new instance of IndexBean */
        public IndexBean()
        private String stuff = "this is stuff";
        public String getStuff()
            return this.stuff;
        public void setStuff(String s)
            this.stuff = s;
    }

    well.... I restarted SJSE8 (and tomcat 5.5.7) and now I can right-click on the project and click deploy...successfully.
    (Apologies for the "hair trigger" posting)
    I'll reply once more if it happens again.
    thanx

  • Is there any way to create backing bean, After page gets created?

    Hi
    Any one can please answer to my quick question !!!
    Is there any way to create the backing bean ,after a jsf page gets created using ADF ..?
    When i first time created the jsf jppx page i unchecked the option to generate backing bean, but later some time I would like to have backing bean for the newly created page. so is there any way to create backing bean ...?
    Thanks in Advance

    Have your page in the visual design mode then go to the Design->Page Properties menu and you'll be able to select auto-bind on the second tab.

  • Error while creating the view from one instance to another instance

    Hi Experts
    I want to Create a view which reside in one instance for example xxx Instance . I want to create the same view which reside in xxx instance to another instance for example YYY Instance How to acheive this ?
    I tried desc the View take the view script from XXX instance and copied the view script to YYY instance when I compiled Iam getting an Error
    For Example My view in XXX Instance
    CREATE OR REPLACE FORCE VIEW xxx.sample
    First_name,
    last_name
    as
         select "F_NAME",
                 "L_NAME"
         FROM  EMP;When try to copy and compile the same view in my YYY Instance
    i am getting error
    ORA: table or view does not exist
    Advance Thanks
    AT

    A.T wrote:
    Hi Experts ,
    Thanks For all your valuable information I amTrying Of DB Link i think so
    As per My understanding If wrong anywhere please advice me
    Here Instance is Like : One DB 10g divided into several Instance like (test , devlopement , production Instance)
    Now hope i ll make my req clear .
    Coming to my reqirement
    the actual table EMP is in xxi.TEST (Here xxi => Schema and test is an Instance )
    I want to create the view which is based on by table EMP which in my test instance to devoplment instance
    For example xxo.development (here xxo => Schema and development is an Instance )
    Need to access the xxi schema in Test Instance How can I create a DB Link please share your ideas and advice me
    Advance Thanks
    ATIt's still not at all clear, but let me outline what I think you are after
    Given a database, ORCL_A
    In database ORCL_A we have a schema, HALFTRACK
    User HALFTRACK has a table, MYSTUFF
    Given a database, ORCL_B
    In database ORCL_B we have a user GREENBRASS
    User GREENBRASS needs to be able to query the table HALFTRACK.MYSTUFF.
    In database ORCL_B, as user GREENBRASS
    create database link mylink
    connect to halftrack identified by halftracks_pswd
    using ORCL_A;
    select * from mytable@mylink;The db link defines a connection specification to ORCL_A, using the credentials of a user on ORCL_A. The target of the USING clause in the link definition must be an entry in the tnsames.ora file on the server hosting database ORCL_B.
    When querying through the link, database ORCL_B is simply acting as a client to ORCL_A, no different that a sqlplus session on ORACL_B's server. As far as ORCL_A is concerned, ORCL_B is just another client requesting a connection, connecting with the credentials defined in the link definition.

  • Creating entity beans with auto numbered primary key

    I have two entity bean with a CMR between them. I am successfully creating the first one but when I try and create the child entity bean I get a NullPointerException.
    Now I think this is because the gernerated code tries to get the primary key of the created entity bean and this is not set as it is set using a auto number in the database (An oracle sequence and trigger).
    Is there anyway i can get round this problem?
    Thanks in advance,
    Adrian

    This is the auto generated code:
         public dmd.sync.ejbs.entity.AppliancePackInfoLocal create_Local(dmd.sync.dataobjects.dto.AppliancePackInfoDTO appliancePackInfoDTO, dmd.sync.ejbs.entity.AmppLocal amppLocal) throws javax.ejb.CreateException, java.rmi.RemoteException {
              BeanO beanO = null;
              dmd.sync.ejbs.entity.AppliancePackInfoLocal result = null;
              boolean createFailed = false;
              boolean preCreateFlag = false;
              try {
                   beanO = super.createBeanO();
                   dmd.sync.ejbs.entity.AppliancePackInfoBean bean = (dmd.sync.ejbs.entity.AppliancePackInfoBean) beanO.getEnterpriseBean();
                   preCreateFlag = super.preEjbCreate(beanO);
                   bean.ejbCreate(appliancePackInfoDTO, amppLocal);
                   Object ejsKey = keyFromBean(bean);
                   result = (dmd.sync.ejbs.entity.AppliancePackInfoLocal) super.postCreate_Local(beanO, ejsKey, true);
                   bean.ejbPostCreate(appliancePackInfoDTO, amppLocal);
                   super.afterPostCreate(beanO, ejsKey);
    It must be falling over on the last line as it calls the ejbPostCreate fine.

  • Creating a Set  containing instances of another Class, which type?

    Hi All,
    I'm stuck trying to create a set which contains instances of another Class.
    When I created my instance method, it takes an argument which is the instance of another Class.
    It errors as I've used the Class as the type rather than String> or Integer.
    Can someone point my in the right direction?
    WebPageData wpd1 = new WebPageData("this is a sentence for a test", "www.test.com");
    WebPageData wpd2 = new WebPageData("this sentence is shorter", "www.short.com");
    WebPageData wpd3 = new WebPageData("this is very short", "www.very.com");
    Finder f1 = new Finder();
    f1.addsite(wpd1);
    f1.addsite(wpd2);
    f1.addsite(wpd3);
    f1.searchFor("a sentence test");
    Edited by: geedoubleu on Mar 16, 2008 9:03 AM

    The error message is "Semantic error: line 5. Message addsite( WebPageData ) not understood by class'Finder'"
    * Adds the argument of WebPageData instances to to a collection scannedSites.
    public void addSite(WebPageData theWebPage)
    this.scannedSites.add(theWebPage);
    }

  • Create "Dynamic" beans to handle dynamic form

    Hi All,
    Hope it is not too stupid question.
    JSP is all about dynamic content, a part of which can be a form that displays different fields and attributes. If I use Javabeans to handle the form, I will need different beans to go with each "configuration" of the form.
    Now let's say I have a form that can get one of three "configurations" , depanding on the parameter passed to the JSP page.
    I can create three Beans to match any type of form. (e.g., AFormBean, BFormaBean, CFromBean)
    How can I conditionally instansiate the Bean to handle the not yet known type of the Form?
    I tried to use an abstract Bean to be defined on the top of the JSP :
    <%
    Beans.AddComponentBean addComponentBean;
    %>
        <c:choose>
            <c:when test='${param.type=="DBMS"}'>
                    <jsp:useBean id="addComponentBean"            
                       class="Beans.AddDBMSBean" scope="page"/>
                    <jsp:setProperty name="addDBMSBean" property="*"/>    
            </c:when> 
            <c:when test='${param.type=="APP"}'>
                    <jsp:useBean id="addComponentBean"
                          class="Beans.AddAppBean" scope="page"/>       
                    <jsp:setProperty name="addDBMSBean" property="*"/>    
            </c:when>                 
            </c:choose>
    But that cannot be done since I get Use Bean duplicate.
    What is the right way of doing this?
    Thanks.

    How I would do this depends on my application design.
    I think I would go with a Factory type of design. I would have an 'AddBeanFactory' that decides on the specific type of the bean to create, and returns the abstract AddComponentBean. If you want to do it all in JSP, then making the factory a bean itself is usefull:
    package beans;
    import java.util.Map;
    import java.util.HashMap;
    public class AddBeanFactory {
         private String type;
         private Map parameters;
         private AddComponentBean addComponentBean;
         private static final Map<String, Class<? extends AddComponentBean>>TYPEMAP = new HashMap<String, Class<? extends AddComponentBean>>();
         static {
              TYPEMAP.put("DBMS", beans.AddDBMSBean.class);
              TYPEMAP.put("APP", beans.AddAppBean.class);
         public AddBeanFactory() {}
         public void setType(String type) { this.type = type; }
         public void setParameters(Map params) { this.parameters = params; }
         public AddComponentBean getAddComponentBean() throws InstantiationException, IllegalAccessException {
              if (addComponentBean == null) {
                   if (type==null || parameters == null){
                        throw new IllegalStateException("The Component Type and Parameters must be set prior to retrieving the ComponentBean");
                   addComponentBean = TYPEMAP.get(type).newInstance();
                   //fill bean with parameters
              return addComponentBean;
    }Then your JSP would be something like:
    <jsp:useBean id="beanFactory" class="beans.AddBeanFactory" scope="page">
        <jsp.setProperty name="beanFactory" property="type"/>
        <jsp.setProperty name="beanFactory" property="parameters" value="${request.parameterMap}"/>
    </jsp:useBean>
    <c:set var="addComponentBean" value="${beanFactory.addComponentBean}"/>

  • Could not create web bean  exception

    Hi,
    I am getting following exception at of top of the customer creation page when extending HzPuiAcctOrgSearchCO class.
    Could not create web bean, could not find item metadata Item Name: (HzPuiOrgSearchNonDQM); Region: (accntExtRN)
    Could not create web bean, could not find item metadata Item Name: (HzPuiOrgSearchNonDQM); Region: (TableActionsRN)
    package xx.oracle.apps.ar.hz.components.account.search.webui;
    import oracle.apps.ar.hz.components.account.search.webui.HzPuiAcctOrgSearchCO;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
    public class XXHzPuiAcctOrgSearchCO extends HzPuiAcctOrgSearchCO {
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
    super.processRequest(pageContext, webBean);
    String message = "Test PR - Not even calling PR request. ";
    throw new OAException(message, OAException.INFORMATION);
    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean) {
    super.processFormRequest(paramOAPageContext, paramOAWebBean);
    String message = "Test FR - works fine when click button - no exception";
    throw new OAException(message, OAException.INFORMATION);
    -- Full listings of parent Class for your reference.
    package oracle.apps.ar.hz.components.account.search.webui;
    import oracle.apps.ar.hz.components.base.webui.HzPuiPartySearchBaseCO;
    import oracle.apps.ar.hz.components.util.webui.HzPuiSearchWebUtil;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    public class HzPuiAcctOrgSearchCO extends HzPuiPartySearchBaseCO
    public static final String RCS_ID = "$Header: HzPuiAcctOrgSearchCO.java 120.4 2006/01/17 14:48:59 jhuang noship $";
    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: HzPuiAcctOrgSearchCO.java 120.4 2006/01/17 14:48:59 jhuang noship $", "%packagename%");
    protected void setAttributes(OAPageContext paramOAPageContext)
    super.setAttributes(paramOAPageContext);
    if (paramOAPageContext.isLoggingEnabled(2)) {
    paramOAPageContext.writeDiagnostics(this, "HZPUI: " + getClass().getName() + ".setAttributes(OAPageContext) starts.", 2);
    setAttribute("NonDQMRegionName", "HzPuiOrgSearchNonDQM");
    setAttribute("DQMRegionName", "HzPuiOrgSearchDQM");
    if (getPartyParameterMapping() == null) {
    setPartyParameterMapping(HzPuiSearchWebUtil.getAcctOrgSearchParameters(paramOAPageContext));
    if (paramOAPageContext.isLoggingEnabled(2))
    paramOAPageContext.writeDiagnostics(this, "HZPUI: " + getClass().getName() + ".setAttributes(OAPageContext) done.", 2);
    Getting exception even commented out processRequest process at the same time formsRequest works fine (when clicks button).
    I tried by adding OAWebBeanConstants class and parent parent class HzPuiPartySearchBaseCO in import stmts. but getting the same error.
    Kindly suggest what could be the issue.
    Thank you.
    Murali

    Hi,
    I am getting following exception at of top of the customer creation page when extending HzPuiAcctOrgSearchCO class.
    Could not create web bean, could not find item metadata Item Name: (HzPuiOrgSearchNonDQM); Region: (accntExtRN)
    Could not create web bean, could not find item metadata Item Name: (HzPuiOrgSearchNonDQM); Region: (TableActionsRN)
    package xx.oracle.apps.ar.hz.components.account.search.webui;
    import oracle.apps.ar.hz.components.account.search.webui.HzPuiAcctOrgSearchCO;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
    public class XXHzPuiAcctOrgSearchCO extends HzPuiAcctOrgSearchCO {
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
    super.processRequest(pageContext, webBean);
    String message = "Test PR - Not even calling PR request. ";
    throw new OAException(message, OAException.INFORMATION);
    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean) {
    super.processFormRequest(paramOAPageContext, paramOAWebBean);
    String message = "Test FR - works fine when click button - no exception";
    throw new OAException(message, OAException.INFORMATION);
    -- Full listings of parent Class for your reference.
    package oracle.apps.ar.hz.components.account.search.webui;
    import oracle.apps.ar.hz.components.base.webui.HzPuiPartySearchBaseCO;
    import oracle.apps.ar.hz.components.util.webui.HzPuiSearchWebUtil;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    public class HzPuiAcctOrgSearchCO extends HzPuiPartySearchBaseCO
    public static final String RCS_ID = "$Header: HzPuiAcctOrgSearchCO.java 120.4 2006/01/17 14:48:59 jhuang noship $";
    public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header: HzPuiAcctOrgSearchCO.java 120.4 2006/01/17 14:48:59 jhuang noship $", "%packagename%");
    protected void setAttributes(OAPageContext paramOAPageContext)
    super.setAttributes(paramOAPageContext);
    if (paramOAPageContext.isLoggingEnabled(2)) {
    paramOAPageContext.writeDiagnostics(this, "HZPUI: " + getClass().getName() + ".setAttributes(OAPageContext) starts.", 2);
    setAttribute("NonDQMRegionName", "HzPuiOrgSearchNonDQM");
    setAttribute("DQMRegionName", "HzPuiOrgSearchDQM");
    if (getPartyParameterMapping() == null) {
    setPartyParameterMapping(HzPuiSearchWebUtil.getAcctOrgSearchParameters(paramOAPageContext));
    if (paramOAPageContext.isLoggingEnabled(2))
    paramOAPageContext.writeDiagnostics(this, "HZPUI: " + getClass().getName() + ".setAttributes(OAPageContext) done.", 2);
    Getting exception even commented out processRequest process at the same time formsRequest works fine (when clicks button).
    I tried by adding OAWebBeanConstants class and parent parent class HzPuiPartySearchBaseCO in import stmts. but getting the same error.
    Kindly suggest what could be the issue.
    Thank you.
    Murali

  • Error creating form bean (STRUTS)

    Hi
    I am new to STRUTS framework, On starting I am getting this error "Error creating form bean". What would be the solution, can anybody suggest ?

    I am new to STRUTS framework, On starting I am
    m getting this error "Error creating form bean". What
    would be the solution, can anybody suggest ?This seems to be an error with struts-config.xml. Post your code if you need any further help.
    ***Annie***

  • Is it possible to create a bean that will generate (fill up) applet paramet

    Hi all,
    As a newbie I was asking myself is it possible to create a bean that will fill up applet parameter or directly generate the applet ??
    And I can I create it ?
    I mean : Having a jsp page that make reference to the bean, the bean shall generatehtml applet parameter values.
    Some samples will be welcome or a template.
    Thanks in advance
    Shamann

    Thanks a lot for your reply siv viv,
    I've posted this thread because I'm a little bit disappointed with Applet and jsp according to lot of thread about this subject (it seems that communication between applet and jsp is not easy : bug reported).
    The basic thing i want to do is to create a dynamic Pie Chart as applet or bean so i need to set applet parameter thanks to variables.
    See the http://forums.java.sun.com/thread.jsp?forum=45&thread=80250 this one is putting me in the dark.
    regards
    Shamann

  • [Seeking help] How to create a bean with annotations @ runtime?

    I would like 2 create a bean, @ runtime, as below:
    public class A {
      @MyAnnotation(id = "ID")
      private String id = "";
      public String getId() { ... }
      public void setId(String id) { ... }
    }Can anyone tell me how 2 achieve this? I know how 2 create a bean dynamically, however with annotations it is a bit tricky ..
    Cheers!
    Edited by: olove66 on Aug 7, 2009 2:00 AM

    @_@ I guess anyone interested in this topic can turn 2 ASM. Maybe BCEL has not got anything 2 support annotation creation yet.

  • Create Form Beans from JSP/HTML forms

    In the Builder certification objectives, there is one called "Create Form Beans from JSP/HTML forms". How can I do that? How can I create a form beam starting from the JSP form or HTML form?

    Guys, no one from forum can answer this question?

  • MDB gets cannot find recently created Entity Bean

    I have a session bean that creates several entities beans, and puts a message onto
    JMS queue. A MDB is configured to read the queue, and in onMessage(), it calls
    findByPrimaryKey() for one of the newly created EntityBeans. However, the entity
    bean cannot be found.
    All of the beans in question are using container managed transactions, and all
    have transaction required. The entity bean that I'm looking for is using optimistic
    concurrency. I cannot change it to exclusive without redesigning a major part
    of the system, which have solved a similar problem that I encounted earlier that
    did not involve any message driven beans.
    The only way that I got it to work is put in Thread.sleep(5000) right before calling
    the finder. Does anyone know of any alternatives besides having the MDB sleep?

    No, this will work fine with the existing server. If the publish is
    part of the JTA transaction, then no one can consume the message until
    the original JTA transaction has committed.
    -- Rob
    Rajesh Mirchandani wrote:
    XA defines that a transaction's individual operations will either fail or
    succeed atomically. XA can not, and does not define that a transaction's
    individual operations occur exactly simultaneously.
    The WL transaction monitor does not currently provide a way to serialize a
    transactions commit operations on its component resource managers.
    There is an enhancement filed for this, I guess. Follow up with BEA support.
    Rob Woollen wrote:
    Vina Wang wrote:
    The JMS send is part of the transaction, sort of. The call is within
    the session
    bean transaction, but I'm not using transacted session for
    JMSPulisher. Would
    that fix the problem?Sadly this is a confusing aspect of JMS. You want a non-transacted
    session because you want it to participate in the global transaction
    that the EJB started. Also, make sure that you've enabled user
    transactions on your connection factory.
    There's more info here:
    http://edocs.bea.com/wls/docs70/faq/jms.html#252635
    Let us know if you're still having problems.
    -- Rob
    I know that the transaction hasn't been commited, but I was monitoring
    database
    via SQL call when I tried this. There was about 2 second delay on my
    development
    machine.
    Rob Woollen wrote:
    My guess is the MDB is receiving the message before your "create entity
    bean" transaction has committed. Is the JMS send part of the "create
    entity bean" transaction? It probably should be.
    You can easily prove this by writing a few lines of JDBC to hit the
    database and check for your primary key.
    I would not recommend changing to exclusive or using the Thread.sleep.
    -- Rob
    Vina Wang wrote:
    I have a session bean that creates several entities beans, and putsa
    message onto
    JMS queue. A MDB is configured to read the queue, and in onMessage(),
    it calls
    findByPrimaryKey() for one of the newly created EntityBeans. However,
    the entity
    bean cannot be found.
    All of the beans in question are using container managed transactions,
    and all
    have transaction required. The entity bean that I'm looking for is
    using optimistic
    concurrency. I cannot change it to exclusive without redesigning a
    major part
    of the system, which have solved a similar problem that I encounted
    earlier that
    did not involve any message driven beans.
    The only way that I got it to work is put in Thread.sleep(5000) right
    before calling
    the finder. Does anyone know of any alternatives besides having the
    MDB sleep?
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

Maybe you are looking for

  • Can multiple web pages use the same cookie?

    I have an applet that will reside in several different web pages. The applet creates a cookie that saves user preferences and loads them when the user next uses the applet. The problem is that I want the same cookie to load when the user views the sa

  • Import java classes in a JSP

    hallo I have craeted aPackage "TestPackage" as subdirectory in the order tomcat\webapps\ROOT\WEB-INF\classes\TestPackage in this package ther ist the class Test I try to imort this class in the jsp <%@ page language="java" import="TestPackage.*"%> <j

  • Adobe reader xi will not open pdf's in browser for IE 7

    I have found the information for internet explorer 8 and 9 but these instructions do not apply to users using internet explorer 7.   Any help you can provide would be greatly appreciated.  

  • CS5 Advanced Photo Album Template Upload Issue

    I just created a new flash ap from the template Advanced Photo Album (File->new->Templates->Media Playback->Advanced Photo Album) I set everything up put my photos where they needed to be and coded the xml section of the action script.  I tested it a

  • Itunes crash

    Problem signature:   Problem Event Name:          BEX   Application Name:          iTunes.exe   Application Version:          11.1.1.11   Application Timestamp:          524a8521   Fault Module Name:          StackHash_0a9e   Fault Module Version: