Java Reference
In-Depth Information
Listing 4-12. The dispatcher-servlet.xml file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=" http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:p=" http://www.springframework.org/schema/p"
xmlns:context=" http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.appirio" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResol
ver"
p:prefix="/WEB-INF/views/"
p:suffix=".jsp" />
</beans>
Views
Now create the views for the application. First, you need a simple form that allows the
user to enter a name (Figure 4-7). Listing 4-13 is the JSP page that is loaded from the
deployment descriptor as the default web page. It includes a standard HTML form
with a single input field.
Listing 4-13. The index.jsp page
<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Spring - GAE</title>
</head>
 
Search WWH ::




Custom Search