This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[maven-release-plugin] copy for tag FunctionalTestsPortlet-1.0.1
git-svn-id: https://source.jasig.org/portlets/FunctionalTestsPortlet/tags/FunctionalTestsPortlet-1.0.1@15881 f5dbab47-78f9-eb45-b975-e544023573eb
- Loading branch information
Showing
4 changed files
with
142 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/org/jasig/portlet/test/mvc/tests/LocaleTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright 2007 The JA-SIG Collaborative. All rights reserved. | ||
* See license distributed with this file and | ||
* available online at http://www.uportal.org/license.html | ||
*/ | ||
package org.jasig.portlet.test.mvc.tests; | ||
|
||
import java.util.Enumeration; | ||
import java.util.HashMap; | ||
import java.util.Locale; | ||
import java.util.Map; | ||
|
||
import javax.portlet.RenderRequest; | ||
import javax.portlet.RenderResponse; | ||
|
||
import org.apache.commons.collections15.EnumerationUtils; | ||
import org.springframework.web.portlet.ModelAndView; | ||
import org.springframework.web.portlet.mvc.AbstractController; | ||
|
||
/** | ||
* @author Eric Dalquist | ||
* @version $Revision$ | ||
*/ | ||
public class LocaleTest extends AbstractController { | ||
/* (non-Javadoc) | ||
* @see org.springframework.web.portlet.mvc.AbstractController#handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse) | ||
*/ | ||
@Override | ||
protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception { | ||
final Locale preferedRequestLocale = request.getLocale(); | ||
final Enumeration<Locale> requestLocales = request.getLocales(); | ||
final Locale responseLocale = response.getLocale(); | ||
|
||
final Map<String, Object> model = new HashMap<String, Object>(); | ||
model.put("preferedRequestLocale", preferedRequestLocale); | ||
model.put("requestLocales", EnumerationUtils.toList(requestLocales)); | ||
model.put("responseLocale", responseLocale); | ||
|
||
return new ModelAndView("localeTest", model); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<%@ include file="/WEB-INF/jsp/include.jsp" %> | ||
|
||
<%@ include file="/WEB-INF/jsp/testSelectorHeader.jsp" %> | ||
|
||
<table> | ||
<tbody> | ||
<tr> | ||
<td align="right">Prefered Request Locale: </td> | ||
<td>${preferedRequestLocale}</td> | ||
</tr> | ||
<tr> | ||
<td align="right">Request Locales: </td> | ||
<td> | ||
<ol> | ||
<c:forEach var="requestLocale" items="${requestLocales}"> | ||
<li>${requestLocale}</li> | ||
</c:forEach> | ||
</ol> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td align="right">Response Locale: </td> | ||
<td>${responseLocale}</td> | ||
</tr> | ||
</tbody> | ||
</table> |