Can we use ejb in struts framework?

can we use ejb in struts framework?I need the reasons for both yes or no answers.

This question is not appropriate for this forum, which deals with the J2EE SDK. Have you looked at the Struts documentation? Have you performed a Google search? If you had, you would have found the answer....
-Ian Evans

Similar Messages

  • How can i use JavaScript in Struts

    Any one can please tell me how can i use simple java script in Struts framework
    like
    <script language="javascript">
    function call()
    alert("You Are In call()")
    </script>
    </head>
    <body>
    <form ..... >
    <input type="button" value="CHECK" onclick="return call()" >
    </form >........
    ok this i can use in normal jsp
    but how can i use same in Struts framework
    Thanks in advance

    This forum is for JSF, not Struts. Your best bet to get your question answered, is to post to the struts user mailing list.

  • How can I use EJB component on Weblogic 8.1 server ?

    hi,dear sir:
    How can I use EJB component on Weblogic 8.1 server ?
    It need client jar to invoke ejb,but what will I to do for this jar file? what does it contain? format ?
    If my EJB module contain 100 session bean and 50 Entity bean,but I want invoke 20 session beans in my module, how can I to do?
    thank you...

    Hi,
    This forum is exclusively for Creator. please post this on appropriate forum
    regards
    CreatorTeam

  • Oracle portal using JSF, JSP, Struts framework

    Hi ,
    Can anyone tell me how to build an oracle portal using JSF,Jsp and Struts Framework.
    Also please provide any manual or documentation for developing oracle portal.
    Thanks in Advance,
    Raghav

    At present, i think the best thing to do is to look at the example provided with the struts-faces integration taglib. I don't know any documentation about it.
    http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/

  • Can i use EJB with Swing?

    Hi,
    I am developing an application in which i am using the "Swing" for GUI.Can i use the "EJB" with swing?
    regards

    Hi,
    Sure you can. The earlier poster has said the same thing too. Just that hes made out like this is possible only in jboss. EJB is a distributed component framework and can support multiple types of clients. The client can be a servlet or jsp, another EJB or in your case a swing application. In fact many IDE's allow you to test your EJB called by generating an application client. You need to add a special application client deployment descriptor file ( atleast with weblogic) in order to do this.
    Hope this helps.
    cheers,
    vidyut
    http://www.bonanzasoft.com

  • I need a clarification : Can I use EJBs instead of helper classes for better performance and less network traffic?

    My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
    I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
    Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
    Please suggest me which method (is Helper classes or Using EJBs) is perferable
    1) to get better performance and.
    2) for less network traffic
    3) for better container resource utilization
    I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
    Please give detailed explanation.
    thank you,
    sudheer

    <i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
    1) to get better performance</i>
    EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
    <i>2) for less network traffic</i>
    There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
    <i>3) for better container resource utilization</i>
    Again, the EJB version will consume a lot more container resources.

  • Populating Database values into a combo box in STRUTS Framework

    Hi Guys,
    I am currently working on a STRUTS Framework project and I can't get much resources related to the problems that I'm facing.
    Currently I need to populate a JSP file's Combo box with database values. What I don't know here is the syntax used to in STRUTS framework to populate the Combo box with database values. Anyone with experience related to this topic, please kindly help me out.

    Struts doesn't define anything about the datab layer. You're free to implement how you will.
    Struts instead guides you into following an MVC pattern.
    You populate a combo box with values from a bean.
    So you need to set up a bean for this page to talk to.
    That bean can be populated from the database - but at that point you're in java/jdbc code - and away from the struts layer.
    My suggestions
    1 - Define a bean to represent the information from the database.
    2 - write a method that queries the database, and copies the data into a List of those beans. This will be your Data access layer.
    3 - in your action, call that method, and then set the list of beans as a request attribute. Or maybe as a property on a form.
    4 - use that list of beans to populate your dropdown box.

  • Need to understand Struts Framework

    Greetings everyone,
    I am trying to understand how the entire Struts Framework works.
    If I am running tomcat, is copying and pasting the WAR file into webapps directory the only way to install struts?
    Since I am new to struts and was trying to understand how it works from ground up, I tried creating the neccessary files needed and copied the struts.jar into my web app's WEB-INF\lib folder.
    Unfortunately, I kept on hitting errors.
    Here is my app directory structure
    1) MyApp/
    - index.jsp
    - displayname.jsp
    2) WEB-INF/
    - struts-config.xml
    - struts-html.tld
    - web.xml
    3) WEB-INF/classes/example/
    - NameAction.class
    - NameForm.class
    4) WEB-INF/lib/
    - servlet-api.jar
    - struts.jar
    I am getting this error:
    HTTP Status 404 - /StrutsActionForm/index.jsp
    type Status report
    message /StrutsActionForm/index.jsp
    description The requested resource (/StrutsActionForm/index.jsp) is not available.
    Apache Tomcat/5.5.20
    I know it sounds silly but that's the only way I can truly understand the entire struts framework.
    Your reply will be much appreciated.

    If you specify the appBase of your application in Tomcat's server.xml ,
    or define a <Context>.xml and point the docBase to where ever your code's main directory is, you won't hae to create a WAR file and place it under WEB-INF each time you make any change.
    This saves a lot of time and effort in the development envionment, especially when you make a change to JSP pages - you can just refresh the browser to see the changes instead of creating a WAR file just to see changes in JSPs.
    Create a WAR file only when you are deploying your application to production / live website - a WAR file is not necessary in dev environment.
    With the above set-up your project can be located outside and independent of Tomcat, as long as the appBase or docBase are pointing to the location of your project.
    For tomcat related questions join the Tomcat User Mailing List
    and for struts question Struts User Mailing List

  • Problems in configuring deployment descriptors to use EJB in JSP

              Hello,
              I've been trying to use an EJB in a JSP on Weblogic 8.1. The relevent part of
              my web.xml and weblogic.xml look like this:
              =====================================
              web.xml -
              <ejb-ref>
              <description>Purchase order bean deployed</description>
              <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <home>mypackage2.PurchaseorderHome</home>
              <remote>mypackage2.Purchaseorder</remote>
              <ejb-link>/PO.jar#Purchaseorder</ejb-link>
              </ejb-ref>
              <ejb-local-ref>
              <description>purchase order</description>
              <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <local-home>mypackage2.PurchaseorderLocalHome</local-home>
              <local>mypackage2.PurchaseorderLocal</local>
              <ejb-link>/PO.jar#Purchaseorder</ejb-link>
              </ejb-local-ref>
              =====================================
              weblogic.xml -
              <ejb-reference-description>
              <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              <jndi-name>Purchaseorder</jndi-name>
              </ejb-reference-description>
              </reference-descriptor>
              =================================
              My ejb-jar.xml file looks like this (this EJB jar is already deployed on Weblogic):
              <description>Entity Bean ( CMP )</description>
              <display-name>Purchaseorder</display-name>
              <ejb-name>Purchaseorder</ejb-name>
              <home>mypackage2.PurchaseorderHome</home>
              <remote>mypackage2.Purchaseorder</remote>
              <local-home>mypackage2.PurchaseorderLocalHome</local-home>
              <local>mypackage2.PurchaseorderLocal</local>
              <ejb-class>mypackage2.PurchaseorderBean</ejb-class>
              ==============================================
              Finally, my weblogic-ejb-jar.xml looks like this:
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>Purchaseorder</ejb-name>
              <jndi-name>Purchaseorder</jndi-name>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              ===============================================
              But despite many many efforts, I keep getting the following error:
              Could not setup environment - with nested exception: [weblogic.deployment.EnvironmentException:
              [J2EE:160101]Error: The ejb-link '/PO.jar#Purchaseorder' declared in the ejb-ref
              or ejb-local-ref 'ejb/Purchaseorder' in the application module 'public_html' could
              not be resolved. The target EJB for the ejb-ref could not be found. Please ensure
              the link is correct.] weblogic.deployment.EnvironmentException: [J2EE:160101]Error:
              The ejb-link '/PO.jar#Purchaseorder' declared in the ejb-ref or ejb-local-ref
              'ejb/Purchaseorder' in the application module 'public_html' could not be resolved.
              The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
              at
              I have changed around a lot of things. I've a classes directory under web-inf
              where I have mypackage2\all-the-class-files. I've also made available PO.jar file
              (which contains Purchaseorder) at various levels to ensure that the class can
              be found. I've changed the "/PO.jar#Purchaseorder" value of <ejb-link> tag accordingly
              to try various things. (e.g ejb/Purchaseorder, mypackage2.Purchaseorder, and a
              lot of other things) but of no avail. I keep getting the same error over and over
              again. (Do you think banging my head on the wall would do the trick?)
              Any help would be greatly appreciated. Thanks.
              

              Sam, thanks for the explanation. It makes sense now that why it's not working.
              But is this specific to Weblogic? I'm actually using JDevloper to develop my
              EJB (CMP) and JSP. Within JSP, I can use the tag library ejbtag provided by Oracle
              to specify home, create instance, and get collection back from an EJB. I've specify
              the tag lib URI in the web.xml but I kept getting the error message in Weblogi
              when running the test to load JSP saying that it could not find the EJB (Purchaseorder)
              specified. That led me to do some research and I came accross the <ejb-ref> and
              <ejb-link> tags.
              If it is a restriction only posed by Weblogic then I guess I'll have to create
              a JavaBean to interact with EJB first and then get the collection.
              Thanks.
              Sam Pullara <[email protected]> wrote:
              >You can only use ejb-links when connecting to EJBs that are in the same
              >
              >application (ear). If you want to have them separate you will have to
              >
              >use a global JNDI name for the EJB and look up that.
              >
              >Sam
              >
              >A Roman wrote:
              >> Michael,
              >>
              >> I'm not deploying EJB as an .ear application that'd include web app
              >and .jar.
              >> Instead I have deployed .jar as stand alone EJB and want to deploy
              >.war (exploded
              >> directory structure) as a seperate web app. Both .jar and .war will
              >be deployed
              >> on the same server. That's exactly why I cannot use the syntax that's
              >used in
              >> the samples.
              >>
              >> Thanks.
              >>
              >> "Michael Kovacs" <[email protected]> wrote:
              >>
              >>>I guess to start off with I'm making the assumption that your PO.jar
              >>>is your
              >>>EJB module
              >>>and that it is contained in the same EAR as your webapp module, looking
              >>>something like
              >>>this:
              >>>
              >>>myEAR.ear
              >>> |_ PO.jar
              >>> |_ webapp
              >>> |_ jspCallingEJB.jsp
              >>>
              >>>If this is correct, the first thing I'd suggest trying is to remove
              >your
              >>>"/"
              >>
              >>>from the front of your <ejb-link> and
              >>
              >>>just make the value <ejb-link>PO.jar#Purchaseorder</ejb-link>
              >>>
              >>>The EJB example that ships with 8.1 platform makes use of an EJB from
              >>>a jsp
              >>>page so you could
              >>>look to that example for some guidance, which references the EJB in
              >this
              >>>same way in the web.xml ejb-local-ref element.
              >>>hope that helps.
              >>>--
              >>>Michael Kovacs
              >>>Senior Software Engineer
              >>>BEA Systems
              >>>"ARoman" <[email protected]> wrote in message
              >>>news:[email protected]...
              >>>
              >>>>Hello,
              >>>>
              >>>>I've been trying to use an EJB in a JSP on Weblogic 8.1. The relevent
              >>>
              >>>part
              >>>of
              >>>
              >>>>my web.xml and weblogic.xml look like this:
              >>>>=====================================
              >>>>web.xml -
              >>>>
              >>>> <ejb-ref>
              >>>> <description>Purchase order bean deployed</description>
              >>>> <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              >>>> <ejb-ref-type>Entity</ejb-ref-type>
              >>>> <home>mypackage2.PurchaseorderHome</home>
              >>>> <remote>mypackage2.Purchaseorder</remote>
              >>>> <ejb-link>/PO.jar#Purchaseorder</ejb-link>
              >>>>
              >>>> </ejb-ref>
              >>>>
              >>>> <ejb-local-ref>
              >>>> <description>purchase order</description>
              >>>> <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              >>>> <ejb-ref-type>Entity</ejb-ref-type>
              >>>> <local-home>mypackage2.PurchaseorderLocalHome</local-home>
              >>>> <local>mypackage2.PurchaseorderLocal</local>
              >>>> <ejb-link>/PO.jar#Purchaseorder</ejb-link>
              >>>> </ejb-local-ref>
              >>>>=====================================
              >>>>
              >>>>weblogic.xml -
              >>>><ejb-reference-description>
              >>>><ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              >>>><jndi-name>Purchaseorder</jndi-name>
              >>>></ejb-reference-description>
              >>>></reference-descriptor>
              >>>>=================================
              >>>>My ejb-jar.xml file looks like this (this EJB jar is already deployed
              >>>
              >>>on
              >>>Weblogic):
              >>>
              >>>>
              >>>> <description>Entity Bean ( CMP )</description>
              >>>> <display-name>Purchaseorder</display-name>
              >>>> <ejb-name>Purchaseorder</ejb-name>
              >>>> <home>mypackage2.PurchaseorderHome</home>
              >>>> <remote>mypackage2.Purchaseorder</remote>
              >>>> <local-home>mypackage2.PurchaseorderLocalHome</local-home>
              >>>> <local>mypackage2.PurchaseorderLocal</local>
              >>>> <ejb-class>mypackage2.PurchaseorderBean</ejb-class>
              >>>> ==============================================
              >>>>Finally, my weblogic-ejb-jar.xml looks like this:
              >>>>
              >>>><weblogic-ejb-jar>
              >>>> <weblogic-enterprise-bean>
              >>>> <ejb-name>Purchaseorder</ejb-name>
              >>>> <jndi-name>Purchaseorder</jndi-name>
              >>>> </weblogic-enterprise-bean>
              >>>></weblogic-ejb-jar>
              >>>>===============================================
              >>>>
              >>>>But despite many many efforts, I keep getting the following error:
              >>>>
              >>>>Could not setup environment - with nested exception:
              >>>
              >>>[weblogic.deployment.EnvironmentException:
              >>>
              >>>>[J2EE:160101]Error: The ejb-link '/PO.jar#Purchaseorder' declared
              >in
              >>>
              >>>the
              >>>ejb-ref
              >>>
              >>>>or ejb-local-ref 'ejb/Purchaseorder' in the application module
              >>>
              >>>'public_html' could
              >>>
              >>>>not be resolved. The target EJB for the ejb-ref could not be found.
              >>>
              >>>Please
              >>>ensure
              >>>
              >>>>the link is correct.] weblogic.deployment.EnvironmentException:
              >>>
              >>>[J2EE:160101]Error:
              >>>
              >>>>The ejb-link '/PO.jar#Purchaseorder' declared in the ejb-ref or
              >>>
              >>>ejb-local-ref
              >>>
              >>>>'ejb/Purchaseorder' in the application module 'public_html' could
              >not
              >>>
              >>>be
              >>>resolved.
              >>>
              >>>>The target EJB for the ejb-ref could not be found. Please ensure the
              >>>
              >>>link
              >>>is correct.
              >>>
              >>>>at
              >>>>
              >>>>I have changed around a lot of things. I've a classes directory under
              >>>
              >>>web-inf
              >>>
              >>>>where I have mypackage2\all-the-class-files. I've also made available
              >>>
              >>>PO.jar file
              >>>
              >>>>(which contains Purchaseorder) at various levels to ensure that the
              >>>
              >>>class
              >>>can
              >>>
              >>>>be found. I've changed the "/PO.jar#Purchaseorder" value of <ejb-link>
              >>>
              >>>tag
              >>>accordingly
              >>>
              >>>>to try various things. (e.g ejb/Purchaseorder, mypackage2.Purchaseorder,
              >>>
              >>>and a
              >>>
              >>>>lot of other things) but of no avail. I keep getting the same error
              >>>
              >>>over
              >>>and over
              >>>
              >>>>again. (Do you think banging my head on the wall would do the trick?)
              >>>>
              >>>>Any help would be greatly appreciated. Thanks.
              >>>>
              >>>
              >>>
              >>
              >
              >
              

  • Using EJB in XI

    Hi.
    1) how can i use EJB in XI ?
    2) in what way java proxy , webservices ...?
    3) must i use BPM for that?
    thanks.
    motty.

    Hi,
    >>>>2) in what way java proxy , webservices ...?
    java proxy
    >>>3) must i use BPM for that?
    no
    Regards,
    michal

  • Can I use the iPhone as a display or monitor?

    I would like to be able to connect an external camera to my iPhone and have the image displayed on the iPhones display.  I don't know of any application out that do this.  My question is really more of is it possible to do this if I write an application for it.
    Does the iOS frameworks and tools available for developers provide a way to access the iPhone display to show an image coming from an external device?
    Thanks for your help,
    TSoles

    Hellboy254,
    Again I think this is using some wireless connection to use the iPhone as an alternate display.
    What I really am attempting to do is generally the same thing that the Camera icon (software) is doing on the iPhone but I want to use an external connected camera to hijack, temporarily, the display.  There must be some communication taking place between the built in camera and the display in the standard Camera software.  Can I use those same principals (frameworks) to display the image from an external camera?
    Thanks,
    tsoles

  • Oracle Database Lite deploying EJBs and struts

    I need to deploy my enterprise application on Mobile server. My application uses EJBs and struts, are EJBs and Struts supported by Oracle Database Lite Mobile server? If yes do we need to do anything different for deploying EJBs on Mobile Server?
    Regards
    Roomap

    Already posted a response to this here today
    New Application

  • Can I use DynaActionForm/DynaValidatorForm of Struts Framework as a POJO cl

    Hi everybody,
    I am using hibernate with struts. So please tell me how can I use DynaActionForm/DynaValidatorForm as POJO class of hibernate. How should be the OR mapping file? I mean what should be in place of ? (question marks) below?:::
    <hibernate-mapping>
    <class name=? table="ELEMENT">
    ..

    You already asked that here:
    http://forum.java.sun.com/thread.jspa?threadID=5200392&messageID=9800476

  • Using Multiple Properties Files in Struts Framework

    Hi Everybody!
    I just to know how to use a multiple message-resources files in a Struts Framework.
    I've 2 properties file :
    1. ApplicationResources_A.properties
    2. ApplicationResources_B.propertiesI put the files under WEB-INF/classes dir.
    My configuration in struts-config file something like below:
    <!--  Begin Testing -->
         <message-resources key="A" parameter="ApplicationResources_A" />
         <message-resources key="B" parameter="ApplicationResources_B" />
    <!--  End Testing -->
    </struts-config>
    if my JSP code is like below , this error is thrown:
    org.apache.jasper.JasperException: Cannot find message resources under key A
      <tr>
        <td width="17%">Language A</td>
        <td width="83%"><bean:message bundle="A" key="user.lang.desc"/></td>
      </tr>
      <tr>
        <td width="17%">Language B</td>
        <td width="83%"><bean:message bundle="B"  key="user.lang.desc"/></td>
      </tr>
    but  if I change the  JSP code like below it  work fine:
      <tr>
        <td width="17%">Language A</td>
        <td width="83%"><bean:message key="user.lang.desc"/></td>
      </tr>
      <tr>
        <td width="17%">Language B</td>
        <td width="83%"><bean:message  key="user.lang.desc"/></td>
      </tr>
    In this code , I dont know  which resources file is used.
    So how do I solve this problem. Thanks you.

    I have defined the following:
    struts-config.xml
    <message-resources key="ldap" parameter="com/project/struts/ldap"/>
    Action.java
    In execute method:
    MessageResources messageResources= MessageResources.getMessageResources("com/project/struts/ldap");
    System.out.println("INITIAL_CONTEXT_FACTORY"+messageResources.getMessage("INITIAL_CONTEXT_FACTORY"));
    and it is working, however I have to change "com/project/struts/ldap" value in Action.java file whenever there is any change in name or location of ldap.properties.
    Can I access this properties in such way that I don't have to change parameter path manually in Action.java (modifying in struts-config.xml is okay)? like access through key="ldap" or something.
    Thanks and regards,

  • Dynamic Tree Creation using JSP, Struts framework

    I urgently require tips/information/code snippet for creating a Dynamic Tree structure.
    Tree is the hierarchical folder structure that we see in windows operating system.
    Dynamic tree in the sense that all nodes shall be populated from database & a radio button shall be present at each node that can be selected & submitted to form.
    Tree should be done using JSP (& if required Javascript).
    I am using Struts framework .
    [email protected]

    u need to know quite a few java technologies to make archieve your dream.
    JDBC, dynamic array and JSP.
    after reading tutorial regarding to these 3 materials, you should be able to get your job done.

