Java Doc for RequestUtils.java in  » J2EE » spring-framework-2.0.6 » org » springframework » web » bind » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.web.bind 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.web.bind.RequestUtils

RequestUtils
abstract public class RequestUtils (Code)
Parameter extraction methods, for an approach distinct from data binding, in which parameters of specific types are required.

This approach is very useful for simple submissions, where binding request parameters to a command object would be overkill.
author:
   Rod Johnson
author:
   Juergen Hoeller
author:
   Keith Donald
See Also:   ServletRequestUtils





Method Summary
public static  BooleangetBooleanParameter(HttpServletRequest request, String name)
     Get a Boolean parameter, or null if not present. Throws an exception if it the parameter value isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e.

public static  booleangetBooleanParameter(HttpServletRequest request, String name, boolean defaultVal)
     Get a boolean parameter, with a fallback value.
public static  boolean[]getBooleanParameters(HttpServletRequest request, String name)
     Get an array of boolean parameters, return an empty array if not found.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e.

public static  DoublegetDoubleParameter(HttpServletRequest request, String name)
     Get a Double parameter, or null if not present.
public static  doublegetDoubleParameter(HttpServletRequest request, String name, double defaultVal)
     Get a double parameter, with a fallback value.
public static  double[]getDoubleParameters(HttpServletRequest request, String name)
     Get an array of double parameters, return an empty array if not found.
public static  FloatgetFloatParameter(HttpServletRequest request, String name)
     Get a Float parameter, or null if not present.
public static  floatgetFloatParameter(HttpServletRequest request, String name, float defaultVal)
     Get a float parameter, with a fallback value.
public static  float[]getFloatParameters(HttpServletRequest request, String name)
     Get an array of float parameters, return an empty array if not found.
public static  IntegergetIntParameter(HttpServletRequest request, String name)
     Get an Integer parameter, or null if not present.
public static  intgetIntParameter(HttpServletRequest request, String name, int defaultVal)
     Get an int parameter, with a fallback value.
public static  int[]getIntParameters(HttpServletRequest request, String name)
     Get an array of int parameters, return an empty array if not found.
public static  LonggetLongParameter(HttpServletRequest request, String name)
     Get a Long parameter, or null if not present.
public static  longgetLongParameter(HttpServletRequest request, String name, long defaultVal)
     Get a long parameter, with a fallback value.
public static  long[]getLongParameters(HttpServletRequest request, String name)
     Get an array of long parameters, return an empty array if not found.
public static  booleangetRequiredBooleanParameter(HttpServletRequest request, String name)
     Get a boolean parameter, throwing an exception if it isn't found or isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e.

public static  boolean[]getRequiredBooleanParameters(HttpServletRequest request, String name)
     Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e.

public static  doublegetRequiredDoubleParameter(HttpServletRequest request, String name)
     Get a double parameter, throwing an exception if it isn't found or isn't a number.
public static  double[]getRequiredDoubleParameters(HttpServletRequest request, String name)
     Get an array of double parameters, throwing an exception if not found or one is not a number.
public static  floatgetRequiredFloatParameter(HttpServletRequest request, String name)
     Get a float parameter, throwing an exception if it isn't found or isn't a number.
public static  float[]getRequiredFloatParameters(HttpServletRequest request, String name)
     Get an array of float parameters, throwing an exception if not found or one is not a number.
public static  intgetRequiredIntParameter(HttpServletRequest request, String name)
     Get an int parameter, throwing an exception if it isn't found or isn't a number.
public static  int[]getRequiredIntParameters(HttpServletRequest request, String name)
     Get an array of int parameters, throwing an exception if not found or one is not a number..
public static  longgetRequiredLongParameter(HttpServletRequest request, String name)
     Get a long parameter, throwing an exception if it isn't found or isn't a number.
public static  long[]getRequiredLongParameters(HttpServletRequest request, String name)
     Get an array of long parameters, throwing an exception if not found or one is not a number.
public static  StringgetRequiredStringParameter(HttpServletRequest request, String name)
     Get a String parameter, throwing an exception if it isn't found or is empty.
public static  String[]getRequiredStringParameters(HttpServletRequest request, String name)
     Get an array of String parameters, throwing an exception if not found or one is empty.
public static  StringgetStringParameter(HttpServletRequest request, String name)
     Get a String parameter, or null if not present.
public static  StringgetStringParameter(HttpServletRequest request, String name, String defaultVal)
     Get a String parameter, with a fallback value.
public static  String[]getStringParameters(HttpServletRequest request, String name)
     Get an array of String parameters, return an empty array if not found.
public static  voidrejectRequestMethod(HttpServletRequest request, String method)
     Throw a ServletException if the given HTTP request method should be rejected.



Method Detail
getBooleanParameter
public static Boolean getBooleanParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a Boolean parameter, or null if not present. Throws an exception if it the parameter value isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter the Boolean value, or null if not present
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught




getBooleanParameter
public static boolean getBooleanParameter(HttpServletRequest request, String name, boolean defaultVal)(Code)
Get a boolean parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
Parameters:
  defaultVal - the default value to use as fallback




