Bean confusion - questions - beginner

jsp A
<jsp:useBean id="searchHeaders" scope="session" class="database.Tool"/>
<p><c:out value="${searchHeaders.searchHeaderMap}"/> // This shows my bean info
<p><a href="/<c:out value="${param.newID}"/>/searchTooling.jsp?newID=<c:out value="${param.newID}"/>">Tool Lookup </a>Quick Background
When a user clicks on the above link they are taken to a form with two input fields where they can search by an asset number or a serial number. However, depending on what site they are on - the wording might be different - asset number might be called quality number or something else.
<jsp:useBean id="searchHeaders" scope="session" class="database.Tool"/> 
<c:forEach var="i" items="${searchHeaders.searchHeaderMap}" varStatus="status">
          <c:forEach var="h" items="${i.key}" varStatus="status">
              <c:choose>
              <c:when test='${(i.key) <= "2"}'>
                  <c:forEach var="d" items="${i.value}" varStatus="status">
                  <td><c:out value="${d}"/><INPUT TYPE='text' NAME='<c:out value="${d}"/>' SIZE='30'></td> 
               </c:forEach>     
              </c:when>
              </c:choose>
          </c:forEach>
          </c:forEach>My problem is that jsp A has the bean information showing but once I click on a link the bean information doesnt show until I submit the form on jsp B( which forwards back to jsp B through servlet). I thought that once I called the bean and put it in a session scope I would be able to use it/call it until I expired the session...
How can I share a bean between two jsp's without using a form?

First of all - sorry if my terms dont make sense - still new and learning. I dont understand what you are asking me..
Here is the servlet that is calling/creating the bean
public class tooling_index extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        DataFactory dbf = DataFactory.getDataFactory(DataFactory.sybase);
        ToolSearchInformation searchInfo = dbf.getToolSearchInformation();
        Tool searchHeaders = searchInfo.findSearchTableHeaders(newID);
        request.setAttribute("searchHeaders", searchHeaders);
        RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/index.jsp?newID="+ newID);
        dispatcher.forward(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        doGet(request, response);
}This forwards to my jsp A. Is this what you are asking ?