Maybe you are looking for

  • Needed to Write a program dun know how to start  Can anyone suggest

    Objective The student will develop classes to implement Dancing Turtles using the ACM graphics library. Special Requirement This assignment uses the acm.graphics package developed by the ACM and SIGCSE Java task Force,in particular the turtle graphic

  • Ejb project

    Hi, i am doin java client proxy in XI.i ve imported the beans generated from XI into an EJB project in NDS and have changed the ejb-jar.xml accordingly.However the "BUILD EJB ARCHIVE" option is not enabled.Can anyone help? Regards, Divya

  • Corrupt Lookout 6.1 file - and lks won't compile

    I have a corrupt lookout 6.1 file - reports 'not a lookout process file' and when I go to recompile the lks the cbl is reporting an error and crashing.  Is there anything I can do. Any help would be appreciated.

  • Regarding ABAP program to read and manipulate data from Excel file....

    Hi, I want to write a ABAP program which will read Excel file which has three columns viz: Col A, Col B and Col C. If there is no data in Col B and Col C for a given record in Column A, then progam should print all those records on screen with write

  • I've cracked the screen of my iPad 3... What can I do?

    Having dropped my iPad I've just noticed two hairline cracks across the screen. Can I have it repaired / replaced by Apple or do I have to live with the flaw?