getBooleanParameters
public static boolean[] getBooleanParameters(HttpServletRequest request, String name)(Code)
Get an array of boolean parameters, return an empty array if not found.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values




getDoubleParameter
public static Double getDoubleParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a Double parameter, or null if not present. Throws an exception if it the parameter value isn't a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter the Double value, or null if not present
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getDoubleParameter
public static double getDoubleParameter(HttpServletRequest request, String name, double defaultVal)(Code)
Get a double parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
Parameters:
  defaultVal - the default value to use as fallback



getDoubleParameters
public static double[] getDoubleParameters(HttpServletRequest request, String name)(Code)
Get an array of double parameters, return an empty array if not found.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values



getFloatParameter
public static Float getFloatParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a Float parameter, or null if not present. Throws an exception if it the parameter value isn't a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter the Float value, or null if not present
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getFloatParameter
public static float getFloatParameter(HttpServletRequest request, String name, float defaultVal)(Code)
Get a float parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
Parameters:
  defaultVal - the default value to use as fallback



getFloatParameters
public static float[] getFloatParameters(HttpServletRequest request, String name)(Code)
Get an array of float parameters, return an empty array if not found.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values



getIntParameter
public static Integer getIntParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get an Integer parameter, or null if not present. Throws an exception if it the parameter value isn't a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter the Integer value, or null if not present
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getIntParameter
public static int getIntParameter(HttpServletRequest request, String name, int defaultVal)(Code)
Get an int parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
Parameters:
  defaultVal - the default value to use as fallback



getIntParameters
public static int[] getIntParameters(HttpServletRequest request, String name)(Code)
Get an array of int parameters, return an empty array if not found.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values



getLongParameter
public static Long getLongParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a Long parameter, or null if not present. Throws an exception if it the parameter value isn't a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter the Long value, or null if not present
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getLongParameter
public static long getLongParameter(HttpServletRequest request, String name, long defaultVal)(Code)
Get a long parameter, with a fallback value. Never throws an exception. Can pass a distinguished value as default to enable checks of whether it was supplied.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
Parameters:
  defaultVal - the default value to use as fallback



getLongParameters
public static long[] getLongParameters(HttpServletRequest request, String name)(Code)
Get an array of long parameters, return an empty array if not found.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values



getRequiredBooleanParameter
public static boolean getRequiredBooleanParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a boolean parameter, throwing an exception if it isn't found or isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught




getRequiredBooleanParameters
public static boolean[] getRequiredBooleanParameters(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get an array of boolean parameters, throwing an exception if not found or one isn't a boolean.

Accepts "true", "on", "yes" (any case) and "1" as values for true; treats every other non-empty value as false (i.e. parses leniently).
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught




getRequiredDoubleParameter
public static double getRequiredDoubleParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a double parameter, throwing an exception if it isn't found or isn't a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredDoubleParameters
public static double[] getRequiredDoubleParameters(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get an array of double parameters, throwing an exception if not found or one is not a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredFloatParameter
public static float getRequiredFloatParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a float parameter, throwing an exception if it isn't found or isn't a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredFloatParameters
public static float[] getRequiredFloatParameters(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get an array of float parameters, throwing an exception if not found or one is not a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredIntParameter
public static int getRequiredIntParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get an int parameter, throwing an exception if it isn't found or isn't a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredIntParameters
public static int[] getRequiredIntParameters(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get an array of int parameters, throwing an exception if not found or one is not a number..
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredLongParameter
public static long getRequiredLongParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a long parameter, throwing an exception if it isn't found or isn't a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredLongParameters
public static long[] getRequiredLongParameters(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get an array of long parameters, throwing an exception if not found or one is not a number.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredStringParameter
public static String getRequiredStringParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a String parameter, throwing an exception if it isn't found or is empty.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getRequiredStringParameters
public static String[] getRequiredStringParameters(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get an array of String parameters, throwing an exception if not found or one is empty.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getStringParameter
public static String getStringParameter(HttpServletRequest request, String name) throws ServletRequestBindingException(Code)
Get a String parameter, or null if not present. Throws an exception if it the parameter value is empty.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter the String value, or null if not present
throws:
  ServletRequestBindingException - a subclass of ServletException,so it doesn't need to be caught



getStringParameter
public static String getStringParameter(HttpServletRequest request, String name, String defaultVal)(Code)
Get a String parameter, with a fallback value. Never throws an exception. Can pass a distinguished value to default to enable checks of whether it was supplied.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter
Parameters:
  defaultVal - the default value to use as fallback



getStringParameters
public static String[] getStringParameters(HttpServletRequest request, String name)(Code)
Get an array of String parameters, return an empty array if not found.
Parameters:
  request - current HTTP request
Parameters:
  name - the name of the parameter with multiple possible values



rejectRequestMethod
public static void rejectRequestMethod(HttpServletRequest request, String method) throws ServletException(Code)
Throw a ServletException if the given HTTP request method should be rejected.
Parameters:
  request - request to check
Parameters:
  method - method (such as "GET") which should be rejected
throws:
  ServletException - if the given HTTP request is rejected



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.