There is a file "urlmapping.xml" in WEB-INF. In the file, there is following code.
<bean id="dd4t" class="org.dd4t.springmvc.controller.DynamicPageController" parent="parent_controller">
<property name="publication" value="25" />
<property name="subcontext" value="/dd4t" />
</bean>
The property "publication" is Tridion publication's ID, and "subcontext" should be the publication's "Publication URL".
There is also following code. Modify value "/dd4t/**/*" to your DD4T Web site's url, then DynamicPageController will be called.
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/app/newslist.html=newslist
/dd4t/**/*=dd4t
</value>
</property>
</bean>
Also, there is a bean element named "LinkResolver". It's "contextpath" property is added to URL generated by dynamic linking, so modify it to adjust to your environment.
DynamicPageContentController is used for rendering component template, and its "buildComponentViews" method is called from DynamicPageController's handleRequestInternal method, around line 132.
ComponentViews contentModel =
contentController.buildComponentViews(pageModel, request,
response);
Create a JSP in "/components/jsp" directory, and set the JSP's file name without extension on component template's metadata "view", then the JSP will be called if the component template is used on a page.
An instance of "org.dd4t.contentmodel.ComponentPresentation" is generated automatically, and passed to the JSP by request's attribute.
The attribute's key is defined in org.dd4t.springmvc.constants.Constants.COMPONENT_PRESENTATION_KEY.
("GenericComponent" might be passed to JSP instead of "ComponentPresentation" on version 1.31)
You can get all contents of a component from the instance's property, and output them by using scriptlet or EL.
Following code is an example of component template's JSP.
ComponentPresentation cp = (ComponentPresentation)request.getAttribute(Constants.COMPONENT_PRESENTATION_KEY);%>
<h1 id="h-1"><%=cp.getComponent().getContent().get("heading").getValues().get(0) %></h1>
When creating page template, create JSP in "/pages/jsp" and set its file name on page template's metadata.