Java Doc for AbstractHttpServlet.java in  » Scripting » groovy-1.0 » groovy » servlet » 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 » Scripting » groovy 1.0 » groovy.servlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.servlet.http.HttpServlet
   groovy.servlet.AbstractHttpServlet

All known Subclasses:   groovy.servlet.TemplateServlet,  groovy.servlet.GroovyServlet,
AbstractHttpServlet
abstract public class AbstractHttpServlet extends HttpServlet implements ResourceConnector(Code)
A common ground dealing with the HTTP servlet API wrinkles.

Resource name mangling (pattern replacement)

Also implements Groovy's groovy.util.ResourceConnector in dynamic manner. It allows to modifiy the resource name that is searched for with a replace all operation. See java.util.regex.Pattern and java.util.regex.Matcher for details. The servlet init parameter names are:

 resource.name.regex = empty - defaults to null
 resource.name.replacement = empty - defaults to null
 resource.name.replace.all = true (default) | false means replaceFirst()
 
Note: If you specify a regex, you have to specify a replacement string too! Otherwise an exception gets raised.

Logging and bug-hunting options

This implementation provides a verbosity flag switching log statements. The servlet init parameter name is:

 verbose = false(default) | true
 

In order to support class-loading-troubles-debugging with Tomcat 4 or higher, you can log the class loader responsible for loading some classes. See GROOVY-861 for details. The servlet init parameter name is:

 log.GROOVY861 = false(default) | true
 

If you experience class-loading-troubles with Tomcat 4 (or higher) or any other servlet container using custom class loader setups, you can fallback to use (slower) reflection in Groovy's MetaClass implementation. Please contact the dev team with your problem! Thanks. The servlet init parameter name is:

 reflection = false(default) | true
 

author:
   Christian Stein


Field Summary
final public static  StringCONTENT_TYPE_TEXT_HTML
     Content type of the HTTP response.
final public static  StringINC_PATH_INFO
    
final public static  StringINC_REQUEST_URI
    
final public static  StringINC_SERVLET_PATH
    
protected  booleanreflection
     Mirrors the static value of the reflection flag in MetaClass.
protected  MatcherresourceNameMatcher
     Null or compiled pattern matcher read from "resource.name.regex" and used in AbstractHttpServlet.getResourceConnection(String) .
protected  booleanresourceNameReplaceAll
     The replace method to use on the matcher.
protected  StringresourceNameReplacement
     The replacement used by the resource name matcher.
protected  ServletContextservletContext
     Servlet (or the web application) context.
protected  booleanverbose
     Controls almost all log output.

Constructor Summary
public  AbstractHttpServlet()
     Initializes all fields with default values.

Method Summary
public  URLConnectiongetResourceConnection(String name)
     Interface method for ResourceContainer.
protected  StringgetScriptUri(HttpServletRequest request)
     Returns the include-aware uri of the script or template file.
protected  FilegetScriptUriAsFile(HttpServletRequest request)
     Parses the http request for the real script or template source file.
public  voidinit(ServletConfig config)
     Overrides the generic init method to set some debug flags.

Field Detail
CONTENT_TYPE_TEXT_HTML
final public static String CONTENT_TYPE_TEXT_HTML(Code)
Content type of the HTTP response.



INC_PATH_INFO
final public static String INC_PATH_INFO(Code)
Servlet API include key name: path_info



INC_REQUEST_URI
final public static String INC_REQUEST_URI(Code)



INC_SERVLET_PATH
final public static String INC_SERVLET_PATH(Code)
Servlet API include key name: servlet_path



reflection
protected boolean reflection(Code)
Mirrors the static value of the reflection flag in MetaClass. See AbstractHttpServlet.logGROOVY861



resourceNameMatcher
protected Matcher resourceNameMatcher(Code)
Null or compiled pattern matcher read from "resource.name.regex" and used in AbstractHttpServlet.getResourceConnection(String) .



resourceNameReplaceAll
protected boolean resourceNameReplaceAll(Code)
The replace method to use on the matcher.
 true - replaceAll(resourceNameReplacement); (default)
 false - replaceFirst(resourceNameReplacement);
 



resourceNameReplacement
protected String resourceNameReplacement(Code)
The replacement used by the resource name matcher.



servletContext
protected ServletContext servletContext(Code)
Servlet (or the web application) context.



verbose
protected boolean verbose(Code)
Controls almost all log output.




Constructor Detail
AbstractHttpServlet
public AbstractHttpServlet()(Code)
Initializes all fields with default values.




Method Detail
getResourceConnection
public URLConnection getResourceConnection(String name) throws ResourceException(Code)
Interface method for ResourceContainer. This is used by the GroovyScriptEngine.



getScriptUri
protected String getScriptUri(HttpServletRequest request)(Code)
Returns the include-aware uri of the script or template file.
Parameters:
  request - the http request to analyze the include-aware uri either parsed from request attributes orhints provided by the servlet container



getScriptUriAsFile
protected File getScriptUriAsFile(HttpServletRequest request)(Code)
Parses the http request for the real script or template source file.
Parameters:
  request - the http request to analyze a file object using an absolute file path name



init
public void init(ServletConfig config) throws ServletException(Code)
Overrides the generic init method to set some debug flags.
Parameters:
  config - the servlet coniguration provided by the container
throws:
  ServletException - if init() method defined in super class javax.servlet.GenericServlet throws it



Methods inherited from javax.servlet.http.HttpServlet
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected long getLastModified(HttpServletRequest req)(Code)(Java Doc)
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(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.