Hi,
I think I have already posted this,but may be in some other forum. I need to post this in JSP forum.
Here,all I need is a replacement of goto statement.I want to check for a condition,and if that condition is true,I want the compilet to goto if() statement and repeat if().Since there is no goto in java,can I use labels???Can anyone suggest anything else from this???I am sorry just in case if u find this thread as repeated.
My program is something like this:

java.util.Vector v1991=new java.util.Vector(30);
     int f1=1;
     int f2=10;
     v1991=mb1.Sel(f1,f2);

// Here,mb1 is the bean and sel is the function where I select the
// records between employee number f1 and f2

if(request.getParameter("submitxyz")!=null)
    {
    f1=f1+10;
    f2=f2+10;
    v1991=mb1.Sel(f1,f2);
   }

// submit xyz is my submit button.I get records 11 to 20 on submit
// but I need to get back here and if I click this again, I should get
// records 21 to 30.Again on click,I should get 31 to 40 and so on.

for(int l=l1;l<=(v1991.size()/6);l++) 
    {
    <tr>
    <td width="8%">
    <form method="get" name="form1" action="content.jsp">
    <fieldset>
    <input type="radio" name="radio" value="<%=v1991.get(i)%>">
    </fieldset> 
    </td>
    <td width="7%">
    <%
    out.println(v1991.get(i).toString());
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text222" value="<%=v1991.get(i).toString()   
     %>">
    <%
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text333" value="<%=v1991.get(i).toString()
     %>" >
     <%
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text444" value="<%=v1991.get(i).toString()
     %>">
    <%
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text555" value="<%=v1991.get(i).toString()
     %>">
    <%
    i++;
    %>
    </td>
    <td width="17%">
    <input type="text" name="text666" value="<%=v1991.get(i).toString 
      ().toString().substring(0,10)%>">
    <%
    i++;
    %>
    </td>
    </tr>
    <%
    }
    %>

Now,I want to go back to(goto) if() statement as soon as I finish this loop.This program would give me 1 to 10 records initially.When I click submitxyz (next) button,I would get 11 to 20.As soon as I get 11 to 20,if I click the button,I want to get 21 to 30.But it doesn't work...
my select query would be select * from emp where empno between f1 and f2;
(There is no problem with the syntax or query.The only problem is how to return to if() statement);
Plz help me ...........Pleeeeeeeeease....I shall be very thankful.

Don't double post, your question has been already answered in your original thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.