Listing 1. Using <% %> Tags

<HTML>
  <Head>
     <Title>Mini-dynamic JSP Title</Title>
  </Head>
  <Body>
     <P>You are connecting from the host
     <% if (request.getRemoteHost().equals("")) { %>
            <%= request.getRemoteHost() %>.</P>
     <% } else { %>
            <%= request.getRemoteAddr() %>.</P>
     <% }  %>
   </Body>
</HTML>