Sending large structures to the browser

I'm trying to create a registration page that will allow the
user to create a profile and show where they live using a dynamic
dependant select form. The form allows 1. continent selection 2.
country selection 3. region selection. I have these working, and so
far, the page seems to be loading quite quickly, even without
caching the query (120 ms). But, I also want the user to be able to
select their city. I will be loading three fields from a database
(city name, country_id, and region_id). This dataset becomes quite
large considering all notable cities in the world, and passing it
to the browser causes great bog down (about 30 seconds). What do
actual programmers do for sending large datasets to the browser
(I'm not a programmer) btw, I am using q-forms by pengoworks to
create the javascript structures/dynamic select menus (if that
helps). Thanks for any suggestions!
dan

It's the cities that are slowing down production. You can use
related selects to get the countries once the user has selected the
continent. From there you want another db query to get the cities
for that country. This can be a page request or an ajax thing.
If you are not a programmer, you might consider hiring one to
help you out.

Similar Messages

  • HT4847 Can I send larger apps (like the Walking Dead game...2+ gigs!!?) to my iCloud from my iPad WITHOUT losing progress within the game?

    I have no clue what I'm doing here...why can't I see anyone or figure out how to even POST my massively ignorant question?? Lol

    Sweet!  It posted....even tho I clicked the non-highlighted "post" button  

  • Is JSF 1.2 buffering the response, or streaming it back to the browser?

    Hi,
    I recently implemented a simple custom component which "streams" back a file to the browser (doing some processing on it).
    Using myfaces i get out of memory errors when processing large files, I later learned that the myfaces implementation actually buffers the response data before sending it back to the browser, which causes problems for me.
    I would be grateful for some insight in how this works in JSF 1.2 RI.
    Regards,
    Mikael

    Basically content interweaving is handling of JSF and non-JSF output in a way so that it appears in the rendered response the way it appears in the page.
    Does in mean that the response is processed further to check if there are any expressions which needs evaluating?No we don't handle the expressions, just the insertion of content before and after the view, and the writing of state information.

  • I want to send a response from the servlet and then call another servlet.

    Hi,
    I want to send a response from the servlet and then call another servlet. can this happen. Here is my scenario.
    1. Capture all the information from a form including an Email address and submit it to a servlet.
    2. Now send a message to the browser that the request will be processed and mailed.
    3. Now execute the request and give a mail to the mentioned Email.
    Can this be done in any way even by calling another servlet from within a servlet or any other way.
    Can any one Please help me out.
    Thanks,
    Ramesh

    Maybe that will help you (This is registration sample):
    1.You have Registration.html;
    2.You have Registration servlet;
    3.You have CheckUser servlet;
    4.And last you have Dispatcher between all.
    See the code:
    Registration.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
      <HEAD>
        <TITLE>Hello registration</TITLE>
      </HEAD>
      <BODY>
      <H1>Entry</H1>
    <FORM ACTION="helloservlet" METHOD="POST">
    <LEFT>
    User: <INPUT TYPE="TEXT" NAME="login" SIZE=10><BR>
    Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE=10><BR>
    <P>
    <TABLE CELLSPACING=1>
    <TR>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="logon" VALUE="Entry">
    </SMALL>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="registration" VALUE="Registration">
    </SMALL>
    </TABLE>
    </LEFT>
    </FORM>
    <BR>
      </BODY>
    </HTML>
    Dispatcher.java
    package mybeans;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Dispatcher extends HttpServlet {
        protected void forward(String address, HttpServletRequest request,
                               HttpServletResponse response)
                               throws ServletException, IOException {
                                   RequestDispatcher dispatcher = getServletContext().
                                   getRequestDispatcher(address);
                                   dispatcher.forward(request, response);
    Registration.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Registration extends Dispatcher {
        public String getServletInfo() {
            return "Registration servlet";
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            ServletContext ctx = getServletContext();
            if(request.getParameter("logon") != null) {          
                this.forward("/CheckUser", request, response);
            else if (request.getParameter("registration") != null)  {         
                this.forward("/registration.html", request, response);
    CheckUser.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class CheckUser extends Dispatcher {
        Connection conn;
        Statement stat;
        ResultSet rs;
          String cur_UserName;
        public static String cur_UserSurname;;
        String cur_UserOtchestvo;
        public String getServletInfo() {
            return "Registration servlet";
        public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            try{
                ServletContext ctx = getServletContext();
                Class.forName("oracle.jdbc.driver.OracleDriver");
                conn = DriverManager.getConnection("jdbc:oracle:oci:@eugenz","SYSTEM", "manager");
                stat = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
               String queryDB = "SELECT ID, Login, Password FROM TLogon WHERE Login = ? AND Password = ?";
                PreparedStatement ps = conn.prepareStatement(queryDB); 
               User user = new User();
            user.setLogin(request.getParameter("login"));
            String cur_Login = user.getLogin();
            ps.setString(1, cur_Login);
            user.setPassword(request.getParameter("password"));
            String cur_Password = user.getPassword();
            ps.setString(2, cur_Password);
         Password = admin");
            rs = ps.executeQuery();
                 String sn = "Zatoka";
            String n = "Eugen";
            String queryPeople = "SELECT ID, Surname FROM People WHERE ID = ?";
           PreparedStatement psPeople = conn.prepareStatement(queryPeople);
                      if(rs.next()) {
                int logonID = rs.getInt("ID");
                psPeople.setInt(1, logonID);
                rs = psPeople.executeQuery();
                rs.next();
                       user.setSurname(rs.getString("Surname"));
              FROM TLogon, People WHERE TLogon.ID = People.ID";
                       ctx.setAttribute("user", user);
                this.forward("/successLogin.jsp", request, response);
            this.forward("/registration.html", request, response);
            catch(Exception exception) {
    }CheckUser.java maybe incorrect, but it's not serious, because see the principe (conception).
    Main is Dispatcher.java. This class is dispatcher between all servlets.

  • How to send multiple pages to same browser

    I have a JSP that has a form that submits to a servlet to read a file and then return the value of the file in a bean back to the JSP. I want to be able to send "update" pages to the browser so the client knows the progress of the read. Is there any way I can do a sendRedirect() to the page with a value in the bean telling how much has been read and then keep sending updates every few seconds until the file is read? I know some people do this to show the status of a site search but it looks to me like they send the page with an instant refresh back to the servlet. This won't work for me since the servlet is in the middle of reading a file on another server so I don't want the servlet thread to end until the entire file is read. I have tried coding multiple sendRedirects in the read code but the only thing the browser displays is the last value before the servlet returns. If anybody has any ideas I would appreciate it.

    I would recommend not doing an upload monitor. There is, as far as I can tell, no easy way to do it and complicated ways will detract from the power you need to actually perform the process in question. A warning that they will need to wait a few seconds for the server to upload the file should be fine.

  • Opening XML file in the browser window after generating it.

    hi,
    my application generates an XML document by retrieving data from Oracle DB. To view that XML file i have to manually open it by going to relavant directory. I want to open it through JSP.
    Please help me. any sample code would be appreciated.
    thank u.
    [email protected]

    Instead of writing the xml to a file write it to the response. That will send it back to the browser
    Or create a new JSP that opens the file and then writes it to the response.
    ServletContext sc = getServletContext();
    BufferedReader in = new BufferedReader(new FileReader(sc.getRealPath("/") + "/xml.in"));
    String input = null;
    response.setContentType("text/xml");
    while ((input = d.readLine()) != null) { out.print(input); }
         

  • Sending large attachments  - MS Exchange

    I am having problems sending large attachments. The email forever sits in the outbox and the sent folder just spins. The attachment size is 7.1M. Mail activity says "adding messages"
    This worked fine with Entourage.
    any thoughts.

    Hello RyanT1 & welcome to the forums...
    The attachment size is 7.1M.
    Reduce that size in increments and see if you can find an allowable threshold that works.

  • Firefox is using large amounts of CPU time and disk access, and I need to know how to shut down most of this so I can actually use the browser.

    Firefox is a very busy piece of software. It's using large amounts of CPU time and disk access. It puts my usage at low priority, so I have to wait for some time to be able to use my pointer or keyboard. I don't know what it uses all that CPU and disk access time for, but it's of no use to me. It often takes off with massive use of resources when I'm not doing anything, and I may not have use of my pointer for several minutes. How can I shut down most of this so I can use the browser to get my work done. I just want to use the web site access part of the software, and drop all the extra. I don't want Firefox to be able to recover after a crash. I just want to browse with a minimum of interference from Firefox. I would think that this is the most commonly asked question.

    Firefox consumes a lot of CPU resources
    * https://support.mozilla.com/en-US/kb/Firefox%20consumes%20a%20lot%20of%20CPU%20resources
    High memory usage
    * https://support.mozilla.com/en-US/kb/High%20memory%20usage
    Check and tell if its working.

  • How can I use the "EvalScript()" function? I am trying to send text to a Director app from the web browser, but the console in the browser just responds "Uncaught ReferenceError: evalScript is not defined ".

    I am trying to control a Shockwave app form another machine, using "Pusher" service (websockets), and everything is ok so far; but when I try to send the shockwave app the text recieved from another machine, using the "EvalScript()" function (as documented), I only get the message "Uncaught ReferenceError: evalScript is not defined" in the browser's console. What am I doing wrong?
    'm using the following script in the webpage where the shockwave object is located:
      <script type="text/javascript">
        // Enable pusher logging - don't include this in production
        Pusher.log = function(message) {
          if (window.console && window.console.log) {
            window.console.log(message);
        var pusher = new Pusher('abc963cf3e6g678879e');
        var channel = pusher.subscribe('Galileo_channel');
        channel.bind('Galileo_event', function(data) {
          evalScript(data.message);
      alert(data.message);
      </script>
    The "alert" is working fine, but I can't get JavaScript to recognize the EvalScript (I even tried calling the shockwave object, ie: "extev01.evalScript()", since the object's ID is extev01, but it doesn't work, either).
    Help!

    Thanks Sean.
    I tried your suggestion first, using getNetText to poll the server and read a text file. The drawbak is that I had to poll the server constantly, since I could not know in advance when the text file was going to change (and it's not practical to stump the server and connection).
    I've kept trying the EvalScript, asigning the Shockwave object to a variable first, then calling the EvalScript() in the object, but it doesn't work, either. I think I will simply use JavaScript and forget about shockwave altogether, since everything is working fine up to that point (although it would be nice to be able to use Lingo for the rest of the app).

  • Error in sending a binary outputstream to the browser

    I am looking for information on sending a binary outputstream to a browser.I am not getting any error and am able to write out the entire buffer.Even though the browser recognizes the mime type,it only sends junk to the client.Please look at the code sample below that I am using to send the outputstream.
    response.setContentType(MimeType);
    String str_encoding = response.getCharacterEncoding();
    System.out.println("================= The Character Encoding is --------------" + str_encoding);
    int len = buf.length;
    System.out.println("Data length ===========" + len);
    response.setHeader("Content-Disposition", "inline;filename=" + "\"" + fileName + "\"");
    OutputStream o = response.getOutputStream();
    int buffer_length = 10 * 1034;
    int offset = 0;
    //read a thousand bytes from the buffer at a time
    while ((offset <= buf.length) && (loop==true))
    if ((buf.length - offset) < buffer_length)
    buffer_length = buf.length - offset;
    loop = false;
    System.out.println("---------Now Inside the Loop, Writing Output Buffer ------" + offset + " bytes");
    o.write(buf,offset,buffer_length);
    o.flush();
    offset = offset + buffer_length;
    If anyone could tell me what needs to be done to successfully send a binary input stream from a Java application to a JSP page calling it and then successfully sending the outputstream for the client to be read,that would be fantastic.

    yes,I did.That sends the data out as junk.The outputstream gets some sort of junk characters with the response.getOutputStream() method.So it errors out when I set the content length.
    I tried sending the data as a whole,but does not seem to make a difference.I was grasping at straws when I tried to break it into chunks.

  • Could not initialize the browser's security component Error message when sending a link

    Using Ubuntu 9.10 64 bit. Firefox version is 3.6.3 and Thunderbird version is 2.0.0.24
    When sending a link with Firefox I get an error message "Could not initialize the browser's security component...". Tried deleting the cert8.db and secmod.db. Noticed if Thunderbird is already open I don't get the error message. But if Thunderbird is closed then opens to send the link I get that error message. Seems the security certificates aren't being passed to Thunderbird when it is opening up.
    == This happened ==
    Not sure how often
    == 2 days ago.

    Try to remove or rename the secmod.db (secmod.db.old) file in the Firefox Profile Folder.
    If that didn't help then remove or rename cert8.db (cert8.db.old) as well.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    * C:\Users\&lt;user&gt;\AppData\Roaming\Mozilla\Firefox\Profiles\&lt;profile&gt;\
    The "Application Data" folder in XP/Win2K and the "AppData" folder in Vista/Windows 7 are hidden folders.
    *http://kb.mozillazine.org/Show_hidden_files_and_folders

  • Attempted to mail an email with a large attachment file.  One of the addresses was bad.  When my Outlook is running, the Mac tries to send it and shows the progress.  However, when I look in my Outbox the files are not there.  It does show up in the Outb

    attempted to mail an email with a large attachment file.  One of the addresses was bad.  When my Outlook is running, the Mac tries to send it and shows the progress.  However, when I look in my Outbox the files are not there.  It does show up in the Outbox progress section but I can not delete it when it is there.
    Where do these files reside?
    Is there a hidden Outbox??
    MacBook Pro, Mac OS X (10.7.1)

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • I dropped my ipod touch in the street and there is a large crack in the screen can i take it to the apple store and pay to have it fixed there or do i have to send it out?

    i dropped my ipod touch in the street and there is a large crack in the screen can i take it to the apple store and pay to have it fixed there or do i have to send it out?

    They can fix it at the Apple Store. I wish you could get it fixed for free, but the warranty doesn't cover accidents like this . It sounds like you understand this, I just want to make sure you know.

  • Structure of the sender Data Type

    hi;
    i have two tables and want to fetch data from both in one go using sender JDBC adapter.
    Can any one tell me the structure of the sender Data Type
    if Table1 has A1,A2,A3 as fields and Table2 has B1,B2,B3 as fields.
    i want to fetch only A1,A2 fields from Table1 and B1,B3 fields from Table2.

    Hi,
    Just use Select statement in the Sender JDBC adapter , and your structure should have simple structure with required number of fields.
    configuring jdbc adapter with multiple tables
    Regards,
    Moorthy

  • I have to send large files like 5MB or biger via mobile phone, but in that cases phone is telling mi to plug in power. And when I do that, there is no problem to send the file. For smaller files there is no problem. How can I solve the problem? Because wh

    I have to send large files like 5MB or biger via mobile phone, but in that cases phone is telling mi to plug in power. And when I do that, there is no problem to send the file. For smaller files there is no problem. How can I solve the problem? Because when I'm not at home I can't plug in the power.

    hi,
    I am sending file from server to client i.e client will request for a file and service will send it back....... no socket connection is there...I am using JBOSS and apache axis.
    pls help me out.....
    Rashi

Maybe you are looking for