Similar Messages

  • EJB: Stateless Session Bean create() Question.

    Lets say I have a stateless session bean that fetches data from my database. The point of the bean is to just do large SQL searches and funnel data back to the client. The prolem I have is that I am somehow fighting memory leaks. Despite having checked the code a number of times, the memory usage on my appserver continues to climb no matter what I do. I have theorized that the problem might be in the way Im using ma DataFetchBean (DFB).
    When I start the client, he obtains a user session. This is a stateful session bean that he uses for almost all communication with the server. Then I call "getDataFetchBean" in the user session which calls DataFetchBeanHome.create(). Then the client holds onto the returned reference, using it for the live of his connection. As he disconnects, he calls remove on the bean.
    Question is this:
    1) Is it better for me to call create() prior to each call to the stateless session bean ?
    2) Do you have any theories on why im loosing memory with this setup?
    TIA
    -- Rob

    1. But I thought you were using a 'stateful session bean'?
    2. For stateless session beans, there is no direct link between a remote reference and an instance of the bean. It is safe to hang on to the remote reference as long as you would like, of course it may go stale if the server dies. You will also find that the create() method does not actually contact the server, so doing it each usage costs very little. So, either way you should be fine.
    3. As for memory leaks, make sure that you are closing all statements, result sets, etc. promptly. These are commonly the problem. Also, use hprof or some other profile tool to determine what types of data you are allocating and (with better tools) what types of data you may be holding on to references to.
    Chuck

  • A tough one for EJB experts - Stateless session bean spec question

    I am busy learning more about EJBs and came across something confusing regarding the legal operations in the various container callback methods for stateless session beans.
    Specifically, the EJB spec states that in the ejbCreate() method, the SessionContext can be used to obtain a reference to the EJB Object. Now this makes perfect sense with stateful session beans, since the ejbCreate() method isn't called until a client is creating a bean and the container has linked that bean to the client's EJB Object. However, it is my understanding that when it comes to stateless session beans, the container creates the beans and adds them to the bean pool at its leisure. It is not until a business method is called by a client that a stateless bean is actually linked to an EJB object. So, how is it that a stateless bean could ever obtain a reference to an EJB Object from within ejbCreate(). Which EJB Object would it be linked to? This operation just doesn't appear to make sense in that context.
    Can anyone clarify this for me?

    Interesting question. I have such questions all the time! Here's a link to a similar discussion
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=70&t=000905
    Also, I tried this using Weblogic 8.1. Tried to access the EJBObject in ejbCreate before any business method was invoked. I did this by specifying a value for initial-beans-in-free-pool and found that the hash code for the EJBObject was the same for all the bean instances that were created on startup.
    I then invoked a business method and accessed the EJBObject in that method. Again the hash code for the object was the same as the one created on startup.
    Seemed to be that there is a 1:n relation between the EJBObject and bean instances.
    This may be container specific. The spec says the user should be able to invoke the getEJBObject() method in ejbCreate(), its upto the container to comply with it.

  • Stateless Session Bean + EJB Question + Jboss

    Hello,
    If I have a stateless session bean on a linux machine and it works locally what do i need to do to access a method in the session bean from a remote windows machine.
    I would like to be able to execute my client jar file on a windows machine and have it access the jboss server on the linux machine. what do i need to do?
    i have the session bean working locally on both windows and linux machine. do i need to to have a JSP/Servlet to access the session bean? can the session bean not be accessed directly? what should my classpath look like? do I need to include extra jar files in my client jar file.?
    Thanks,
    Joyce

    Thanks guys for the help but I am still a little lost.
    My Client windows machine has the client jar file and all the other jar files. This is my client class
    package helloworld.client;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.util.Hashtable;
    import java.util.Properties;
    import helloworld.interfaces.HelloWorldHome;
    import helloworld.interfaces.HelloWorld;
    public class HelloClient
         public static void main(String[] args)
              Hashtable prop = new Hashtable();
              prop.put ("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
              prop.put ("java.naming.provider.url","jnp://172.16.220.160:1099");
              prop.put ("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
              try
                   Context ctx = new InitialContext(prop);
                   Object obj = ctx.lookup("ejb/helloworld/HelloWorld");
                   System.out.println(obj);
                   HelloWorldHome home = (HelloWorldHome)javax.rmi.PortableRemoteObject.narrow(obj, HelloWorldHome.class);
                   HelloWorld helloWorld = home.create();
                   String str = helloWorld.sayHelloEJB("JOYCE is COOL");
                   System.out.println(str);
                   helloWorld.remove();
              catch(Exception e)
                   e.printStackTrace();
    I get a NullPointer ie the home object is null. The IP address is the IP of the Linux machine that has Jboss running on.
    Questions are:
    1. Do I need to have Tomcat running on my client machine if I am to connect via HTTP? Does this alter my client code.?
    2. My JNDI lookup is what is causing the problem. Does my jboss.xml and my ejb-jar.jar look okay to you.
    jboss.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
    <jboss>
    <enterprise-beans>
    <session>
    <ejb-name>helloworld/HelloWorld</ejb-name>
    <jndi-name>ejb/helloworld/HelloWorld</jndi-name>
    </session>
    </enterprise-beans>
    <resource-managers>
    </resource-managers>
    </jboss>
    ejb-jar.jar
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar >
    <description>No Description.</description>
    <display-name>Generated by XDoclet</display-name>
    <enterprise-beans>
    <!-- Session Beans -->
    <session >
    <description><![CDATA[No Description.]]></description>
    <ejb-name>helloworld/HelloWorld</ejb-name>
    <home>helloworld.interfaces.HelloWorldHome</home>
    <remote>helloworld.interfaces.HelloWorld</remote>
    <ejb-class>helloworld.session.HelloWorldBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    <!--
    To add session beans that you have deployment descriptor info for, add
    a file to your merge directory called session-beans.xml that contains
    the <session></session> markup for those beans.
    -->
    <!-- Entity Beans -->
    <!--
    To add entity beans that you have deployment descriptor info for, add
    a file to your merge directory called entity-beans.xml that contains
    the <entity></entity> markup for those beans.
    -->
    <!-- Message Driven Beans -->
    <!--
    To add message driven beans that you have deployment descriptor info for, add
    a file to your merge directory called message-driven-beans.xml that contains
    the <message-driven></message-driven> markup for those beans.
    -->
    </enterprise-beans>
    <!-- Relationships -->
    <!-- Assembly Descriptor -->
    <assembly-descriptor >
    <!-- finder permissions -->
    <!-- transactions -->
    <!-- finder transactions -->
    </assembly-descriptor>
    </ejb-jar>
    Do I need RMI ? Do I need to concern myself with CORBA? All Im looking for is a step by step to understanding what I need to configure? Is their some way I can debug?
    Thanks alot,
    Joyce

  • Oracle BI Mind Confusing Questions

    Hi,
    I am new to Oracle BI. I have been reading documents, tutorials, oracle by example guides and watching some videos.
    But I cannot answer some questions which are confusing my mind.
    1-) Why we have 3 repository layer? In the tutorials, they are dragging objects from physical layer to business model and mapping layer. In this layer they are renaming table names. Then they are dragging objects from Business Model to Presentation Layer. In this layer they are renaming table names again and they are deleting some columns. I think that we can use just physical layer and presentation layer. In presentation layer we can rename table names and remove some columns.
    2-) In physical layer, we are importing objects from data sources. We can import tables, views and foreign keys. What is the best practice for designing business model?
    I created a test repository. I imported tables, views and foreign keys from database. But when I try to check consistency ( afte preparing presentation layer), I took error messages about self joins in the physical layer. Can I solve self join problem?
    3-) Should I import only tables and views from database in physical layer? I think that if I do not ceate joins manually after import operations, Oracle BI Server may not prepare correct sql statements.
    We have a big database (maybe 500 tables), so if I dont import foreign keys, manually creating foreign keys will be a massive manual process. I also do not know which foreign keys are mandatory for a well designed business model?
    4-) When database tables changed( for. ex. added new column), are these changes automatically updated to the physical layer?
    Thank you..
    Edited by: user4030266 on Mar 24, 2011 1:58 PM

    3-) Should I import only tables and views from database in physical layer? Yes you need to import tables, you can create views on those tables if you want in physcial layer.
    I think that if I do not ceate joins manually after import operations, Oracle BI Server may not prepare correct sql >statements.Yes you need to give proper joins between fact and dimension tables in physical and bmm layers.
    We have a big database (maybe 500 tables), so if I dont import foreign keys, manually creating foreign keys will be a massive manual process. I also do not know which foreign keys are >mandatory for a well designed business model?Need to do datamodeling(ETL process first).Convert OLTP to OLAP(into facts and dimesnions) so that you will come to know regarding table and join conditions.
    In BMM layer we write logics,create our own logical tables with logical columns,hierrarchies.We use only columns that we need in this layer and write logics upon them.
    Refer : http://www.oraclebidwh.com/2010/10/obiee-bmm-layer-design-principalsbest-practices/
    Regards,
    Srikanth

  • Bean, Serialization Question

    Who can give me a good explanation of JavaBean. Or a good URL with examples.
    What are the advatages of java beans, how ca I write one.
    And what has it to do with Serialization.
    Serialization where is it used? Examples.

    There's nothing special about a JavaBean. In broad terms a JavaBean is simply a Java class that has been written using a particular style.
    The most notable points are:
    1) default constructor - ie, a constructor with no arguments
    2) property accessors - eg, public String getName(), public void setName(String name), public boolean isEnabled()
    The advantage is that you don't need to know about a JavaBean to use it - the methods indicate the various properties available and their data type. So Java can use Reflection to examine the bean and use it appropriately. In other words, you can find out and use the methods an Object has without knowing about its class in advance simply by examining their names.
    A good example would be a visual component (like a button). By following the JavaBean conventions you end up with a class that can be distributed to other people and they can just plug it into their applications. Think of how a visual GUI editor gives you a property window for a component - this is simply exposing the information it derives by looking at the bean's method signatures.
    There are other things that add extra value to JavaBeans like bean info classes and editor components but that's usually just confusing until you understand beans and their power.
    Have a look at http://java.sun.com/products/javabeans (I think)
    Serialisation is a somewhat different matter. This basically involves "saving an object". You can get a single instance of a class to be written to (eg) the filesystem and then load it again later. Obviously you can write your own methods for saving an object's state but serialisation is automatic and standard allowing it to be employed by other applications without knowledge of the objects that they're dealing with. Again, as with something like JavaBeans it enables you to represent the state without knowing about how the bean works. For example, a distributed application might serialise an object to transmit it between client and server. Note that serialisation does not require that the class being serialised follows the JavaBeans conventions, though - it's kind of a Java no-brainer if you like.
    It would take a long time to explain the full benefits of JavaBeans and serialisation, however.
    Hope this helps.

  • SCJP confusing question

    Hello guys,
    Recently I came across one web-site with mock-up SCJP questions. One of the questions and especially provided answer to it really grabs my attention:
    Can one object access a private variable of another object of the same class?
    Answer: Yes.
    Private means "private to the class", NOT "private to the object". So two objects of the same class could access each other's private data.
    If it would be true it violates the encapsulation principle of OO. Can you please explain this question/answer because it is really confusing me.

    All kidding aside here - ask yourself: "Why would I want to make anything private in a class?". Then you might answer "Well, for one thing I do not want to be able to de-stabilize the class when I use it for what it is."
    An example of such use is any use of the API classes from SUN. No instantiated Object from these has access to the private members, unless though public methods - which control such access.
    But you might ask: "And why would I want to take that ability away from the class itself?" Well: "In answer you maight say that you would not want to, and continue by saying that's not what you mean."
    Well since one would need to build in that capability - the previous example used an inner class with a change method - this is not the same as allowing outside access. If you tried to do something like from another toplevel public class without any public alteration methods in the member class you couldn't do it - you'd get a "x has private access in y" type message.
    ~Bill
    .

  • GT70 - Win7 / Win8 BIOS - Confused + Questions

    I tried posting this in the BIOS forum but I didn't get any responses. I'm not sure if I should have posted here first.
    I have a GT70 Dominator Pro 890. It came with Windows 8.1 preinstalled. I don't want Windows 8.1; I'll be blanking the hard drive and installing Windows 7.
    Since this computer has separate Windows 7 and Windows 8 BIOS's available for download, this leads me to think that I need to change the BIOS from the "Windows 8" version to the "Windows 7" version. But there seems to be conflicting information on the Internet about this. Some posts say you can and should do it, others say you can't and shouldn't do it.
    So, my questions are:
    1) Should I be changing / flashing the BIOS from the "Windows 8" version to the "Windows 7" version for running Windows 7, and
    2) If not, should I continue to upgrade with the "Windows 8" BIOS version, even though I'm running Windows 7, and
    3) Will Windows 7 have any issues or not run right since the computer is running the "Windows 8" BIOS version?
    I *am* using two SATA drives in mirror RAID mode.
    The other thing that confuses me, is how (even for each Win7 / Win8 BIOS version), there are again two different versions.
    In the case of the GT70 Dominator 890 Pro, there is a version "50" for "WIN8 Default AHCI Mode", and version "70" for "WIN8 Default RAID Mode" (and a version 30 and a version 10 for the same two modes for Windows 7).
    Wouldn't the Default AHCI mode or Default RAID mode be something that the user specifies in the BIOS? Why would there need to be a totally separate BIOS version for these two different modes? (I thought RAID already has AHCI enabled?)
    Having four BIOS versions for the same computer is pretty distressing considering that I might brick it by installing the wrong one.

    Quote from: AllNight on 08-May-14, 17:03:50
    I tried posting this in the BIOS forum but I didn't get any responses. I'm not sure if I should have posted here first.
    You won't get always immediatelly response, + don't open new topics for the same subject
    >>Please read and comply with the Forum Rules.<<
    i've just deleted your 1st topic that you opened earlier, since you opened a new one duplicate here.
    Quote
    1) Should I be changing / flashing the BIOS from the "Windows 8" version to the "Windows 7" version for running Windows 7, and
    2) If not, should I continue to upgrade with the "Windows 8" BIOS version, even though I'm running Windows 7, and
    3) Will Windows 7 have any issues or not run right since the computer is running the "Windows 8" BIOS version?
    to 1: No
    to 2: Yes
    to 3: Should be fine
    Quote
    I *am* using two SATA drives in mirror RAID mode.
    The other thing that confuses me, is how (even for each Win7 / Win8 BIOS version), there are again two different versions.
    In the case of the GT70 Dominator 890 Pro, there is a version "50" for "WIN8 Default AHCI Mode", and version "70" for "WIN8 Default RAID Mode" (and a version 30 and a version 10 for the same two modes for Windows 7).
    Wouldn't the Default AHCI mode or Default RAID mode be something that the user specifies in the BIOS? Why would there need to be a totally separate BIOS version for these two different modes? (I thought RAID already has AHCI enabled?)
    Having four BIOS versions for the same computer is pretty distressing considering that I might brick it by installing the wrong one.
    what is your current stock bios version?

  • Confusing question re apple id's as it relates to match

    i have my old apple id that i've used for years - for app and music purchases, etc. when i got my iphone 4s, i set it up using the apple id associated with my mobileme account... thinking that it would make sense for the migration to icloud. so now i want to use match... i purchased it in itunes using the old id (the one i use for purchasing apps) and when i go to turn match on on my iphone, it's requesting the password of the apple id associated with my icloud service!
    forgetting about the $25 i spent for a sec, i'm reluctant to repurchase through itunes using the apple id associated with my icloud service because then all the apps i purchased with the other apple id won't get updated, authorized, etc.
    how do i resolve this?
    thanks.

    I have exactly the same problem here; just wrote to Support about it. Hope there's a resolution to this soon, as I really look forward to using the service. The whole multiple ID thing is very confusing. I'd like to be able to seamlessly link them all.

  • EJB 3.0 stateless bean + web client (beginner)

    Hello,
    I've just read the Sun tutorial on EJBs in Java EE 5 and I'm trying to get something nice and simple to work. My code is below:
    Bank.java:
    package beans;
    import javax.ejb.Remote;
    @Remote
    public interface Bank {
         public void transfer(long source, long destination, long amount);
    }BankBean.java:
    package beans;
    import javax.ejb.EJBException;
    import javax.ejb.Stateless;
    @Stateless
    public class BankBean implements Bank {
         public void transfer(long source, long destination, long amount)
              System.out.println("This method is not yet implemented.");
              throw new EJBException("Method not implemented.");
    }index.jsp (web project):
    <%!
    private Bank bank = null;
    public void jspInit()
        try {
            InitialContext ic = new InitialContext();
            bank = (Bank) ic.lookup(Bank.class.getName());
        } catch (Exception ex) {
            System.out.println("Couldn't create bean." + ex.getMessage());
    %>Everything compiles with no errors or warnings, but an exception is thrown. The message is "beans.Bank not found".
    I have not modified any .xml files, I don't recall the tutorial saying I have to.
    I'm using Eclipse 3.2 WTP and it doesn't recognize that I have any Session beans... not 100% sure that EJB 3.0 is supported by it. I ended up creating a basic Java project to store the beans because an EJB project was saying that I need at least one bean.
    Thank you in advance for suggestions.
    Pavel

    While looking up why don't you use the fully
    qualified jndi name"java:/comp/ejb...."?
    What's the benefit of that?It's portable. Any direct access of a global JNDI namespace is not portable.
    Also, it's "java:comp/env", not "java:/comp/env".
    >
    Is it possible to use annotations in JSPs?No, annotations are not supported in JSPs for Java EE 5. In the web tier
    they can be used in certain managed classes such as servlets.
    Regarding your original posting, how exactly did you deploy the ejb? If you
    got a message saying the ejb-jar had no ejbs, that sounds like the root of
    the problem. If the ejb-jar only contains a single EJB 3.0 bean and that
    bean uses EJB 3.0 annotations instead of a deployment descriptor, make
    sure there is no ejb-jar.xml. It's possible that Eclipse packaged an
    EJB 2.1 - based ejb-jar.xml descriptor inside the ejb-jar. In that case,
    the app server will assume it is an EJB 2.1 app and not process any
    annotations.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • File adapter questions (beginner)

    Hi everyone,
    I two questions on two topics about file adapter.
    1. I have set up a File adapter for a CSV file to be the input file of my process. Now I would like to have an XML file as the input file, but the content is always ignored.
    here is the XSD :
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Employees" xmlns="urn:Employees">
    <xs:element name="Employee" type="EmployeeType"/>
    <xs:simpleType name="InitialType">
    <xs:restriction base="xs:string">
    <xs:maxLength value="1"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="AgeType">
    <xs:restriction base="xs:integer">
    <xs:minInclusive value="18"/>
    <xs:maxInclusive value="50"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="EmployeeType">
    <xs:sequence>
    <xs:element name="EmployeeID" type="xs:string"/>
    <xs:element name="FirstName" type="xs:string"/>
    <xs:element name="MiddleInitial" type="InitialType"/>
    <xs:element name="LastName" type="xs:string"/>
    <xs:element name="age" type="AgeType"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    And now the sample XML file :
    <?xml version="1.0" standalone="yes"?>
    <Employees>
    <Employee>
    <EmployeeID>1</EmployeeID>
    <FirstName>John</FirstName>
    <MiddleInitial>N</MiddleInitial>
    <LastName>Smith</LastName>
    <age>24</age>
    </Employee>
    <Employees>
    How can I do that ? Do I need the Oracle XML Gateway ?
    2. In the BPEL console, I can trace the successfull processes. Alright ... But when I put in a file with the wrong format (eg: missing fields), the process does not even appear in the console. How can I trace them ? (completionPersistPolicy is "on").
    Thank you :)

    I'm interested in 2 question (missing fields) too.
    Ema

  • Design questions - beginner

    Hello,
    I'm just getting started with BDB XML and the resources here have been very helpful. To play around with it, I imported 100,000 records from my relational db into BDB XML. I imported it as one document that sort of looks like this:
    <people>
    <person><name>John></name><age>22</age></person>
    <person>..</person>
    ...100k times
    </people>
    Querying this database using dbxml.exe has been extremely slow, even after using indexes. So, I have the following questions:
    1. Should I import it has a single document containing 100k children, or is it better to import it as 100k different documents?
    2. Are there any resources available for best practices in designing the XML database, especially from the PoV of a relational database designer?
    Thanks
    Amit

    Amit,
    Using the correct indexes and release 2.3.10 your performance should be reasonably good even with a single, large document. In general, it can be better to use individual documents, especially if you want to add/remove them individually. If there is no need to keep them as one document, I'd recommend using separate documents.
    Also, if you want better answers on tuning queries, you need to provide more information, such as the indexes you've declared and the queries you are using.
    Regards,
    George

  • 3 dice random if else questions beginner

    Hi all,
    I have searched my brain, and the internet for help, to no avail, I cannont find any. I am new to Java Programming. Sometimes I do not understand my instructor, he confuses me. I have to write a small program that includes tossing 3 dice. any pair is 100, any 3 of a kind (except 6's) is 200, and toss 3 sixes to get 300. I can get my code to work, but not correctly. I've tried the && and ||(or) when the ||(or) is used, for pairs, 3 of a kinds are paid 100. Is this confusing?
    I guess...
    if ((die1 == die2) && (die2 == die3) && (die1 == die3)) {
    resultTextField.setText("Winner 200!");
    else {
         resultTextField.setText("Try again?");
    This works great. but, when I try other ways say with the ||(or)
    it throws everything off
    I'm stumped, maybe I have logic block or something.
    If any one can help, this would be great.
    I'm sure its easy for someone, after all, I'm at the beginning stages.

    multipost
    http://forum.java.sun.com/thread.jspa?threadID=774839

  • Java.io in J2ee stateless session bean, general questions about debugging

    Doing conventional Java IO (with java.io functions and classes such as
    PrintWriter and println) in a Enterprise bean has been discussed before
    in this and other forum. We know that the EJB specification says not to do it.
    (For example the EJB 2.0 spec, 24.1.2) says that an enterprise
    bean must not use the java.io package to attempt to access files and
    directories int he file system."
    The discussion in various forums including this one is that
    a) using java.io in a bean would impact portability, ability to
    move the bean for load balancing
    b) However, this is not always an an issue and it may be reasonable
    to use these functions anyway. e. g. see the response by "maozhoulu"
    on Jun 21, 2002.
    I tried it in Sun Application Server Nine in my stateless Session Bean:
    package RS;
    import RS.CourseHome;
    import RS.CoursePK;
    import java.rmi.RemoteException;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.rmi.PortableRemoteObject;
    import javax.ejb.EJBException;
    import java.io.*;
    public class AddCourseBean implements javax.ejb.SessionBean {
       public void ejbCreate(){};
       public void CreateCourse (int CourseNumber, String CourseName) {
        try {
         System.out.println("in Create Course");
         PrintWriter F = null;
         try {
          F = new PrintWriter (new FileOutputStream("/tmp/v/af"));
         catch (java.io.FileNotFoundException fe){}
         F.println ("here zero");F.flush();
         InitialContext jndiContext = new InitialContext();
         F.println ("here one");F.flush();
         Object o = jndiContext.lookup("ejb/X");
             ...I got a Null pointer exception on the line:
    "F.println("here zero"); Is there anyway one can do simple debugging with print lines in one's beans?
    Or is there something obviousthat I am overlooking? (I saw mention of doing
    debugging with System.out.println but to where would the bean write?)
    I tried using the Jakarta Commons Logging, but I got a
    java.lang.NoClassDefFoundError on org/apache/commons/logging/LogFactory
    Which logging system does one use in GlassFish, hopefully one with minimal
    configuration? I want to do some debugging, not set up logging for a full
    enterprise system.
    Thanks for your insight and advice.
    Dr. Laurence Leff, Associate Professor of Computer Science WIU ST447 61455
    Pager 309 367 0787, Fax 309 298 2302

    My apology for posting this message twice. I looked for it before and
    did not see it. I thought I forget to click the "Post message" button.
    Also, I did resolve one problem. System.out.println does go to
    the log file, which in my case turned out to be:
    /opt/j2ee/SUNWappserver/domains/domain1/logs/server.log
    (Obvously, the first part would vary based upon where you installed your
    Application Server Nine.)
    However, it would be nice if there was some way to use FILE I/O inside of
    beans. I am teaching some J2EE in the graduate software engineering course,
    and I believe this would be pedagogically sound even if other techniques
    would be appropriate for a production environment.
    Thanks for your patience with this problem and my duplicate post.

  • Special effect question - beginner

    I am a beginner at video editing.  In fact, I have never edited a video before.  My kids have a video with a wizard wand and want to have a lightning bolt come out of it and we can insert items to look like they created with magic.  Is this something this software can do?  Are there "stock" flash lightning bolts etc?  I am looking for a product to purchase that I will be able to figure out easy or get assistance.
    Thanks

    Hi braxpark,
    After Effects would be the place to add the lightning bolt effect to your video in Premiere Pro.
    The two products work together easily: How to work on After Effects projects in Premiere Pro (and vice-versa) | Adobe Premiere Pro CC tutorials
    Regarding the effect you're interested in, you can learn more here:
    Effects info here: http://helpx.adobe.com/after-effects/using/generate-effects.html#advanced_lightning_effect
    Lightning effect tutorial: http://www.videocopilot.net/tutorial/lightning_strike/
    Search Google on "lightning effect after effects" for more possibilities.
    Hope this helps!
    Stefan

Maybe you are looking for