J2EE Best Practices on Cache (I know there's a lot of answers but...)

Hello friends,
i'm developing a JSP-Servlet MVC application and I have the following problem. I want to control errors at low level, so i want to permit send a form, presenting a error message in a new window with a back button that cals history.back(). The problem is that I want that user data must not be rewrited. I hope that form backs to exactly the same point before user submits. When i play with the cache headers, all i get is have the data back, but when i try to submit from selects or change anything ans submits, the response is the same, like if I repaeat the same inputs.
I tried cache-control: no-cache,no-store,post-check=0,pre-ceck=0
and the HTTP1.0 pragma no-cache
all with expires clausule. But i can't get what I want. Browser disables submit button, and if not I have problems with selects onchange (which acts in fact like a submit by the button) and when I fight that troubles, then I find that user must rewrite the form data during a histroy.back() event.
So my question is, once i said all this things, which is the best way to implement that functionality??
Please help me it's very improtant for me, i've read HTTP RFC inclusive, but I just don't get it after combine everything from my JSP filter (setResponse).
Thank you very much in advance, hope you can help me

What kind of TV is it?
The most common way to hook up a laptop to an external display is with the VGA connection.
VGA connections are fairly common on modern flat panels. If you're trying to connect to a standard definition CRT(tube) TV, an s-video video connection may be possible if both the laptop and TV support s-video. Quality will be poor, however.
Disclosure: Former BBY employee.

Similar Messages

  • My ipad mail is synced to my iMac mail account. On iPad, I can only see my inbox and sent messages. I can't see any of the folders I have created on my iMac. How do I do that? Probably a dumb question, but I know there's a lot of smart people out there!

    My iPad mail is synced to my private email account, which I organise on my iMac. On iPad, I can only see inbox and sent messages folders, not any of the other folders in my email account I have created on my iMac. How do I get iPad to show my other folders? Probably a dumb question, but I know there's a lot of smart people out there.

    If you select a mailbox, you should get an Edit button (easier to see in landscape mode). Clicking the button will provide you with check circles for the messages. You also get Delete and Move buttons at the bottom. Check the messages you want to move and then navigate to the mailbox you want to drop them into. I think as long as you can navigate to a mailbox you can move the messages to it.
    In the Mac Mail application and probably Outlook on the Windows side, you also setup rules to move messages to specific mailboxes. If the mailboxes are stored on the server, then you can have the sorting done on the server and they should appear that way on the iPad. If your later messages do not show up, you may need to have the iPad app pulled down more messages until they are all showing.

  • Connect JavaFx(Applets) to J2EE - best practice & browser session

    Hi there,
    I’m new to JavaFX and Applet programming but highly interested.
    What I don’t get at the moment is how you connect the locally executed code of the applet to your system running on a server (J2EE).
    Of course there seem to be different ways but I would like to avoid using RMI or things like that because of the problem with firewalls and proxies.
    So I would like to prefer using HTTP(s) connection.
    And here my questions:
    1.) Is there any best practice around? For example: using HTTP because of the problems I mentioned above. Sample code for offering java method via HTTP?
    2.) Is there a possibility to use the browser session? My J2EE applications are normally secured. If the user opens pages he has to login first and has than a valid session.
    Can I use the applet in one of those pages and use the browser environment to connect? I don’t want the user to input his credentials on every applet I provide. I would like to use the existing session.
    Thanks in advance
    Tom

    1) Yes. If you look at least at the numerous JavaFX official samples, you will find a number of them using HttpRequest to get data from various servers (Flickr, Amazon, Yahoo!, etc.). Actually, using HTTP quite insulates you from the kind of server: it doesn't matter if it run servlets or other Java EE stuff, PHP, Python or other. The applet only knows the HTTP API (GET and POST methods, perhaps some other REST stuff).
    2) It is too long since I last did Java EE (was still J2EE...), so I can't help much, perhaps somebody will shed more light on the topic. If the Web page can use JavaScript to access this browser session, it can provide this information to the JavaFX applet (JS <-> JavaFX communication works as well as with Java applets).

  • Feedback: ACME - J2EE Best Practices Sample

    Hi!
    Today I'd like to provide some feedback on the aforementioned samples one can download
    from the following location:
    http://otn.oracle.com/products/ias/files/J2EE_Best_Practices_Sample_Code.zip
    I hope you'll find it useful...
    I unzipped the file and followed the instructions given in ReadMe.html, created the database user and tables (Create_User.sql, Best_Practices_DDL.sql).
    Well no problems so far. Just a question. Why not using something like NUMBER(10,2) instead of FLOAT(10)
    for the cost of a product? But this is just a sidenote.
    Lets come to the real big mistakes in this example which make it hard to call this an example of best practices.
    1)
    Sign in as admin/admin and try to edit your profile! It won't work. In your browser you'll see the following message:
    "Validation Error
    You must correct the following error(s) before proceeding:
    Invalid Username, already exists. Please try again."
    And on your console:
    javax.ejb.ObjectNotFoundException: No such entity: admin
    javax.ejb.ObjectNotFoundException: No such entity: admin
    Digging into the source the flow is:
    UserEditAction.java -> UserForm.java -> user.jsp -> UserSaveAction.java (getting action "edit") ->
    User.java -> CustomerUtility.java -> UserFacadeBean.java -> ...
    Lets have a look in the reverse order starting with UserFacadeBean.updateCustomer(User user):
    Line 54: CustomerEJBLocal customerLocal = userLocalHome.findByPrimaryKey(user.getID());
    Looks good, as far as user.getID() returns the primary key. Lets skip CustomerUtitity because it only
    locates the SessionFacade and passes the user object without modifications.
    User.java is the value object created in UserSaveAction.perform:
    Line 25: user.setID(((UserForm) form).getUserName());
    Line 26: user.setUserName(((UserForm) form).getUserName());
    Line 25 is obviously wrong. There are different possibilities to fix this. One quick (and dirty) change would be to alter
    CustomerEJBLocal customerLocal = userLocalHome.findByPrimaryKey(user.getID());
    in:
    CustomerEJBLocal customerLocal = userLocalHome.findByUsername(user.getID());
    or effectly the same and far better to understand:
    CustomerEJBLocal customerLocal = userLocalHome.findByUsername(user.getUserName());
    May be this was the intended solution. By the way there is no unique key on customer.username in the database. Another solution is to use the primary key. But then you have to alter the application starting at UserEditAction.java. You'll probably know what to do...
    2)
    This problem should only occur if your NLS_NUMERIC_CHARACTERS is set to ",.". Nevertheless the root cause is bad programming. Look for
    String getCost() and setCost(String ...)
    or
    String getTotalCost() and setTotalCost(String ...)
    or
    return "" + _cost;
    and so on.
    Ugly... and remember the database field is a FLOAT(10)!
    The mapping in orion-ejb-jar.xml looks like that:
    <cmp-field-mapping name="totalcost" persistence-name="TOTALCOST" persistence-type="FLOAT(10)"/>
    That's why you'll get an ORA-01722:INVALID NUMBER exception during the cast.
    A String '123.12' is wrong if you have a database with German NLS settings for example.
    Anyway one should NEVER use Strings in such a place. I'd strongly recommend that you remove both issues!
    Besides this, I would like to thank you for providing samples on OTN. They are of great value for beginners like me. Perhaps you could just try to test the examples more seriously. Especially for beginners it's hard to believe that there should be something wrong in those samples.
    This could end up in frustrated users thinking they are as thick as two short planks. :-)
    Regards,
    Eric

    Hello Eric -
    Thanks for the feedback, it is very helpful and appreciated.
    1)Sign in as admin/admin and try to edit your profile! It >won't work. In your browser you'll see the following >message:"Validation ErrorWe've rectified this problem and the new zip file should appear on OTN within 24 hours.
    The root cause was an error in one of the SQL scripts that populated the "customer" table.
    The response from the developer responsible for this application is pasted below.
    The first error is a data >error. I did make it where >username and id are both actually the username, so the >code referencing the username as the id was just a >shortcut. There really is not a need for both the >username and id fields in this example.
    Both should be constrained to be unique with the id >actually being the key. I originally
    was going to allow users to change their usernames, that >is why both the username and id fields.
    In the released version of the DDL file the id is not set >to the username.[it should read]
    insert into "ACMEADMIN"."CUSTOMER" values ('admin',
    'Administrator', '555 Elm St. NoWhere USA', >'555-555-5555', 'admin', 'admin');cheers
    -steve-

  • New to J2EE; Best Practices

    Hi everyone, and thanks in advance for all of your help.
    I'm somewhat new to J2EE, at least in the sense of creating my own application. I work for a small software company in New England, and have to work on an enterprise application as part of my job; unfortunately, I don't get much exposure to the total of J2EE. Instead, most of my work is on small extensions, database scripts, or external projects that don't quite give me the exposure I'm looking for.
    As an exercise, I've decided to put together a sample J2EE application. I've spent time reading the (many) J2EE tutorials out there, but I'm having trouble putting it all together. This application works, but I know that I've used some bad patterns, and was hoping to get some feedback. My application consists of 4 Java classes and 8 JSPs, but none over 100 lines, and only 1 above 50.
    One final note before I start: yes, I know there are some frameworks out there that would help; I plan on migrating to Struts at some point. However, I wanted to make sure I understand the core J2EE structure before I delved into that.
    My application simply allows a user to add, edit, or delete entries in a database. The database consists of 1 table (Projects), with two fields: an id, and a name.
    The first page, Projects.jsp, lists the current projects in the database for the user:
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page pageEncoding="UTF-8" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <jsp:useBean id="projectsDAO"
                 class="com.emptoris.dataAccess.ProjectsDataAccessObject"
                 scope="application" />
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>Projects</title>
      </head>
      <body>
        <form name="projectsForm"
              action="<%= response.encodeURL("ProjectsController.jsp") %>"
              method="post">
          <c:if test="${projectsDAO.projects.numberOfProjects > 0}">
            <table>
              <tr>
                <th>Select</th>
                <th>ID</th>
                <th>Name</th>
              </tr>
              <c:forEach items="${projectsDAO.projects.projects}" var="project"
                         step="1">
                <tr>
                  <td>
                    <input type="radio" name="projectId" value="${project.id}" />
                  </td>
                  <td><c:out value="${project.id}" /></td>
                  <td><c:out value="${project.name}" /></td>
                </tr>
              </c:forEach>
            </table>
            <input type="submit" name="action" value="Edit Project" />
            <input type="submit" name="action" value="Delete Project" />
          </c:if>
          <input type="submit" name="action" value="Add New Project" />
        </form>
      </body>
    </html>The ProjectsDataAccessObject is a class that simply mirrors the table in the database. Adding, editing, or removing entries in this class will modify the database accordingly:
    package com.emptoris.dataAccess;
    import java.sql.*;
    import com.emptoris.model.*;
    public class ProjectsDataAccessObject {
        private Connection connection;
        private Statement statement;
        private Projects projects;
        public ProjectsDataAccessObject() throws ClassNotFoundException,
            SQLException {
            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
            connection =
                DriverManager.getConnection(
                    "jdbc:microsoft:sqlserver://AFRASSO:1433", "sa", "password"
            statement = connection.createStatement();
            statement.execute("USE test");
        public Project getProject(int id) throws SQLException {
            Projects projects = getProjects();
            Project project = projects.getProject(id);
            return project;
        public Projects getProjects() throws SQLException {
            if (projects == null) {
                projects = new Projects();
                String query = "SELECT id, name FROM Projects";
                ResultSet resultSet = statement.executeQuery(query);
                Project project;
                while(resultSet.next()) {
                    project = new Project();
                    project.setId(resultSet.getInt(1));
                    project.setName(resultSet.getString(2));
                    projects.addProject(project);
            return projects;
        public void addNewProject(Project project) throws SQLException {
            String query =
                "INSERT INTO Projects (name) VALUES ('" + project.getName() + "')";
            statement.execute(query);
            query =
                "SELECT MAX(id) FROM Projects";
            ResultSet resultSet = statement.executeQuery(query);
            resultSet.next();
            project.setId(resultSet.getInt(1));
            projects.addProject((Project) project.clone());
        public void removeExistingProject(int id) throws SQLException {
            String query =
                "DELETE FROM Projects WHERE id = " + id;
            statement.execute(query);
            projects.removeProject(id);
        public void updateExistingProject(Project project) throws SQLException {
            String query =
                "UPDATE Projects SET name = '" + project.getName() +
                    "' WHERE id = " + project.getId();
            statement.execute(query);
            projects.getProject(project.getId()).setName(project.getName());
    }So the first question I have is: is this appropriate? I've set up the data access object correctly? I feel like I'm basically reproducing the Projects class... do I even need this class anymore? I certainly don't use it in any of the JSP pages (as you will see).
    Also, I've simply added it to the application context here. Is that the correct way to create and access a data access object like this one?
    The second question is: the form's action parameter is a JSP page that acts as a semi-controller, reads the parameters from the form, and passes that information to a class, which then determines where next to send the application. Does this make sense? I'm not really sure of the idea of using a JSP page as a controller, but I don't know any other way to get the results of the form to the controller class.
    Here is the controller JSP, ProjectsController.jsp:
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page pageEncoding="UTF-8" %>
    <jsp:useBean id="projectsDAO"
                 class="com.emptoris.dataAccess.ProjectsDataAccessObject"
                 scope="application" />
    <jsp:useBean id="projectsController"
                 class="com.emptoris.controller.ProjectsController"
                 scope="request">
      <jsp:setProperty name="projectsController" param="action" property="action" />
    </jsp:useBean>
    <jsp:forward page="<%= response.encodeURL(
                               projectsController.getDestinationPage()
                           ) %>" />and here is the ProjectsController class:
    package com.emptoris.controller;
    public class ProjectsController {
        private String action;
        public ProjectsController() {
        public String getDestinationPage() {
            if (action.equals("Add New Project"))
                return "AddProject.jsp";
            else if (action.equals("Edit Project"))
                return "EditProject.jsp";
            else if (action.equals("Delete Project"))
                return "DeleteProject.jsp";
            return null;
        public void setAction(String action) {
            this.action = action;
    }I'll stop there. I think this is enough information to give me feedback on what I've done thus far. If I've been unclear about something, please let me know and I'll fill in the blanks, or post more code if necessary. Also, feel free to comment on other aspects of the design and style that you see in this code; I'm here to learn, so even if I haven't brought it up, that just means I don't yet see the issues of what I've done yet. :)
    Thanks again for all of your help!
    Regards,
    Anthony Frasso

    hi,
    My best advise not to for any IDE.
    If you do all the things manually, you will get the idea of the reason of doing. if you go with IDE, for ex, if you are creating session bean, IDE itself will create some files for you, these things you will not get to know.
    if you create these things manually, usually you will get lot of errors, so you will get lot of experience than using any IDE.
    if you are going to develop any project or application at that time you can use NetBeans or eclipse or some other ide u like.

  • McAfee keeps sending me messages to buy, I know there is a way to kill but no longer have the instructions

    I know there is a way to kill this advertising and I don't remember how.  Does anyone know how to do it?

    You do have to download something.
    Uninstall the McAfee product by following the instructions on whichever of the pages linked below is applicable:
    How to install or uninstall McAfee Internet Security for Mac
    How to manually remove VirusScan for Mac 8.6.x using a removal script
    How to uninstall and reinstall McAfee Agent 4.x on Macintosh computers
    Note that if you have already tried to uninstall the software, you may have to reinstall it in order to finish the job. If you have a different version of the product, the procedure may be different.
    Back up all data before making any changes.

  • Best Practice for caching global list of objects

    Here's my situation, (I'm guessing this is mostly a question about cache synchronization):
    I have a database with several tables that contain between 10-50 rows of information. The values in these tables CAN be added/edited/deleted, but this happens VERY RARELY. I have to retrieve a list of these objects VERY FREQUENTLY (sometimes all, sometimes with a simple filter) throughout the application.
    What I would like to do is to load these up at startup time and then only query the cache from then on out, managing the cache manually when necessary.
    My questions are:
    What's the best way to guarantee that I can load a list of objects into the cache and always have them there?
    In the above scenario, would I only need to synchronize the cache on add and delete? Would edits be handled automatically?
    Is it better to ditch this approach and to just cache them myself (this doesn't sound great for deploying in a cluster)?
    Ideas?

    The cache synch feature as it exists today is kind of an "all or nothing" thing. You either synch everything in your app, or nothing in your app. There isn't really any mechanism within TopLink cache synch you can exploit for more app specific cache synch.
    Keeping in mind that I haven't spent much time looking at your app and use cases, I still think that the helper class is the way to go, because it sounds like your need for refreshing is rather infrequent and very specific. I would just make use of JMS and have your app send updates.
    I.e., in some node in the cluster:
    Vector changed = new Vector();
    UnitOfWork uow= session.acquireUnitOfWork();
    MyObject mo = uow.registerObject(someObject);
    // user updates mo in a GUI
    changed.addElement(mo);
    uow.commit();
    MoHelper.broadcastChange(changed);
    Then in MoHelper:
    public void broadcast(Vector changed) {
    Hashtable classnameAndIds = new Hashtable();
    iterate over changed
    if (i.getClassname() exists in classAndIDs)
    classAndIds.get(i.getClassname()).add(i.getId());
    else {
    Vector vc = new Vector();
    vc.add(i.getId())
    classAndIds.add(i.getClassname(),vc);
    jmsTopic.send(classAndIds);
    Then in each node in the cluster you have a listener to the topic/queue:
    public void processJMSMessage(Hashtable classnameAndIds) {
    iterate over classAndIds
    Class c = Class.forname(classname);
    ReadAllQuery raq = new ReadAllQuery(c);
    raq.refreshIdentityMapResult();
    ExpressionBuilder b = new ExpressionBuilder();
    Expression exp = b.get("id").in(idsVector);
    roq.setSelectionCriteria(exp);
    session.executeQuery(roq);
    - Don

  • HT1657 Movie rental! I know there are a lot of problems

    I cannot watch my rental from iTunes! After I google it I'm not the only one and it's happened for years?!? I guess I wont be upgrading with apple!

    Joe Paradis wrote:
    I read that Mountain Lion slows down the system to a crawl and drains the battery.
    Could be for them, who knows.
    FWIW all of my systems run faster than Lion. Battery life is a tiny bit longer on the MacBooks.
    Back up your system and if you don't like it, you could always revert. You'll be out all of $20.
    I don't miss Lion, Snow Leopard, or any other OS X version, not a bit, and I have used every Mac OS there has ever been. If I preferred an earlier version, I'd be using it instead.

  • ITunes knows there is music on my iPhone, but it doesn't show up in iTunes!?

    I recently got a new laptop and today I downloaded iTunes onto it. I have to latest version of everything (4.3.2).
    I plugged my iPhone 4 into the laptop and everything downloaded well and everything is fine. iTunes recognises I have 779 songs on my phone and all the apps and videos and things. However, iTunes does not allow me to see these songs in iTunes itself. Under the 'Playlist' heading, it only says 'iTunes DJ, 90s music, Classical Music' etc that are default playlists.
    When I go onto the music page of my iPhone under 'Devices', I have to option to 'Sync music', but this then brings the capacity bar right down to hardly anything, so if I were to apply the changes, it would delete all of my current songs on the iPhone.
    I've looked everywhere and I don't know how to solve to problem. Please help!

    In regards to iTunes content, an iPhone can be synced or manually managed with music and video with an iTunes library on a single computer only. When transferring iTunes content from another computer, all iTunes content on the iPhone that was transferred from a different computer will be erased from the iPhone first. The same applies to photos transferred from a computer.
    To avoid this, you need to transfer your iTunes library from your old computer to your new computer following the instructions included with this link.
    http://support.apple.com/kb/HT1751

  • Error 1607--I know there's alot of these threads, but PLEASE read.

    First of all, I have searched this error in the discussion boards & read alot of posts & gone to the links listed.
    My computer came with Itunes on it, however, it said that I needed to update the version either by software CD or from the website. I tried the CD, than downloading from the internet. During the setup, it completes the Ipod download. Then when it starts the Itunes download, it shows the Error 1607. I've tried uninstalling all quicktime, itunes, & ipod software. I've disabled my antivirus & antispyware stuff. I am the only user, so I have administrative rights.
    I've also looked at the 3 scenario links on the Ipod website. I seem to have problems while working through the steps on those. To hopefully get a better solution, I'll try to explain step-by-step what I've come to.
    1. iTunes for Windows installation quits with 1607 error, while publishing product information, or is interrupted (Scenario 1)
    ----When I go to this link, it tells me I need to re-install windows. I can't find that CD (i know i have it somewhere). And, I would kinda like that to be my last resort because I don't want to have to save all my files, etc. I've downloaded & put things on my computer alot before with no problems, and the Ipod part of the download worked, just not the Itunes part. So doesn't that mean it's not the installer?
    2. You may receive a "1607:Unable to install InstallShield Scripting runtime" error message when you try to install software in Windows XP (Scenario 2)
    ----"To reinstall the InstallScript engine from InstallShield Developer."
    * When I get into Windows Explorer, I can't find a file called InstallShield.
    ----"Running Setup from a virtual drive"
    * I did what this said, but nothing ever came up.
    ----"Register Idriver and Msiexec"
    * At this step, when I try to run the two things it tells me to, it says it cannot be found.
    ----"Change Permissions"
    *I've changed settings to show all files.
    *When I search for C:\Windows\Installer, I don't get an installer folder. Instead, I have a bunch of folders with titles like this "{0EB5D9B7-8E6C-4A9E-B74F-16B7EE89A67B}".
    ----"Stop other instances of Windows Installer"
    *When I look at the processes I have none of these things.
    3. Error -1607: Unable to Install InstallShield Scripting Run Time (Scenario 3)
    ----"Update the ISScript engine on your computer by downloading the latest one."
    * I went to that next link and downloaded that, & I have a IsScript7 icon on my desktop so I assume that did what it was supposed to?
    ----"Make sure that the Installer folder in the Windows directory has full access privileges."
    *Already done in Scenario 2.
    ----"Set the Installer folder attributes."
    *Like I said above, I get folders with really long number/letter names. I don't have an "installer" folder to click on.
    ----"Make sure that the InstallShield registry key in the Windows registry has full access privileges."
    *I changed all to full control.
    Okay, so I hope I have been specific enough so that I don't get "go to this website & do these steps." I understand that people probably ask this question all the time & I REALLY have tried to fix this. I just don't know what to do.
    Help PLEASE! I really wanna use my Ipod Nano that I've had for 2 weeks now!
    HP Media Center PC   Windows XP  

    Good Day,
    I am haveing similar problems,
    Error 1325.T and 1603
    I have tried to uninstall and reinstall from the CD. I then get; iTunes Library cannot be read because it was created by a newer version if iTunes, this comes up when I try to open iTunes from the desk top shortcut.
    Thanks in advance,
    Drew

  • TS1398 Hi...My wifi is not working. It is not dimmed out. When I turn it on it does not pick up any of the networks around me (I know there are a lot of networks available) I have tried resetting my wifi with the steps above but it still does not work. Pl

    I have the most recent update.

    That you are getting the BONG is a good sign, it's unlikely to be hardware if you are able to hear that.
    Start by running SW update. It's not that there is a specific fix, but when updating it may rewrite some system files which may get this going again purely as a side affect. Worth a go, and should not harm the system.
    Try reset the PRAM - Resetting your Mac's PRAM and NVRAM
    Hopefully one of these quick fixes works, otherwise we'll need to try isolate the issue next - so if still having a problem, I'd try create a new user and login as that user to see if the issue persists (which will tell us if it's system wide or user specific)

  • Hello, I know there is a lot to say about Internet Explorer in a negative way, but there is one function from IE that I like very much. In IE all my bookmarks are permanently visible in the left sidebar while I am surfing on the intenet.

    I have hundreds of bookmarks to be stored in about 20 groups of Bookmarks. How can I have my imported groups of Bookmarks permanentlly visible in Firefox? I hope someone can give me an answer

    You can use CTRL+B to show your bookmarks on Firefox.

  • OS4 problem; know similar Q's have been answered, but swear different

    I tried downloading OS4 on my desktop but was told could make backup b/c of too low memory for some reason (guessed it couldn't do archive of my whole iphone b/c it is a 5 y.o. computer). However, thought that was weird, b/c it has never had a problem before!
    Went to my laptop to do the download. For some reason, it didn't backup anything! No memo's, contacts, text messages, email settings - NOTHING. In fact right before it downloaded it said something like "cant do backup - continuuing".
    I went to my desktop to find my previous sync which has all my contact info - it said cant find crucial files and I need to download iTunes again! HELP!!!

    Hello hibkoko and welcome to the BlackBerry Support Community Forums.
    It sounds like you may need to reload your device software.
    Be sure to back up your device prior to the reload as all data will be wiped clean.
    KB11320 will show you how to do this reload.
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Best practice for lazy-loading collection once but making sure it's there?

    I'm confused on the best practice to handle the 'setup' of a form, where I need a remote call to take place just once for the form, but I also need to make use of this collection for a combobox that will change when different rows in the datagrid or clicked. Easier if I just explain...
    You click on a row in a datagrid to edit an object (for this example let's say it's an "Employee")
    The form you go to needs to have a collection of "Department" objects loaded by a remote call. This collection of departments only should happen once, since it's not common for them to change. The collection of departments is used to populate a form combobox.
    You need to figure out which department of the comboBox is the selectedIndex by iterating over the departments and finding the one that matches the employee.department.id
    Individually, I know how I can do each of the above, but due to the asynch nature of Flex, I'm having trouble setting up things. Here are some issues...
    My initial thought was just put the loading of the departments in an init() method on the employeeForm which would load as creationComplete() event on the form. Then, on the grid component page when the event handler for clicking on a row was fired, I call a setup() method on my employeeForm which will figure out which selectedIndex to set on the combobox by looking at the departments.
    The problem is the resultHandler for the departments load might not have returned (so the departments might not be there when 'setUp' is called), yet I can't put my business logic to determine the correct combobox in the departmentResultHandler since that would mean I'd always have to fire the call to the remote server object every time which I don't want.
    I have to be missing a simple best practice? Suggestions welcome.

    Hi there rickcr
    This is pretty rough and you'll need to do some tidying up but have a look below.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                import mx.controls.Alert;
                import mx.collections.ArrayCollection;
                private var comboData:ArrayCollection;
                private function setUp():void {
                    if (comboData) {
                        Alert.show('Data Is Present')
                        populateForm()
                    } else {
                        Alert.show('Data Not')
                        getData();
                private function getData():void {
                    comboData = new ArrayCollection();
                    // On the result of this call the setUp again
                private function populateForm():void {
                    // populate your form
            ]]>
        </mx:Script>
        <mx:TabNavigator left="50" right="638" top="50" bottom="413" minWidth="500" minHeight="500">
            <mx:Canvas label="Tab 1" width="100%" height="100%">
            </mx:Canvas>
            <mx:Canvas label="Tab 2" width="100%" height="100%" show="setUp()">
            </mx:Canvas>
        </mx:TabNavigator>
    </mx:Application>
    I think this example is kind of showing what you want.  When you first click tab 2 there is no data.  When you click tab 2 again there is. The data for your combo is going to be stored in comboData.  When the component first gets created the comboData is not instansiated, just decalred.  This allows you to say
    if (comboData)
    This means if the variable has your data in it you can populate the form.  At first it doesn't so on the else condition you can call your data, and then on the result of your data coming back you can say
    comboData = new ArrayCollection(), put the data in it and recall the setUp procedure again.  This time comboData is populayed and exists so it will run the populate form method and you can decide which selected Item to set.
    If this is on a bigger scale you'll want to look into creating a proper manager class to handle this, but this demo simple shows you can test to see if the data is tthere.
    Hope it helps and gives you some ideas.
    Andrew

  • Best Practice question - null or empty object?

    Given a collection of objects where each object in the collection is an aggregation, is it better to leave references in the object as null or to instantiate an empty object? Now I'll clarify this a bit more.....
    I have an object, MyCollection, that extends Collection and implements Serializable(work requirement). MyCollection is sent as a return from an EJB search method. The search method looks up data in a database and creates MyItem objects for each row in the database. If there are 10 rows, MyCollection would contain 10 MyItem objects (references, of course).
    MyItem has three attributes:
    public class MyItem implements Serializable {
        String name;
        String description;
        MyItemDetail detail;
    }When creating MyItem, let's say that this item didn't have any details so there is no reason to create MyitemDetail. Is it better to leave detail as a null reference or should a MyItemdetail object be created? I know this sounds like a specific app requirement, but I'm looking for a best practice - what most people do in this case. There are reasons for both approaches. Obviously, a bunch of empty objects going over RMI is a strain on resources whereas a bunch of null references is not. But on the receiving end, you have to account for the MyItemDetail reference to be null or not - is this a hassle or not?
    I looked for this at [url http://www.javapractices.com]Java Practices but found nothing.

    I know this sounds like a specific apprequirement,
    , but I'm looking for a best practice - what most
    people do in this case. It depends but in general I use null.Stupid.Thanks for that insightful comment.
    >
    I do a lot of database work though. And for that
    null means something specific.Sure, return null if you have a context where null
    means something. Like for example that you got no
    result at all. But as I said before its's best to
    keep the nulls at the perimeter of your design. Don't
    let nulls slip through.As I said, I do a lot of database work. And it does mean something specific. Thus (in conclusion) that means that, in "general", I use null most of the time.
    Exactly what part of that didn't you follow?
    And exactly what sort of value do you use for a Date when it is undefined? What non-null value do you use such that your users do not have to write exactly the same code that they would to check for null anyways?

Maybe you are looking for

  • Photo stream  upload from  PC to Iphone

    Can  someone  suggest  how  to  resolve  a  problem  uoloading  from  photostream   on PC  to  Iphone ?

  • Define the default series of monthly invoice in document numbering first

    Hi , ALL, When AR Monthly Invoice  is started, the message is displayed. " define the default series of monthly invoice in document numbering first - 80061-6 ." I checked the Document Numbering-Setup , Of course, it defines it. And also checked the S

  • One Table more than one Relationship to same Table

    Hello, I have the following scenario. One Table called Hotel and one Table Called Competitor. Each hotel can have several competitors. So i structured the tables in my Azure SQL database like this: Hotel: HotelID (int, Primary Key) Name (String) etc.

  • Cannot crate ap-manager interface

    Hello everybody hope you are doing great! Yesterday I was in one of our client premises configuring a WLC 5508 with software 7.2, went through the initial configuration wizard with no problem whatsoever, my issue began when trying to configure a ap-m

  • Automator for exporting

    I don't get it -- I've watched lots of tutorials that show me how to rename my photos, but how do I use automator to render a portion of a timeline into a 'iPod video and iPhone 640x480.m4v' file? Instead of choosing file>export using compressor and