Java Doc for StrutsUtils.java in  » Template-Engine » Velocity » org » apache » velocity » tools » struts » 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 » Template Engine » Velocity » org.apache.velocity.tools.struts 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.velocity.tools.struts.StrutsUtils

StrutsUtils
public class StrutsUtils (Code)

A utility class to expose the Struts shared resources. All methods are static.

This class is provided for use by Velocity view tools that need access to Struts resources. By having all Struts- specific code in this utility class, maintenance is simplified and reuse fostered.

It is the aim, that sooner or later the functionality in this class is integrated into Struts itself. See Bug #16814 for more on that.


author:
   Marino A. Jonsson
author:
   Nathan Bubna
author:
   Gabe Sidler
author:
   based on code by Ted Husted
version:
   $Id: StrutsUtils.java 479724 2006-11-27 18:49:37Z nbubna $




Method Summary
public static  StringerrorMarkup(String property, HttpServletRequest request, HttpSession session, ServletContext application)
     Returns a formatted error message.
public static  StringerrorMarkup(String property, String bundle, HttpServletRequest request, HttpSession session, ServletContext application)
     Returns a formatted error message.
public static  ActionFormgetActionForm(HttpServletRequest request, HttpSession session)
     Returns the ActionForm bean associated with this request of null if none exists.
public static  StringgetActionFormName(HttpServletRequest request, HttpSession session)
     Returns the ActionForm name associated with this request of null if none exists.
public static  StringgetActionMappingName(String action)
     Return the form action converted into an action mapping path.
public static  StringgetActionMappingURL(ServletContext application, HttpServletRequest request, String action)
     Returns the form action converted into a server-relative URI reference.
public static  ActionMessagesgetErrors(HttpServletRequest request)
     Returns the Struts errors for this request or null if none exist.
public static  StringgetForwardURL(HttpServletRequest request, ServletContext app, String forward)
     Returns the action forward name converted into a server-relative URI reference.
public static  LocalegetLocale(HttpServletRequest request, HttpSession session)
     Returns the java.util.Locale for the user.
public static  MessageResourcesgetMessageResources(HttpServletRequest request, ServletContext app)
     Returns the message resources for this application or null if not found.
public static  MessageResourcesgetMessageResources(HttpServletRequest request, ServletContext app, String bundle)
     Returns the message resources with the specified bundle name for this application or null if not found.
Parameters:
  app - the servlet context
Parameters:
  bundle - The bundle name to look for.
public static  ActionMessagesgetMessages(HttpServletRequest request)
     Returns the Struts messages for this request or null if none exist.
public static  StringgetToken(HttpSession session)
     Returns the transaction token stored in this session or null if not used.
public static  ModuleConfigselectModule(String urlPath, ServletContext app)
     Select the module to which the specified request belongs, and add return the corresponding ModuleConfig.



Method Detail
errorMarkup
public static String errorMarkup(String property, HttpServletRequest request, HttpSession session, ServletContext application)(Code)
Returns a formatted error message. The error message is assembled from the following three pieces: First, value of message resource "errors.header" is prepended. Then, the list of error messages is rendered. Finally, the value of message resource "errors.footer" is appended.
Parameters:
  property - the category of errors to markup and return
Parameters:
  request - the servlet request
Parameters:
  session - the HTTP session
Parameters:
  application - the servlet context The formatted error message. If no error messages are queued,an empty string is returned.



errorMarkup
public static String errorMarkup(String property, String bundle, HttpServletRequest request, HttpSession session, ServletContext application)(Code)
Returns a formatted error message. The error message is assembled from the following three pieces: First, value of message resource "errors.header" is prepended. Then, the list of error messages is rendered. Finally, the value of message resource "errors.footer" is appended.
Parameters:
  property - the category of errors to markup and return
Parameters:
  bundle - the message resource bundle to use
Parameters:
  request - the servlet request
Parameters:
  session - the HTTP session
Parameters:
  application - the servlet context
since:
   VelocityTools 1.1 The formatted error message. If no error messages are queued,an empty string is returned.



getActionForm
public static ActionForm getActionForm(HttpServletRequest request, HttpSession session)(Code)
Returns the ActionForm bean associated with this request of null if none exists.
Parameters:
  request - the servlet request
Parameters:
  session - the HTTP session



getActionFormName
public static String getActionFormName(HttpServletRequest request, HttpSession session)(Code)
Returns the ActionForm name associated with this request of null if none exists.
Parameters:
  request - the servlet request
Parameters:
  session - the HTTP session



getActionMappingName
public static String getActionMappingName(String action)(Code)
Return the form action converted into an action mapping path. The value of the action property is manipulated as follows in computing the name of the requested mapping:
  • Any filename extension is removed (on the theory that extension mapping is being used to select the controller servlet).
  • If the resulting value does not start with a slash, then a slash is prepended.



getActionMappingURL
public static String getActionMappingURL(ServletContext application, HttpServletRequest request, String action)(Code)
Returns the form action converted into a server-relative URI reference.
Parameters:
  application - the servlet context
Parameters:
  request - the servlet request
Parameters:
  action - the name of an action as per struts-config.xml



getErrors
public static ActionMessages getErrors(HttpServletRequest request)(Code)
Returns the Struts errors for this request or null if none exist. Since VelocityTools 1.2, this will also check the session (if there is one) for errors if there are no errors in the request.
Parameters:
  request - the servlet request
since:
   VelocityTools 1.1



getForwardURL
public static String getForwardURL(HttpServletRequest request, ServletContext app, String forward)(Code)
Returns the action forward name converted into a server-relative URI reference.
Parameters:
  app - the servlet context
Parameters:
  request - the servlet request
Parameters:
  forward - the name of a forward as per struts-config.xml



getLocale
public static Locale getLocale(HttpServletRequest request, HttpSession session)(Code)
Returns the java.util.Locale for the user. If a locale object is not found in the user's session, the system default locale is returned.
Parameters:
  request - the servlet request
Parameters:
  session - the HTTP session



getMessageResources
public static MessageResources getMessageResources(HttpServletRequest request, ServletContext app)(Code)
Returns the message resources for this application or null if not found.
Parameters:
  app - the servlet context
since:
   VelocityTools 1.1



getMessageResources
public static MessageResources getMessageResources(HttpServletRequest request, ServletContext app, String bundle)(Code)
Returns the message resources with the specified bundle name for this application or null if not found.
Parameters:
  app - the servlet context
Parameters:
  bundle - The bundle name to look for. If this is null, thedefault bundle name is used.
since:
   VelocityTools 1.1



getMessages
public static ActionMessages getMessages(HttpServletRequest request)(Code)
Returns the Struts messages for this request or null if none exist. Since VelocityTools 1.2, this will also check the session (if there is one) for messages if there are no messages in the request.
Parameters:
  request - the servlet request
since:
   VelocityTools 1.1



getToken
public static String getToken(HttpSession session)(Code)
Returns the transaction token stored in this session or null if not used.
Parameters:
  session - the HTTP session



selectModule
public static ModuleConfig selectModule(String urlPath, ServletContext app)(Code)
Select the module to which the specified request belongs, and add return the corresponding ModuleConfig.
Parameters:
  urlPath - The requested URL
Parameters:
  app - The ServletContext for this web application The ModuleConfig for the given URL path
since:
   VelocityTools 1.1



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.