HDIV API 2.0.4

org.hdiv.action
Class HDIVRequestProcessor

java.lang.Object
  extended by org.apache.struts.action.RequestProcessor
      extended by org.hdiv.action.HDIVRequestProcessor

public class HDIVRequestProcessor
extends org.apache.struts.action.RequestProcessor

Struts' RequestProcessor extension to visualize the errors produced in the editable fields detected by HDIV.

Since:
HDIV 1.1
Author:
Gorka Vicente, Roberto Velasco
See Also:
RequestProcessor

Field Summary
 
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, log, moduleConfig, servlet
 
Constructor Summary
HDIVRequestProcessor()
           
 
Method Summary
 java.lang.String createMessageError(java.lang.String[] values)
          It creates the message error from the values values.
 org.apache.struts.action.ActionMessages getEditableParametersErrors(javax.servlet.http.HttpServletRequest request)
          Obtains the errors detected by HDIV during the validation process of the editable parameters.
protected  void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.config.ForwardConfig forward)
          Forward or redirect to the specified destination, by the specified mechanism.
protected  boolean processValidate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
           If this request was not cancelled, and the request's ActionMapping has not disabled validation, call the validate method of the specified ActionForm, and forward to the input path if there were any errors.
 
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doForward, doInclude, getInternal, getServletContext, init, internalModuleRelativeForward, internalModuleRelativeInclude, process, processActionCreate, processActionForm, processActionPerform, processCachedMessages, processContent, processException, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HDIVRequestProcessor

public HDIVRequestProcessor()
Method Detail

processValidate

protected boolean processValidate(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  org.apache.struts.action.ActionForm form,
                                  org.apache.struts.action.ActionMapping mapping)
                           throws java.io.IOException,
                                  javax.servlet.ServletException,
                                  org.apache.struts.action.InvalidCancelException

If this request was not cancelled, and the request's ActionMapping has not disabled validation, call the validate method of the specified ActionForm, and forward to the input path if there were any errors. Return true if we should continue processing, or false if we have already forwarded control back to the input form.

Overrides:
processValidate in class org.apache.struts.action.RequestProcessor
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
form - The ActionForm instance we are populating
mapping - The ActionMapping we are using
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs
org.apache.struts.action.InvalidCancelException - if a cancellation is attempted without the proper action configuration

getEditableParametersErrors

public org.apache.struts.action.ActionMessages getEditableParametersErrors(javax.servlet.http.HttpServletRequest request)
Obtains the errors detected by HDIV during the validation process of the editable parameters.

Parameters:
request - The servlet request we are processing
Returns:
errors detected by HDIV during the validation process of the editable parameters.

createMessageError

public java.lang.String createMessageError(java.lang.String[] values)
It creates the message error from the values values.

Parameters:
values - values with not allowed characters
Returns:
message error to show

processForwardConfig

protected void processForwardConfig(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    org.apache.struts.config.ForwardConfig forward)
                             throws java.io.IOException,
                                    javax.servlet.ServletException

Forward or redirect to the specified destination, by the specified mechanism. This method uses a ForwardConfig object instead an ActionForward.

Overrides:
processForwardConfig in class org.apache.struts.action.RequestProcessor
Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
forward - The ForwardConfig controlling where we go next
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs
Since:
HDIV 2.0.1

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.