• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » JSP » Session » Jsp getStatus Example
Next →
← Prev

Jsp getStatus Example

By Dinesh Thakur

In this example we will explain the get status method() this method is referred  to HttpServletResponse interface. The status we set will be diaplayed.

 

For example in the program we make a demo like to get status with domain name (web sites).here we also made two form first as designing page of demo example and the second one is to show all the criteria it does on the condition. let’s take a look…..

<html>

<head>

<style>

.label        {

                      font-family:”Palatino Linotype”, “Book Antiqua”, Palatino, serif;

                      font-size:14px;

                      color:#0e0e0e;

                 }

.border   {

                     border:solid 2px #0448e0;

                     margin-top:70px;

                }

.text        {

                        font-family:”MS Serif”, “New York”, serif;

                        font-size:16px;

                        color:#070200;

                }

</style>

   <title>status</title>

   </head>

   <body>

         <form action=”JavaExampleJSP_getStatus.jsp” method=”get”>

         <table cellpadding=”2px” cellspacing=”1px” bgcolor=”#F4F5F7″ width=”400px” class=”border” align=”center”>

         <tr>

           <td colspan=”2″ bgcolor=”#0066FF”>&nbsp;</td>

         </tr>

         <tr>

            <td colspan=”2″ class=”label”>&nbsp;</td>

        </tr>

        <tr>

           <td align=”center” colspan=”2″>

                 <span class=”text”><b>Enter Contents</b></span>

           </td>

        </tr>          

        <tr>

             <td colspan=”2″ class=”label”>&nbsp;</td>

        </tr>

        <tr>

            <td class=”label” align=”right” width=”50%”><b>Enter Web Site Name:</b>

            <br>(eg. google,yahoo)</br></td>

             <td align=”left” width=”50%”><input type=”text” name=”ws” maxlength=”20″/></td>

        </tr>

         <tr>

              <td class=”label” align=”right” width=”50″><b>Enter Domain Name:</b>

              <br>(like in,org,com)</br></td>

             <td align=”left” width=”50″><input type=”text” name=”dn” maxlength=”20″ /></td>

         </tr>

         <tr>

             <td class=”label” align=”right”>&nbsp;</td>

             <td align=”left”><input type=”submit” value=”Submit” /></td>

         </tr>                 

         <tr>

             <td colspan=”2″ class=”label”>&nbsp;</td>

         </tr>             

         </table>

         </form>

         </body>

         </html>

             Jsp getStatus Example

getStatus.jsp                                                                      

 <%@ page import=”java.net.URL, java.util.*” %>

<html>

    <head>

         <title>&lt;getStatus&gt; In JSP</title>

   </head>

  <body>

   <%

          String web = request.getParameter(“ws”);

          String domain = request.getParameter(“dn”);

          URL Nwurl = new URL(“http://”+web+”.”+domain);

          String url = Nwurl.toString();

          If(web != null)

           {

                response.setStatus(response.SC_MOVED_TEMPORARILY);

                response.setHeader(“Location”, url);

           }

    %>

      </body>

      </html>

        Jsp getStatus Example

You’ll also like:

  1. HTTP COOKIES in JSP
  2. Jsp headerRequest Example
  3. Jsp setDateHeader Example
  4. Hidden Form Fields in JSP
  5. What is JSP?
Next →
← Prev
Like/Subscribe us for latest updates     

About Dinesh Thakur
Dinesh ThakurDinesh Thakur holds an B.C.A, MCDBA, MCSD certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps.

Dinesh Thakur is a Freelance Writer who helps different clients from all over the globe. Dinesh has written over 500+ blogs, 30+ eBooks, and 10000+ Posts for all types of clients.


For any type of query or something that you think is missing, please feel free to Contact us.


Primary Sidebar

Java Server Pages

Java Server Pages

  • JSP - Home
  • JSP - Advantages
  • JSP - Architecture
  • JSP - Life Cycle
  • JSP - Servlet Disadvantages
  • JSP - PrintWriter Vs JspWriter
  • JSP - Session Tracking
  • JSP - Stateless Protocol
  • JSP - Hidden Form Fields
  • JSP - Program Structure
  • JSP - Bill Discount Program
  • JSP - Scripting Elements
  • JSP - fn:length()
  • JSP - fn:split()
  • JSP - fmt formatNumber Tag
  • JSP - Servlet Communication
  • JSP - fn:replace()
  • JSP - fmt:parseNumber Tag
  • JSP - fmt:parseDate Tag
  • JSP - fn:substring()

Other Links

  • JSP - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2025. All Rights Reserved.

APPLY FOR ONLINE JOB IN BIGGEST CRYPTO COMPANIES
APPLY NOW