|
From: Julien V. <ju...@jb...> - 2006-07-08 00:33:09
|
User: julien
Date: 06/07/07 20:33:06
Modified: server/src/main/org/jboss/portal/server
PortalConstants.java ServerRequestContext.java
Log:
- improve request decoding of the media type from the content type
- added test case to ensure this is done correctly by the portal servlet
Revision Changes Path
1.20 +7 -2 jboss-portal/server/src/main/org/jboss/portal/server/PortalConstants.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PortalConstants.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/server/src/main/org/jboss/portal/server/PortalConstants.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- PortalConstants.java 5 Jul 2006 16:58:34 -0000 1.19
+++ PortalConstants.java 8 Jul 2006 00:33:06 -0000 1.20
@@ -23,11 +23,13 @@
import org.jboss.portal.common.util.Version;
+import java.nio.charset.Charset;
+
/**
* Defines various constants for the portal.
*
* @author <a href="mailto:ju...@jb...">Julien Viet</a>
- * @version $Revision: 1.19 $
+ * @version $Revision: 1.20 $
*/
public class PortalConstants
{
@@ -43,6 +45,9 @@
/** . */
public static final String MULTIPART_FORM_DATA = "multipart/form-data";
+ /** . */
+ public static final Charset UTF_8 = Charset.forName("UTF-8");
+
// Portal properties
public static String PORTAL_PROP_NAME_KEY = "org.jboss.portal.property.name";
1.7 +12 -1 jboss-portal/server/src/main/org/jboss/portal/server/ServerRequestContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerRequestContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/server/src/main/org/jboss/portal/server/ServerRequestContext.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- ServerRequestContext.java 4 Jul 2006 10:07:51 -0000 1.6
+++ ServerRequestContext.java 8 Jul 2006 00:33:06 -0000 1.7
@@ -25,10 +25,11 @@
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
+import java.nio.charset.Charset;
/**
* @author <a href="mailto:ju...@jb...">Julien Viet</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public interface ServerRequestContext
{
@@ -39,6 +40,16 @@
Map getParameterMap();
/**
+ * Return the normalized media type of the request or null if none has been provided by the client.
+ */
+ String getMediaType();
+
+ /**
+ * Return the charset of the request or null if none has been provided by the client.
+ */
+ // Charset getCharset();
+
+ /**
* Return the url context of this request.
*/
URLContext getURLContext();
|