How to make a loop of redirecting?

I'm writing a servlet that can redirect through sites after an amount of time. For example: yahoo.com then google.com then dell.com... But my knowledge is limited to using setHeader("Refresh", "Time; URL") so it can only redirect for 1 time.
Can any one give me a help?

Hi Hookso,
You can do it using the different loops like While loop and For Loop. Roderic has already stated how to do it using a for loop. I have illustrated in the attached vi how to do it using a while loop and Elapsed Time function. Take a look.
Regards,
Nitzz
(Give kudos to good Answers and Mark it as a Solution if your problem is Solved) 
Attachments:
Untitled 2.vi ‏36 KB

Similar Messages

  • How to make a loop run for specific period of time ?

    hello !
    i'm new to labview and could'nt found how to make a loop run for 2 sec for example, and then to exit.
    Solved!
    Go to Solution.

    Hi Hookso,
    You can do it using the different loops like While loop and For Loop. Roderic has already stated how to do it using a for loop. I have illustrated in the attached vi how to do it using a while loop and Elapsed Time function. Take a look.
    Regards,
    Nitzz
    (Give kudos to good Answers and Mark it as a Solution if your problem is Solved) 
    Attachments:
    Untitled 2.vi ‏36 KB

  • How to make for loop pass only once in a next() method

    Good Day!
    Can anyone help me or suggest any idea to resolve my problem with the below code, wherein it will only pass the for loop only once. I already tried inserting the for loop in side the if (sqlset4.isFirst()) condition but the problem is it only retrieved the first row of the resultset.
    Cheers!
                   Statement sOutput = consrc.createStatement();
                            ResultSet sqlset4 = sOutput.executeQuery(xquery);
                            ResultSetMetaData rsMetaData = sqlset4.getMetaData();
                            int numberOfColumns = rsMetaData.getColumnCount();
                            String writefld = "";
                            while (sqlset4.next()) {
                                 writefld = "";
                                 for (int i = 1; i <= numberOfColumns; i++) {
                                     if (xxformatid.equals("1") || xxformatid.equals("3")) {
                                         writefld = writefld + "sqlset4.getString(" + i + ").trim()" + "|";
                                writefld = writefld.substring(0, writefld.length() - 1) + ")";
                                output.write("\r\n");
                                output.write(writefld);
                            output.close();I am using Netbean IDE 6.8
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi

    Hi everyone!
    What I actually trying to do is that I have a multiple tables and from these tables I'm going to write each of it into a flatfile that is a pipe delimeted that is why I have to make a loop to know how many fields I am going to write. The code that was attached are actually working, my only concern is that it will take a longer time of processing cause every record of a table it will pass to the for loop(checking how many column) wherein number of column/ were already known on the first loop.
    Hi kajbj,
    I think what your trying to explain is almost the same with below code which i had already tried. The problem with this is that the every loop of the outer loop data retrieve is only the data of the first record.
                   Statement sOutput = consrc.createStatement();
                            ResultSet sqlset4 = sOutput.executeQuery(xquery);
                            ResultSetMetaData rsMetaData = sqlset4.getMetaData();
                            int numberOfColumns = rsMetaData.getColumnCount();
                            String writefld = "";
                            while (sqlset4.next()) {
                                 writefld = "";
                                 if (sqlset4.isFirst()) {
                                    for (int i = 1; i <= numberOfColumns; i++) {
                                        if (xxformatid.equals("1") || xxformatid.equals("3")) {
                                            writefld = writefld + "sqlset4.getString(" + i + ").trim()" + "|";
                                writefld = writefld.substring(0, writefld.length() - 1) ;
                                output.write("\r\n");
                                output.write(writefld);
                            output.close();

  • How to make a loop that changes two different movieclips from visible to invisible every second

    I am writing some code that puzzles me. It may be, because I have a cold or because I've never needed to do anything like this. I want to have two movieclips one is visible and one is not. then one second passes the one that was visible is invisible and the invisible one is visible. What would be the best approach to this, besides handcoding if statements. I know there has to be a faster way and less expensive way than handcoding if statements.
    I'd like to thank anyone who replies in advance .

    this is how i would do it
    package
              import flash.display.MovieClip;
              import flash.display.Sprite;
              import flash.events.TimerEvent;
              import flash.utils.Timer;
              public class Main extends Sprite
                        private var mc1:MovieClip;
                        private var mc2:MovieClip;
                        public function Main()
                                  // create your mc's here
                                  mc1 = new MovieClip();
                                  mc2 = new MovieClip();
                                  mc2.visible = false;
                                  var timer:Timer = new Timer(1000);
                                  timer.addEventListener(TimerEvent.TIMER, loop);
                                  timer.start();
                        private function loop(e:TimerEvent):void
                                  mc1.visible = !mc1.visible;
                                  mc2.visible = !mc2.visible;

  • How to make google-search to redirect to first result (automatically) ?

    Hello,
    I have just installed the latest version of FF on my windows 7.
    When I search using google-search by either:
    1. Writing somethong in the adress bar and pressing enter
    2. Writing something in the search box (thats on the same line as the adress bar)
    I am not being redirected automatically to the first result.
    How can I change it so that I will go to the first result automatically after pressing enter ?
    Thanks in advance for the help!

    hello belgiamit, you can do it for the address bar the following way:
    enter '''about:config''' into the firefox address bar (confirm the info message in case it shows up), search for the preference named '''keyword.url''' & double-click and set that entry to
    http://www.google.com/search?btnI=I%27m+Feeling+Lucky&ie=UTF-8&oe=UTF-8&q=

  • Buffered Reader, how to make a loop to terminate

    Hello, the code uses each line from the input.txt and does whatever we want, it's termination condition is when the next line is null. But this fails to work if the input.txt doesn't have an emptyline after the last line, how to change the code to work for those files?
       try {
            BufferedReader in = new BufferedReader(new FileReader("input.txt"));
            String str;
            while ((str = in.readLine()) != null) {
                /*WE DO WHATEVER FOR EACH LINE HERE */
            in.close();
        } catch (IOException e) {
        }Edited by: Odinn on Jan 10, 2009 10:18 AM
    Edited by: Odinn on Jan 10, 2009 10:19 AM

    Odinn wrote:
    Nop, say I have an input.txt file that contains
    1
    2
    3
    4the code above won't work files that the end line isn't empty. It works for:
    1
    2
    3
    4
    <assume theres an empty line here>Edited by: Odinn on Jan 10, 2009 10:37 AM
    Edited by: Odinn on Jan 10, 2009 10:38 AMAre you sure about that? Did you try to run it? If so, what happened? I just ran your code as is (just modified it to print the lines out) with two input files: One with a blank line at the end, and one without. I got the same exact output, and no error messages.
    Odinn wrote:
    the code uses each line from the input.txt and does whatever we want, it's termination condition is when the next line is null. But this fails to work if the input.txt doesn't have an emptyline after the last lineI don't think your logic is correct. A blank line at the end of a text file is not the same as a null, and in fact, it does not fail. If you run the code, you will see that you are not in an endless loop.

  • DVD STUDIO PRO - How to make chapters loop?

    Hi
    I'm trying to create a DVD and my last problem I'd like to resolve before the final burn is:
    Is there a way to make the Chapters in my Track Loop?
    My scenario: I have 5 Chapters Total. In my Chpater Menu I created 5 Buttons so you can jump straight to 5 Chapters. But let's say for Button 3 (Chapter 3), when I activate/play it, if I hit SKIP FWD I can skip to Chapter 4, & 5, BUT if I hit SKIP BACK it stops at Chapter 3 (which is where I started - Button 3).
    Is there a way for me to set it so that if I hit Button 3-Chapter 3 from the Chapter Menu - I can access Chapter 1&2 by hitting Skip Backwards while the track is playing? The only way I can think to resolve this is to add Chapter 1&2 after Chapter 5 in my Story List but that means I can only hit Skip Forward and it will eventually stop skipping forward once it hits Chapter 2. So is there a way to loop it???
    Sorry I hope I explained it decent enough for you guys to understand
    NEED HELP ASAP!!! Trying to finish for a client this weekend! :

    Yeahhh so it took me giving up and just burning to DVD and playing it in an actual DVD player to realize that the DVD Studio Pro does its "behind-the-scenes" magic and will have that function automatically figured out for the DVD Player. DO NOT rely on the simulation feature...geez...problem solved.

  • How to make animation loop smoothly

    http://dietzclublambs.com/
    The Flash on this site shows scrolling pictures on the home
    page. When it comes to the end, you'll see it stops abruptly and
    restarts at the beginning.
    Any suggestions for a way to make it look like a seamless
    transition from the end back to the beginning and keep the images
    continuously scrolling?

    You need to create a duplicate of the row of images and on
    the last frame, position the images as they are in the first frame.
    You may need to nudge the duplicate slightly to get a smooth
    transition but the general idea is to utilize 2 sets of images so
    that the last and first image seem to be back to back. Hope this
    makes sense.

  • How to make a switch loop? ( Read inside for more info.)

    I'm working on a project using switch and I want to know how to make it loop/ or is it possible to do so with for or while. If anyone could help me I'd be very thankfull.
    Since my switch is too long I'll make an example:
    System.out.println();
    System.out.println();
    System.out.println("Zgjedhni operacionin: ");
    System.out.println("1. Mbledhja A + B\n");
    System.out.println("2. Zbritja A - B\n");
    optionNumber = sc.nextInt();
    switch ( optionNumber ) {               
                        case 1: System.out.println("\nMbledhja A + B: ");
                              s11 = (a11+b11);
                              s12 = (a12+b12);
                              s13 = (a13+b13);
                              s21 = (a21+b21);
                              s22 = (a22+b22);
                              s23 = (a23+b23);
                              s31 = (a31+b31);
                              s32 = (a32+b32);
                              s33 = (a33+b33);
                              System.out.println( s11 + " - " + s12 + " - " + s13 );
                              System.out.println( s21 + " - " + s22 + " - " + s23 );
                              System.out.println( s31 + " - " + s32 + " - " + s33 );
                              break;
                        case 2: System.out.println("\nZbritja A - B: ");
                              s11 = (a11-b11);
                              s12 = (a12-b12);
                              s13 = (a13-b13);
                              s21 = (a21-b21);
                              s22 = (a22-b22);
                              s23 = (a23-b23);
                              s31 = (a31-b31);
                              s32 = (a32-b32);
                              s33 = (a33-b33);
                              System.out.println( s11 + " - " + s12 + " - " + s13 );
                              System.out.println( s21 + " - " + s22 + " - " + s23 );
                              System.out.println( s31 + " - " + s32 + " - " + s33 );
                              break;I've got the variables declared of course :P so now what I want after doing case 1 or case 2 or any other cases ( 9 in my program) I want to make a question if I want to do another operation and start again from beginning :$/

    Solved it.
    do {
    System.out.println();
    System.out.println();
    System.out.println("Zgjedhni operacionin: ");
    System.out.println("1. Mbledhja A + B\n");
    System.out.println("2. Zbritja A - B\n");
    optionNumber = sc.nextInt();
    switch ( optionNumber ) {               
                        case 1: System.out.println("\nMbledhja A + B: ");
                              s11 = (a11+b11);
                              s12 = (a12+b12);
                              s13 = (a13+b13);
                              s21 = (a21+b21);
                              s22 = (a22+b22);
                              s23 = (a23+b23);
                              s31 = (a31+b31);
                              s32 = (a32+b32);
                              s33 = (a33+b33);
                              System.out.println( s11 + " - " + s12 + " - " + s13 );
                              System.out.println( s21 + " - " + s22 + " - " + s23 );
                              System.out.println( s31 + " - " + s32 + " - " + s33 );
                              break;
                        case 2: System.out.println("\nZbritja A - B: ");
                              s11 = (a11-b11);
                              s12 = (a12-b12);
                              s13 = (a13-b13);
                              s21 = (a21-b21);
                              s22 = (a22-b22);
                              s23 = (a23-b23);
                              s31 = (a31-b31);
                              s32 = (a32-b32);
                              s33 = (a33-b33);
                              System.out.println( s11 + " - " + s12 + " - " + s13 );
                              System.out.println( s21 + " - " + s22 + " - " + s23 );
                              System.out.println( s31 + " - " + s32 + " - " + s33 );
                              break;
    System.out.println("Doni te beni edhe nje operacion?: ");
    vazhdo = sc.next().equalsIgnoreCase("PO");
    while ( vazhdo == true);Sorry for double posting can't see an edit button :$

  • How do I make apples loops that show up in the loop browser

    How do I make apples loops from my audio files that show up in the loop browser, and where do they reside on the computer so that I know they are there.

    Refer to Logic manual page 848 where it is well explained.
    Regarding the path you can search:
    localdrive\Users\your_ user_account\Library\Audio\Apple Loops\User Loops
    !http://img59.imageshack.us/img59/4967/aglogo45.gif!

  • How to make a tcp server in loop

    Hello everybody!
    I just want to know how to make a server keeping turning even when the client has deconnected.
    My work is based on examples TCP Communicator - Active.vi and TCP Communicator - Passive.vi.
    The problem with these VIs is that when the client deconnects, the server doesn't work any longer, and I want the server to be able to listen for other clients (one client in the same time).
    How can I modify them to apply my will? If you have some examples it will be perfect!!
    Thank you!
    SebGAM

    You could probably get away with putting a big While loop around the server code, but there is always the greatest TCP server example I have ever seen. It lives over at OpenG, the Open Source LabVIEW community. You can download and use it for free. There's even decent documentation right there online.
    EXAMPLE - TCP Server at OpenG
    Beware, the code is not easily understood by the novice LabVIEW programmer. All you need to know is that you should only modify the VI called "TCP Server Example.vi" and "TCP Server Example Connection Handler VI.vi".
    Enjoy,
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

  • How to make the exchange of data between 2 while loop in real time

    hello
    I have 2 while loop
    the 1st while loop includes the data acquisition program
    the 2nd while loop includes the control program
    my question is how to make the exchange of data between 2 while loop in real time
    I tried with the local variable and direct wiring between the 2 while loop
    it does not work (there is a delay)
    Solved!
    Go to Solution.

    Bilalus,
    Queues are only good to transfer data if your application isn't deterministic. Since you are using Real Time, I am assuming that your application requires determinism. If you are using Timed Loops and you use queues to transfer data between your loops, you are losing determinism. In this case, you need to use the RT FIFO functions. 
    Warm Regards,
    William Fernandez
    Applications Engineering
    National Instruments

  • Loop in smartform - how to make values valid in all pages

    Hi All.
    I have a smartforms with several pages (9). I must print these 9 pages once for each line in the internal table ITAB. When I put a loop in the first page, the data under that loop is printed correctly, but every text node outside the loop always prints the last line of ITAB.
    Do any of you know how to make the data in the loop valid throughout the other pages?
    any help will be welcome.
    thanks,
    Hermes.

    I got it. The main window must be the first one in the first page. The loop must be inside the main window, and bellow the loop there must be a page-break command.

  • How to make a Thread loop?

    Hi, I was wondering how to make a thread start over again from the beginning once it finishes, if it hasn't been stopped already.

    package src.Utility;
    public class ThreaTest extends Thread{
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              ThreaTest threaTest= new ThreaTest();
              while(true){
                   try{
                   if (!threaTest.isAlive()){
                        threaTest= new ThreaTest();
                        threaTest.start();
                   }//else{
                        //System.out.println("");
                   }catch (Exception e) {
                        e.printStackTrace();
         public void run(){
              System.out.println("-----11---------");
    }try the above code and then tell me if this loop works for you???

  • How to make labview program to get average value of 200 reading from multimeter (by using loop)

    Hello
    How to make labview program to get average value of 200 reading from multimeter (I using using loop) to read voltage from mulmeter  but I like to get average value of all of 200 reding how can I do that?
    Thanks
    Wee
    Solved!
    Go to Solution.

    Another idea with less programming - take advantage of the "free" array that comes with a Chart - i.e. the  History Data.
    1) Wire your DMM data to a Chart. (You can set the chart to invisible if you don't plan on using it in the GUI).
    2) Set the Chart History Length to 200 (right click on the chart, click on Chart History Length...)
    3) On the block diagram, use the History Data Property Node, wire it to Mean.vi, and you're done.
    Easiest running average ever.
    Message Edited by Broken Arrow on 04-07-2010 11:36 AM
    Richard
    Attachments:
    EasyAvg.jpg ‏8 KB

Maybe you are looking for

  • HT204053 how can i delete an old account. I forgot that accounts password.

    I need to delete an old account, i forgot the password to that account.

  • Mountain Lion to Mavericks, or to Yosemite?

    I would need to upgrade in order to use some newer imaging program. Given that I use the OS to operate LR and CS6 mainly and use very few Apple programs, but have still some older apps running on my Mac, like Office 2008, MacSpeech Dictate Internatio

  • Powerbook not accepting ANY and all cd/dvd types

    I am having trouble getting any sort of answer or help at all for this. Whenever I try to insert a disk into my computer's drive, it takes it in, makes a few noises, and then kicks it out, I don't touch anything. The drive itself is the Matshita DVD-

  • Bug- speakerphone dialing

    When dialing a call using the speaker phone, if you press the sleep button twice to turn the screen off, after 15 seconds (only if the phone is still ringing, and the person hasn't picked up) the speaker will shut off. If you press the home button to

  • No more fixed size fonts

    OTN articles like this one: http://otn.oracle.com/oramag/oracle/04- may/o34cover_feature.html are using a fixed font size. The page does not respond to the browser View > Text Size menu command. This makes it difficult for me to read. Why not use a r


HashFlare