Wednesday

Redirect a Page in Jsp

Redirect a page in jsp along with a message or data tutorial . forward a page with a variable between pages.pass a variable.  This is a tutorial to redirect a jsp page with the particular variable - data value .
   Syntax:
            if(condition)
                {
                     response.sendRedirect("page.jsp");
                 }


   1.  response.sendRedirect("index.jsp?error="+"Empty Fields");
           
                The above line redirect a page along with error message.Now let see how get the
     error field in index.jsp.

         String msg =  request.getParameter("error");  
         System.out.println(msg);    




0 comments:

Post a Comment

Don't Forget To Join US Our Community
×
blogger