XML Parser using jsp

September 7, 2009 by satz  
Filed under JSP, XML

Learn how to parse an XML file and load dynamic data into a jsp page. This tutorial is on the DOM parser in JSP.  The parser loads the xml data into a jsp page using the DOM parser.

Read more

Create 301 redirect with Java Server Pages (JSP)

May 29, 2009 by satz  
Filed under JSP

What is 301 error:

The file requested has been moved permanently to another location. The new location is defined as part of the following information sent by the server. This is useful when we need to avoid the danger of  broken links in the site. Instead of deleting the file, we can just redirect the browser to a new location by using 301 redirect codes in our web pages.

<%@ page language=”java” contentType=”text/html; charset=ISO-8859-1″ pageEncoding=”ISO-8859-1″%>
<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.movedlocation.com”);
response.setHeader( “Connection”, “close” );
%>