http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/components/UrlRenderer.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/components/UrlRenderer.java b/core/src/main/java/org/apache/struts2/components/UrlRenderer.java index a9de852..389fb39 100644 --- a/core/src/main/java/org/apache/struts2/components/UrlRenderer.java +++ b/core/src/main/java/org/apache/struts2/components/UrlRenderer.java @@ -34,7 +34,7 @@ public interface UrlRenderer { /** * Preprocessing step - * @param provider + * @param provider The {@link UrlProvider} component that "owns" this renderer. */ void beforeRenderUrl(UrlProvider provider);
http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java b/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java index 52b76ab..f161b24 100644 --- a/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java +++ b/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java @@ -84,7 +84,7 @@ import java.util.StringTokenizer; * The following is a list of the allowed extension points: * * <!-- START SNIPPET: extensionPoints --> - * <table border="1"> + * <table border="1" summary=""> * <tr> * <th>Type</th> * <th>Property</th> @@ -289,7 +289,7 @@ import java.util.StringTokenizer; * <td>com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor</td> * <td>struts.converter.file.processor</td> * <td>singleton</td> - * <td>Process <class>-conversion.properties file create converters</class></td> + * <td>Process <class>-conversion.properties file create converters</class></td> * </tr> * <tr> * <td>com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor</td> @@ -337,19 +337,22 @@ import java.util.StringTokenizer; * </table> * * <!-- END SNIPPET: extensionPoints --> - * </p> + * * <p> * Implementations are selected using the value of its associated property. That property is * used to determine the implementation by: * </p> + * * <ol> * <li>Trying to find an existing bean by that name in the container</li> * <li>Trying to find a class by that name, then creating a new bean factory for it</li> * <li>Creating a new delegation bean factory that delegates to the configured ObjectFactory at runtime</li> * </ol> + * * <p> * Finally, this class overrides certain properties if dev mode is enabled: * </p> + * * <ul> * <li><code>struts.i18n.reload = true</code></li> * <li><code>struts.configuration.xml.reload = true</code></li> http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/config/PropertiesConfigurationProvider.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/config/PropertiesConfigurationProvider.java b/core/src/main/java/org/apache/struts2/config/PropertiesConfigurationProvider.java index 7a42232..a0e1928 100644 --- a/core/src/main/java/org/apache/struts2/config/PropertiesConfigurationProvider.java +++ b/core/src/main/java/org/apache/struts2/config/PropertiesConfigurationProvider.java @@ -50,8 +50,8 @@ public class PropertiesConfigurationProvider implements ConfigurationProvider { } /** - * @param props - * @param settings + * @param props properties + * @param settings settings */ protected void loadSettings(LocatableProperties props, final Settings settings) { for (Iterator i = settings.list(); i.hasNext(); ) { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/DefaultStaticContentLoader.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/DefaultStaticContentLoader.java b/core/src/main/java/org/apache/struts2/dispatcher/DefaultStaticContentLoader.java index d072834..9fe3858 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/DefaultStaticContentLoader.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/DefaultStaticContentLoader.java @@ -274,7 +274,7 @@ public class DefaultStaticContentLoader implements StaticContentLoader { * @param name resource name * @param packagePrefix The package prefix to use to locate the resource * @return full path - * @throws UnsupportedEncodingException + * @throws UnsupportedEncodingException If there is a encoding problem */ protected String buildPath(String name, String packagePrefix) throws UnsupportedEncodingException { String resourcePath; http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java index b56db9c..93d38a4 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java @@ -761,12 +761,16 @@ public class Dispatcher { } /** + * <p> * Wrap and return the given request or return the original request object. * </p> + * + * <p> * This method transparently handles multipart data as a wrapped class around the given request. * Override this method to handle multipart requests in a special way or to handle other types of requests. * Note, {@link org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper} is * flexible - look first to that object before overriding this method to handle multipart data. + * </p> * * @param request the HttpServletRequest object. * @return a wrapped request or original request. @@ -797,7 +801,7 @@ public class Dispatcher { * On each request it must return a new instance as implementation could be not thread safe * and thus ensure of resource clean up * - * @return + * @return a multi part request object */ protected MultiPartRequest getMultiPartRequest() { MultiPartRequest mpr = null; http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/ExecuteOperations.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/ExecuteOperations.java b/core/src/main/java/org/apache/struts2/dispatcher/ExecuteOperations.java index 43f00f4..b7d26eb 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/ExecuteOperations.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/ExecuteOperations.java @@ -41,9 +41,12 @@ public class ExecuteOperations { /** * Tries to execute a request for a static resource + * + * @param request servlet request + * @param response servlet response * @return True if it was handled, false if the filter should fall through - * @throws IOException - * @throws ServletException + * @throws IOException on any io error + * @throws ServletException on any servlet related error */ public boolean executeStaticResourceRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // there is no action in this request, should we look for a static resource? @@ -67,7 +70,12 @@ public class ExecuteOperations { /** * Executes an action - * @throws ServletException + * + * @param request servlet request + * @param response servlet response + * @param mapping action mapping + * + * @throws ServletException on any servlet related error */ public void executeAction(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping) throws ServletException { dispatcher.serviceAction(request, response, mapping); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/InitOperations.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/InitOperations.java b/core/src/main/java/org/apache/struts2/dispatcher/InitOperations.java index da0f163..1b13cfc 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/InitOperations.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/InitOperations.java @@ -39,6 +39,7 @@ public class InitOperations { /** * Initializes the internal Struts logging * + * @param filterConfig host configuration * @deprecated since 2.5 */ @Deprecated @@ -64,6 +65,10 @@ public class InitOperations { /** * Creates and initializes the dispatcher + * + * @param filterConfig host configuration + * + * @return the dispatcher */ public Dispatcher initDispatcher( HostConfig filterConfig ) { Dispatcher dispatcher = createDispatcher(filterConfig); @@ -73,6 +78,10 @@ public class InitOperations { /** * Initializes the static content loader with the filter configuration + * + * @param filterConfig host configuration + * @param dispatcher the dispatcher + * @return the static content loader */ public StaticContentLoader initStaticContentLoader( HostConfig filterConfig, Dispatcher dispatcher ) { StaticContentLoader loader = dispatcher.getContainer().getInstance(StaticContentLoader.class); @@ -95,6 +104,10 @@ public class InitOperations { /** * Create a {@link Dispatcher} + * + * @param filterConfig host configuration + * + * @return The dispatcher on the thread. */ private Dispatcher createDispatcher( HostConfig filterConfig ) { Map<String, String> params = new HashMap<>(); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java b/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java index ab6861f..547997b 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java @@ -61,6 +61,11 @@ public class PrepareOperations { /** * Creates the action context and initializes the thread local + * + * @param request servlet request + * @param response servlet response + * + * @return the action context */ public ActionContext createActionContext(HttpServletRequest request, HttpServletResponse response) { ActionContext ctx; @@ -86,6 +91,8 @@ public class PrepareOperations { /** * Cleans up a request of thread locals + * + * @param request servlet request */ public void cleanupRequest(HttpServletRequest request) { Integer counterVal = (Integer) request.getAttribute(CLEANUP_RECURSION_COUNTER); @@ -116,6 +123,9 @@ public class PrepareOperations { /** * Sets the request encoding and locale on the response + * + * @param request servlet request + * @param response servlet response */ public void setEncodingAndLocale(HttpServletRequest request, HttpServletResponse response) { dispatcher.prepare(request, response); @@ -123,8 +133,11 @@ public class PrepareOperations { /** * Wraps the request with the Struts wrapper that handles multipart requests better + * + * @param oldRequest servlet request + * * @return The new request, if there is one - * @throws ServletException + * @throws ServletException on any servlet related error */ public HttpServletRequest wrapRequest(HttpServletRequest oldRequest) throws ServletException { HttpServletRequest request = oldRequest; @@ -139,9 +152,14 @@ public class PrepareOperations { } /** - * Finds and optionally creates an {@link ActionMapping}. It first looks in the current request to see if one + * Finds and optionally creates an {@link ActionMapping}. It first looks in the current request to see if one * has already been found, otherwise, it creates it and stores it in the request. No mapping will be created in the * case of static resource requests or unidentifiable requests for other servlets, for example. + * + * @param request servlet request + * @param response servlet response + * + * @return the action mapping */ public ActionMapping findActionMapping(HttpServletRequest request, HttpServletResponse response) { return findActionMapping(request, response, false); @@ -153,6 +171,11 @@ public class PrepareOperations { * case of static resource requests or unidentifiable requests for other servlets, for example. * @param forceLookup if true, the action mapping will be looked up from the ActionMapper instance, ignoring if there is one * in the request or not + * + * @param request servlet request + * @param response servlet response + * + * @return the action mapping */ public ActionMapping findActionMapping(HttpServletRequest request, HttpServletResponse response, boolean forceLookup) { ActionMapping mapping = (ActionMapping) request.getAttribute(STRUTS_ACTION_MAPPING_KEY); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java b/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java index c728e19..8842f12 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareAndExecuteFilter.java @@ -72,6 +72,9 @@ public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter { /** * Callback for post initialization + * + * @param dispatcher the dispatcher + * @param filterConfig the filter config */ protected void postInit(Dispatcher dispatcher, FilterConfig filterConfig) { } http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java b/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java index 8331c6a..2cfe7f2 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/filter/StrutsPrepareFilter.java @@ -69,6 +69,9 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter { /** * Callback for post initialization + * + * @param dispatcher the dispatcher + * @param filterConfig the filter config */ protected void postInit(Dispatcher dispatcher, FilterConfig filterConfig) { } http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java b/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java index 4933765..95ab0d5 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java @@ -319,6 +319,7 @@ public class DefaultActionMapper implements ActionMapper { * * @param uri The uri * @param mapping The action mapping to populate + * @param configManager configuration manager */ protected void parseNameAndNamespace(String uri, ActionMapping mapping, ConfigurationManager configManager) { String namespace, name; @@ -428,7 +429,7 @@ public class DefaultActionMapper implements ActionMapper { } /** - * Returns null if no extension is specified. + * @return null if no extension is specified. */ protected String getDefaultExtension() { if (extensions == null) { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaStreamMultiPartRequest.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaStreamMultiPartRequest.java b/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaStreamMultiPartRequest.java index 2f92340..6727f3e 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaStreamMultiPartRequest.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaStreamMultiPartRequest.java @@ -71,9 +71,7 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { private Locale defaultLocale = Locale.ENGLISH; /** - * Injects the Struts multiple part maximum size. - * - * @param maxSize + * @param maxSize Injects the Struts multiple part maximum size. */ @Inject(StrutsConstants.STRUTS_MULTIPART_MAXSIZE) public void setMaxSize(String maxSize) { @@ -81,9 +79,7 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { } /** - * Sets the buffer size to be used. - * - * @param bufferSize + * @param bufferSize Sets the buffer size to be used. */ @Inject(value = StrutsConstants.STRUTS_MULTIPART_BUFFERSIZE, required = false) public void setBufferSize(String bufferSize) { @@ -91,9 +87,7 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { } /** - * Injects the Struts locale provider. - * - * @param provider + * @param provider Injects the Struts locale provider. */ @Inject public void setLocaleProvider(LocaleProvider provider) { @@ -143,7 +137,7 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Allows interceptor to fetch non-critical messages that can be passed to the action. * - * @return + * @return list of string messages */ public List<String> getMesssages() { return messages; @@ -253,10 +247,8 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { } /** - * Inspect the servlet request and set the locale if one wasn't provided by + * @param request Inspect the servlet request and set the locale if one wasn't provided by * the Struts2 framework. - * - * @param request */ protected void setLocale(HttpServletRequest request) { if (defaultLocale == null) { @@ -267,8 +259,8 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Processes the upload. * - * @param request - * @param saveDir + * @param request the servlet request + * @param saveDir location of the save dir * @throws Exception */ private void processUpload(HttpServletRequest request, String saveDir) throws Exception { @@ -321,8 +313,8 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Defines whether the request allowed based on content length. * - * @param request - * @return + * @param request the servlet request + * @return true if request size is permitted */ private boolean isRequestSizePermitted(HttpServletRequest request) { // if maxSize is specified as -1, there is no sanity check and it's @@ -336,10 +328,8 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { } /** - * Get the request content length. - * - * @param request - * @return + * @param request the servlet request + * @return the request content length. */ private long getRequestSize(HttpServletRequest request) { long requestSize = 0; @@ -353,8 +343,8 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Add a file skipped message notification for action messages. * - * @param fileName - * @param request + * @param fileName file name + * @param request the servlet request */ private void addFileSkippedError(String fileName, HttpServletRequest request) { String exceptionMessage = "Skipped file " + fileName + "; request size limit exceeded."; @@ -368,7 +358,7 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Processes the FileItemStream as a Form Field. * - * @param itemStream + * @param itemStream file item stream */ private void processFileItemStreamAsFormField(FileItemStream itemStream) { String fieldName = itemStream.getFieldName(); @@ -390,8 +380,8 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Processes the FileItemStream as a file field. * - * @param itemStream - * @param location + * @param itemStream file item stream + * @param location location */ private void processFileItemStreamAsFileField(FileItemStream itemStream, String location) { File file = null; @@ -416,10 +406,10 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Creates a temporary file based on the given filename and location. * - * @param fileName - * @param location - * @return - * @throws IOException + * @param fileName file name + * @param location location + * @return temporary file based on the given filename and location + * @throws IOException in case of IO errors */ private File createTemporaryFile(String fileName, String location) throws IOException { String name = fileName @@ -442,10 +432,10 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Streams the file upload stream to the specified file. * - * @param itemStream - * @param file - * @return - * @throws IOException + * @param itemStream file item stream + * @param file the file + * @return true if stream was successfully + * @throws IOException in case of IO errors */ private boolean streamFileToDisk(FileItemStream itemStream, File file) throws IOException { boolean result = false; @@ -466,8 +456,8 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { * to the <code>FileUploadInterceptor</code> during the interceptor stack * invocation process. * - * @param itemStream - * @param file + * @param itemStream file item stream + * @param file the file */ private void createFileInfoFromItemStream(FileItemStream itemStream, File file) { // gather attributes from file upload stream. @@ -486,10 +476,8 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { } /** - * Get the canonical name based on the supplied filename. - * - * @param fileName - * @return + * @param fileName file name + * @return the canonical name based on the supplied filename */ private String getCanonicalName(String fileName) { int forwardSlash = fileName.lastIndexOf("/"); @@ -505,9 +493,9 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Build error message. * - * @param e - * @param args - * @return + * @param e the Throwable/Exception + * @param args arguments + * @return error message */ private String buildErrorMessage(Throwable e, Object[] args) { String errorKey = "struts.message.upload.error." + e.getClass().getSimpleName(); @@ -518,9 +506,9 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Build action message. * - * @param e - * @param args - * @return + * @param e the Throwable/Exception + * @param args arguments + * @return action message */ private String buildMessage(Throwable e, Object[] args) { String messageKey = "struts.message.upload.message." + e.getClass().getSimpleName(); @@ -532,7 +520,6 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { * Internal data structure used to store a reference to information needed * to later pass post processing data to the <code>FileUploadInterceptor</code>. * - * @version $Revision$ * @since 7.0.0 */ private static class FileInfo implements Serializable { @@ -546,9 +533,9 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { /** * Default constructor. * - * @param file - * @param contentType - * @param originalName + * @param file the file + * @param contentType content type + * @param originalName original file name */ public FileInfo(File file, String contentType, String originalName) { this.file = file; @@ -557,21 +544,21 @@ public class JakartaStreamMultiPartRequest implements MultiPartRequest { } /** - * @return + * @return the file */ public File getFile() { return file; } /** - * @return + * @return content type */ public String getContentType() { return contentType; } /** - * @return + * @return original file name */ public String getOriginalName() { return originalName; http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequest.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequest.java b/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequest.java index 64dfccb..52e415e 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequest.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequest.java @@ -29,8 +29,7 @@ import java.util.List; /** - * Abstract wrapper class HTTP requests to handle multi-part data. <p> - * + * <p>Abstract wrapper class HTTP requests to handle multi-part data. </p> */ public interface MultiPartRequest { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequestWrapper.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequestWrapper.java b/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequestWrapper.java index c74bf63..160664b 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequestWrapper.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/multipart/MultiPartRequestWrapper.java @@ -70,7 +70,8 @@ public class MultiPartRequestWrapper extends StrutsRequestWrapper { * @param multiPartRequest Our MultiPartRequest object * @param request Our HttpServletRequest object * @param saveDir Target directory for any files that we save - * @param provider + * @param provider locale provider + * @param disableRequestAttributeValueStackLookup disable the request attribute value stack lookup */ public MultiPartRequestWrapper(MultiPartRequest multiPartRequest, HttpServletRequest request, String saveDir, LocaleProvider provider, http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java index 771ed63..d7f4e04 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java @@ -201,10 +201,8 @@ public class CookieInterceptor extends AbstractInterceptor { } /** - * Set the <code>cookiesName</code> which if matched will allow the cookie + * @param cookiesName the <code>cookiesName</code> which if matched will allow the cookie * to be injected into action, could be comma-separated string. - * - * @param cookiesName */ public void setCookiesName(String cookiesName) { if (cookiesName != null) { @@ -213,11 +211,9 @@ public class CookieInterceptor extends AbstractInterceptor { } /** - * Set the <code>cookiesValue</code> which if matched (together with matching + * @param cookiesValue the <code>cookiesValue</code> which if matched (together with matching * cookiesName) will caused the cookie to be injected into action, could be * comma-separated string. - * - * @param cookiesValue */ public void setCookiesValue(String cookiesValue) { if (cookiesValue != null) { @@ -332,10 +328,10 @@ public class CookieInterceptor extends AbstractInterceptor { * Hook that populate cookie value into value stack (hence the action) * if the criteria is satisfied (if the cookie value matches with those configured). * - * @param cookieName - * @param cookieValue - * @param cookiesMap - * @param stack + * @param cookieName cookie name + * @param cookieValue cookie value + * @param cookiesMap map of cookies + * @param stack value stack */ protected void populateCookieValueIntoStack(String cookieName, String cookieValue, Map<String, String> cookiesMap, ValueStack stack) { if (cookiesValueSet.isEmpty() || cookiesValueSet.contains("*")) { @@ -368,8 +364,8 @@ public class CookieInterceptor extends AbstractInterceptor { * Hook that set the <code>cookiesMap</code> into action that implements * {@link CookiesAware}. * - * @param action - * @param cookiesMap + * @param action action object + * @param cookiesMap map of cookies */ protected void injectIntoCookiesAwareAction(Object action, Map<String, String> cookiesMap) { if (action instanceof CookiesAware) { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java index 5add14a..824bd25 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java @@ -73,7 +73,7 @@ import java.util.Map; * server wait before the wait page is shown to the user. During the wait this interceptor will wake every 100 millis * to check if the background process is done premature, thus if the job for some reason doesn't take to long the wait * page is not shown to the user. - * <br/> This is useful for e.g. search actions that have a wide span of execution time. Using a delay time of 2000 + * <br> This is useful for e.g. search actions that have a wide span of execution time. Using a delay time of 2000 * millis we ensure the user is presented fast search results immediately and for the slow results a wait page is used. * </p> * @@ -131,7 +131,7 @@ import java.util.Map; * </head> * <body> * Please wait while we process your request. - * Click <a href="<s:url includeParams="all" />"></a> if this page does not reload automatically. + * Click <a href="<s:url includeParams="all" />"></a> if this page does not reload automatically. * </body> * </html> * </pre> @@ -218,6 +218,8 @@ public class ExecuteAndWaitInterceptor extends MethodFilterInterceptor { * Returns the name to associate the background process. Override to change the way background processes * are mapped to requests. * + * @param proxy action proxy + * * @return the name of the background thread */ protected String getBackgroundProcessName(ActionProxy proxy) { @@ -319,7 +321,7 @@ public class ExecuteAndWaitInterceptor extends MethodFilterInterceptor { * <p> * When this interceptor is executed for the first time this methods handles any provided initial delay. * An initial delay is a time in milliseconds we let the server wait before we continue. - * <br/> During the wait this interceptor will wake every 100 millis to check if the background + * <br> During the wait this interceptor will wake every 100 millis to check if the background * process is done premature, thus if the job for some reason doesn't take to long the wait * page is not shown to the user. * </p> http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java index 644203a..15bbabe 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java @@ -57,7 +57,7 @@ import java.util.*; * * <p>You can get access to these files by merely providing setters in your action that correspond to any of the three * patterns above, such as setDocument(File document), setDocumentContentType(String contentType), etc. - * <br/>See the example code section. + * <br>See the example code section. * </p> * * <p> This interceptor will add several field errors, assuming that the action implements {@link ValidationAware}. @@ -322,6 +322,7 @@ public class FileUploadInterceptor extends AbstractInterceptor { * * @param action - uploading action for message retrieval. * @param file - proposed upload file. + * @param filename - name of the file. * @param contentType - contentType of the file. * @param inputName - inputName of the file. * @param validation - Non-null ValidationAware if the action implements ValidationAware, allowing for better http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java index a3f83db..ee78563 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java @@ -126,10 +126,10 @@ import java.util.Map; * * <action name="submitApplication" ....> * <interceptor-ref name="store"> - * <param name="operationMode">STORE</param> + * <param name="operationMode">aSTORE</param> * </interceptor-ref> * <interceptor-ref name="defaultStack" /> - * <result name="input" type="redirect">applicationFailed.action</result> + * <result name="input" type="redirect">aapplicationFailed.action</result> * <result type="dispatcher">applicationSuccess.jsp</result> * </action> * @@ -208,8 +208,8 @@ public class MessageStoreInterceptor extends AbstractInterceptor { * Handle the retrieving of field errors / action messages / field errors, which is * done before action invocation, and the <code>operationMode</code> is 'RETRIEVE'. * - * @param invocation - * @throws Exception + * @param invocation the action invocation + * @throws Exception in case of any error */ protected void before(ActionInvocation invocation) throws Exception { String reqOperationMode = getRequestOperationMode(invocation); @@ -261,9 +261,9 @@ public class MessageStoreInterceptor extends AbstractInterceptor { * Handle the storing of field errors / action messages / field errors, which is * done after action invocation, and the <code>operationMode</code> is in 'STORE'. * - * @param invocation - * @param result - * @throws Exception + * @param invocation the action invocation + * @param result the result + * @throws Exception in case of any error */ protected void after(ActionInvocation invocation, String result) throws Exception { @@ -297,11 +297,12 @@ public class MessageStoreInterceptor extends AbstractInterceptor { /** - * Get the operationMode through request paramter, if <code>allowRequestParameterSwitch</code> + * Get the operationMode through request parameter, if <code>allowRequestParameterSwitch</code> * is 'true', else it simply returns 'NONE', meaning its neither in the 'STORE_MODE' nor * 'RETRIEVE_MODE'. * - * @return String + * @param invocation the action invocation + * @return the request operation mode */ protected String getRequestOperationMode(ActionInvocation invocation) { String reqOperationMode = NONE; @@ -322,9 +323,9 @@ public class MessageStoreInterceptor extends AbstractInterceptor { * Merge <code>col1</code> and <code>col2</code> and return the composite * <code>Collection</code>. * - * @param col1 - * @param col2 - * @return Collection + * @param col1 first collection + * @param col2 second collection + * @return the merged collection */ protected Collection mergeCollection(Collection col1, Collection col2) { Collection _col1 = (col1 == null ? new ArrayList() : col1); @@ -337,9 +338,9 @@ public class MessageStoreInterceptor extends AbstractInterceptor { * Merge <code>map1</code> and <code>map2</code> and return the composite * <code>Map</code> * - * @param map1 - * @param map2 - * @return Map + * @param map1 first map + * @param map2 second map + * @return the merged map */ protected Map mergeMap(Map map1, Map map2) { Map _map1 = (map1 == null ? new LinkedHashMap() : map1); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/interceptor/RolesInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/RolesInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/RolesInterceptor.java index 6518b7c..9bb0c16 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/RolesInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/RolesInterceptor.java @@ -55,8 +55,8 @@ import java.util.List; * <p> * When both allowedRoles and disallowedRoles are configured, then disallowedRoles * takes precedence, applying the following logic: - * (if ((inRole(role1) || inRole(role2) || ... inRole(roleN)) && - * !inRole(roleA) && !inRole(roleB) && ... !inRole(roleZ)) + * (if ((inRole(role1) || inRole(role2) || ... inRole(roleN)) && + * !inRole(roleA) && !inRole(roleB) && ... !inRole(roleZ)) * { //permit ... * </p> * <!-- END SNIPPET: parameters --> @@ -71,7 +71,7 @@ import java.util.List; * the passed action execution with this request</li> * <li>handleRejection(ActionInvocation) - handles an unauthorized * request.</li> - * <li>areRolesValid(List<String> roles) - allows subclasses to lookup roles + * <li>areRolesValid(List<String> roles) - allows subclasses to lookup roles * to ensure they are valid. If not valid, RolesInterceptor will log the error and * cease to function. This helps prevent security misconfiguration flaws. * @@ -135,6 +135,8 @@ public class RolesInterceptor extends AbstractInterceptor { /** * Splits a string into a List + * @param val the string to split + * @return the string list */ protected List<String> stringToList(String val) { if (val != null) { @@ -179,8 +181,9 @@ public class RolesInterceptor extends AbstractInterceptor { * Handles a rejection by sending a 403 HTTP error * * @param invocation The invocation + * @param response the servlet response object * @return The result code - * @throws Exception + * @throws Exception in case of any error */ protected String handleRejection(ActionInvocation invocation, HttpServletResponse response) throws Exception { response.sendError(HttpServletResponse.SC_FORBIDDEN); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java index 4ce9c15..fff296b 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/ScopeInterceptor.java @@ -77,7 +77,7 @@ import java.util.Map; * * <li>application - a list of action properties to be bound to application scope</li> * - * <li>key - a session/application attribute key prefix, can contain following values:</li> + * <li>key - a session/application attribute key prefix, can contain following values: * * <ul> * @@ -88,8 +88,8 @@ import java.util.Map; * <li>any other value is taken literally as key prefix</li> * * </ul> - * - * <li>type - with one of the following</li> + * </li> + * <li>type - with one of the following * * <ul> * @@ -101,6 +101,7 @@ import java.util.Map; * <li>any other value throws IllegalArgumentException</li> * * </ul> + * </li> * * <li>sessionReset - name of a parameter (defaults to 'session.reset') which if set, causes all session values to be reset to action's default values or application * scope values, note that it is similar to type="start" and in fact it does the same, but in our team it is sometimes http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/interceptor/TokenInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/TokenInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/TokenInterceptor.java index 7854213..86a3efd 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/TokenInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/TokenInterceptor.java @@ -184,6 +184,7 @@ public class TokenInterceptor extends MethodFilterInterceptor { * interesting. * * @param invocation the action invocation + * @return invocation result * @throws Exception when any unexpected error occurs. */ protected String handleValidToken(ActionInvocation invocation) throws Exception { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java index 6eed280..296d410 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java @@ -68,9 +68,9 @@ import java.util.*; * <li> <code>command</code> - Tests an OGNL expression and returns the * string result. Only used by the OGNL console.</li> * <li><code>browser</code> Shows field values of an object specified in the - * <code>object<code> parameter (#context by default). When the <code>object<code> + * <code>object</code> parameter (#context by default). When the <code>object</code> * parameters is set, the '#' character needs to be escaped to '%23'. Like - * debug=browser&object=%23parameters</li> + * debug=browser&object=%23parameters</li> * </ul> * <!-- END SNIPPET: parameters --> * <p> http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/result/PostbackResult.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/result/PostbackResult.java b/core/src/main/java/org/apache/struts2/result/PostbackResult.java index 95b3927..dbb0c0e 100644 --- a/core/src/main/java/org/apache/struts2/result/PostbackResult.java +++ b/core/src/main/java/org/apache/struts2/result/PostbackResult.java @@ -174,8 +174,7 @@ public class PostbackResult extends StrutsResultSupport { /** * Stores the option to cache the rendered intermediate page. The default * is {@code true}. - * - * @return {@code true} to cache; otherwise {@code false} + * @param cache enable/disable cache */ public final void setCache(boolean cache) { this.cache = cache; http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/result/ServletActionRedirectResult.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/result/ServletActionRedirectResult.java b/core/src/main/java/org/apache/struts2/result/ServletActionRedirectResult.java index 2d12606..798e809 100644 --- a/core/src/main/java/org/apache/struts2/result/ServletActionRedirectResult.java +++ b/core/src/main/java/org/apache/struts2/result/ServletActionRedirectResult.java @@ -31,9 +31,9 @@ import java.util.List; /** * <!-- START SNIPPET: description --> - * + * <p> * This result uses the {@link ActionMapper} provided by the - * {@link ActionMapperFactory} to redirect the browser to a URL that invokes the + * ActionMapperFactory to redirect the browser to a URL that invokes the * specified action and (optional) namespace. This is better than the * {@link ServletRedirectResult} because it does not require you to encode the * URL patterns processed by the {@link ActionMapper} in to your struts.xml @@ -41,39 +41,37 @@ import java.util.List; * and your application will still work. It is strongly recommended that if you * are redirecting to another action, you use this result rather than the * standard redirect result. + * </p> * + * <p> * See examples below for an example of how request parameters could be passed * in. - * + * </p> * <!-- END SNIPPET: description --> - * + * <p> * <b>This result type takes the following parameters:</b> - * + * </p> * <!-- START SNIPPET: params --> * * <ul> - * * <li><b>actionName (default)</b> - The name of the action that will be * redirected to.</li> - * * <li><b>namespace</b> - Used to determine which namespace the action is in * that we're redirecting to. If namespace is null, the default will be the * current namespace.</li> - * * <li><b>suppressEmptyParameters</b> - Optional boolean (defaults to false) that * can prevent parameters with no values from being included in the redirect * URL.</li> - * * <li><b>parse</b> - Boolean, true by default. If set to false, the actionName * param will not be parsed for Ognl expressions.</li> - * * <li><b>anchor</b> - Optional. Also known as "fragment" or colloquially as * "hash". You can specify an anchor for a result.</li> * </ul> * * <!-- END SNIPPET: params --> - * + * <p> * <b>Example:</b> + * </p> * * <pre> * <!-- START SNIPPET: example --> @@ -103,7 +101,7 @@ import java.util.List; * <!-- Pass parameters (reportType, width and height) --> * <!-- * The redirectAction url generated will be : - * /genReport/generateReport.action?reportType=pie&width=100&height=100#summary + * /genReport/generateReport.action?reportType=pie&width=100&height=100#summary * --> * <action name="gatherReportInfo" class="..."> * <result name="showReportResult" type="redirectAction"> http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/result/ServletRedirectResult.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/result/ServletRedirectResult.java b/core/src/main/java/org/apache/struts2/result/ServletRedirectResult.java index 7f2e148..e804416 100644 --- a/core/src/main/java/org/apache/struts2/result/ServletRedirectResult.java +++ b/core/src/main/java/org/apache/struts2/result/ServletRedirectResult.java @@ -143,7 +143,7 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec /** * Set the optional anchor value. * - * @param anchor + * @param anchor the anchor value */ public void setAnchor(String anchor) { this.anchor = anchor; @@ -250,7 +250,7 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec * * @param response The response * @param finalLocation The location URI - * @throws IOException + * @throws IOException in case of IO errors */ protected void sendRedirect(HttpServletResponse response, String finalLocation) throws IOException { if (SC_FOUND == statusCode) { @@ -308,6 +308,8 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec * * @param key The parameter name * @param value The parameter value + * + * @return the servlet redirect result */ public ServletRedirectResult addParameter(String key, Object value) { requestParameters.put(key, String.valueOf(value)); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/result/StreamResult.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/result/StreamResult.java b/core/src/main/java/org/apache/struts2/result/StreamResult.java index 7829e3c..0bc328d 100644 --- a/core/src/main/java/org/apache/struts2/result/StreamResult.java +++ b/core/src/main/java/org/apache/struts2/result/StreamResult.java @@ -293,6 +293,7 @@ public class StreamResult extends StrutsResultSupport { * Tries to lookup the parameters on the stack. Will override any existing parameters * * @param stack The current value stack + * @param invocation the action invocation */ protected void resolveParamsFromStack(ValueStack stack, ActionInvocation invocation) { String disposition = stack.findString("contentDisposition"); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/result/StrutsResultSupport.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/result/StrutsResultSupport.java b/core/src/main/java/org/apache/struts2/result/StrutsResultSupport.java index 06a1f12..bba5c84 100644 --- a/core/src/main/java/org/apache/struts2/result/StrutsResultSupport.java +++ b/core/src/main/java/org/apache/struts2/result/StrutsResultSupport.java @@ -159,6 +159,8 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics { /** * Gets the location it was created with, mainly for testing + * + * @return the location */ public String getLocation() { return location; @@ -166,6 +168,8 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics { /** * Returns the last parsed and encoded location value + * + * @return the last final location */ public String getLastFinalLocation() { return lastFinalLocation; @@ -209,7 +213,7 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics { * * @param param The parameter value * @param invocation The action invocation instance - * @return The resulting string + * @return the resulting string */ protected String conditionalParse(String param, ActionInvocation invocation) { if (parse && param != null && invocation != null) { @@ -227,10 +231,10 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics { * convert found object into String. If found object is a collection it is * returned if found object is not a collection it is wrapped in one. * - * @param param - * @param invocation - * @param excludeEmptyElements - * @return + * @param param parameter + * @param invocation action invocation + * @param excludeEmptyElements 'true' for excluding empty elements + * @return the parsed collection of strings */ protected Collection<String> conditionalParseCollection(String param, ActionInvocation invocation, boolean excludeEmptyElements) { if (parse && param != null && invocation != null) { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/result/VelocityResult.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/result/VelocityResult.java b/core/src/main/java/org/apache/struts2/result/VelocityResult.java index 2720209..ebd6900 100644 --- a/core/src/main/java/org/apache/struts2/result/VelocityResult.java +++ b/core/src/main/java/org/apache/struts2/result/VelocityResult.java @@ -176,6 +176,7 @@ public class VelocityResult extends StrutsResultSupport { * People can override this method if they want to provide specific content types for specific templates (eg text/xml). * </p> * + * @param templateLocation location of template * @return The content type associated with this template (default "text/html") */ protected String getContentType(String templateLocation) { @@ -188,6 +189,7 @@ public class VelocityResult extends StrutsResultSupport { * People can override this method if they want to provide specific encodings for specific templates. * </p> * + * @param templateLocation location of template * @return The encoding associated with this template (defaults to the value of 'struts.i18n.encoding' property) */ protected String getEncoding(String templateLocation) { @@ -228,6 +230,8 @@ public class VelocityResult extends StrutsResultSupport { * * @param velocityManager a reference to the velocityManager to use * @param stack the value stack to resolve the location against (when parse equals true) + * @param request the servlet request + * @param response the servlet response * @param location the name of the template that is being used * @return the a minted Velocity context. */ http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/util/ContainUtil.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/util/ContainUtil.java b/core/src/main/java/org/apache/struts2/util/ContainUtil.java index 4cefb25..f3cd324 100644 --- a/core/src/main/java/org/apache/struts2/util/ContainUtil.java +++ b/core/src/main/java/org/apache/struts2/util/ContainUtil.java @@ -28,15 +28,13 @@ import java.util.Map; /** * <code>ContainUtil</code> will check if object 1 contains object 2. * Object 1 may be an Object, array, Collection, or a Map - * - * @version $Date$ $Id$ */ public class ContainUtil { /** * Determine if <code>obj2</code> exists in <code>obj1</code>. * - * <table borer="1"> + * <table border="1" summary=""> * <tr> * <td>Type Of obj1</td> * <td>Comparison type</td> @@ -64,19 +62,17 @@ public class ContainUtil { * </table> * * - * @param obj1 - * @param obj2 - * @return + * @param obj1 first object + * @param obj2 second object + * @return true if first object contains second object or if the are equals, otherwise false */ public static boolean contains(Object obj1, Object obj2) { if ((obj1 == null) || (obj2 == null)) { - //log.debug("obj1 or obj2 are null."); return false; } if (obj1 instanceof Map) { if (((Map) obj1).containsKey(obj2)) { - //log.debug("obj1 is a map and contains obj2"); return true; } } if (obj1 instanceof Iterable) { @@ -90,19 +86,15 @@ public class ContainUtil { Object value = Array.get(obj1, i); if (obj2.equals(value)) { - //log.debug("obj1 is an array and contains obj2"); return true; } } } else if (obj1.toString().equals(obj2.toString())) { - //log.debug("obj1 is an object and it's String representation equals obj2's String representation."); return true; } else if (obj1.equals(obj2)) { - //log.debug("obj1 is an object and equals obj2"); return true; } - //log.debug("obj1 does not contain obj2: " + obj1 + ", " + obj2); return false; } } http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java b/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java index 37d1a81..670fa4a 100644 --- a/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java +++ b/core/src/main/java/org/apache/struts2/util/InvocationSessionStore.java @@ -50,6 +50,7 @@ public class InvocationSessionStore { * ActionContext and the ActionInvocation is returned. * * @param key the name the DefaultActionInvocation and ActionContext were saved as + * @param token token for check * @return the DefaultActionInvocation saved using the key, or null if none was found */ public static ActionInvocation loadInvocation(String key, String token) { @@ -69,8 +70,9 @@ public class InvocationSessionStore { * Stores the DefaultActionInvocation and ActionContext into the Session using the provided key for loading later using * {@link #loadInvocation} * - * @param key - * @param invocation + * @param key the name the DefaultActionInvocation and ActionContext were saved as + * @param token token for check + * @param invocation the action invocation */ public static void storeInvocation(String key, String token, ActionInvocation invocation) { InvocationContext invocationContext = new InvocationContext(invocation.serialize(), token); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/util/RegexPatternMatcher.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/util/RegexPatternMatcher.java b/core/src/main/java/org/apache/struts2/util/RegexPatternMatcher.java index f550b68..59153cb 100644 --- a/core/src/main/java/org/apache/struts2/util/RegexPatternMatcher.java +++ b/core/src/main/java/org/apache/struts2/util/RegexPatternMatcher.java @@ -29,16 +29,21 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** + * <p> * Allows regular expressions to be used in action names. The regular expressions * can be in the form {FIELD_NAME} or {FIELD_NAME:REGULAR_EXPRESSION}. For example: - * <br/> + * </p> + * * <pre> * <action name="/{bio:.+}/test/{name}" class="org.apache.struts2.showcase.UITagExample"> - * <result>/tags/ui/example.jsp</result> + * <result>/tags/ui/example.jsp</result> * </action> * </pre> * + * <p> * For this to work it is important to set the following: + * </p> + * * <pre> * <constant name="struts.enable.SlashesInActionNames" value="true"/> * <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/> http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java b/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java index 0d2e7c6..f778e4c 100644 --- a/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java +++ b/core/src/main/java/org/apache/struts2/util/StrutsTestCaseHelper.java @@ -43,6 +43,8 @@ public class StrutsTestCaseHelper { /** * Sets up the configuration settings, XWork configuration, and * message resources + * + * @throws Exception in case of any error */ public static void setUp() throws Exception { LocalizedTextUtil.clearDefaultResourceBundles(); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/util/StrutsTypeConverter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/util/StrutsTypeConverter.java b/core/src/main/java/org/apache/struts2/util/StrutsTypeConverter.java index d37c79f..8f31f08 100644 --- a/core/src/main/java/org/apache/struts2/util/StrutsTypeConverter.java +++ b/core/src/main/java/org/apache/struts2/util/StrutsTypeConverter.java @@ -65,9 +65,9 @@ public abstract class StrutsTypeConverter extends DefaultTypeConverter { * this will ask Ognl's DefaultTypeConverter (of which this class extends) to * perform the conversion. * - * @param context - * @param o - * @param toClass + * @param context the action context + * @param o object to be converted + * @param toClass the class to convert to * @return The fallback conversion */ protected Object performFallbackConversion(Map context, Object o, Class toClass) { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java b/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java index 5b876cc..fb55520 100644 --- a/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java +++ b/core/src/main/java/org/apache/struts2/util/fs/JBossFileManager.java @@ -109,8 +109,9 @@ public class JBossFileManager extends DefaultFileManager { /** * Check if given URL is pointing to JBoss 5 VFS resource - * @param fileUrl - * @return + * + * @param fileUrl file URL to check + * @return if given URL is pointing to JBoss 5 VFS resource */ protected boolean isJBossUrl(URL fileUrl) { final String protocol = fileUrl.getProtocol(); http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java index c4fde80..ddc7669 100644 --- a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java +++ b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerManager.java @@ -70,17 +70,17 @@ import java.util.*; * </ul> * * <p> - * <b> createConfiguration method </b><br/> + * <b> createConfiguration method </b><br> * Create a freemarker Configuration. * </p> * * <p> - * <b> loadSettings method </b><br/> + * <b> loadSettings method </b><br> * Load freemarker settings, default to freemarker.properties (if found in classpath) * </p> * * <p> - * <b> createTemplateLoader method</b><br/> + * <b> createTemplateLoader method</b><br> * create a freemarker TemplateLoader that loads freemarker template in the following order: * </p> * @@ -91,13 +91,13 @@ import java.util.*; * </ol> * * <p> - * <b> populateContext method</b><br/> + * <b> populateContext method</b><br> * populate the created model. * </p> */ public class FreemarkerManager { - // coppied from freemarker servlet - so that there is no dependency on it + // copied from freemarker servlet - so that there is no dependency on it public static final String INITPARAM_TEMPLATE_PATH = "TemplatePath"; public static final String INITPARAM_NOCACHE = "NoCache"; public static final String INITPARAM_CONTENT_TYPE = "ContentType"; @@ -285,7 +285,9 @@ public class FreemarkerManager { /** * Sets the Freemarker Configuration's template loader with the FreemarkerThemeTemplateLoader * at the top. - * + * + * @param templateLoader the template loader + * * @see org.apache.struts2.views.freemarker.FreemarkerThemeTemplateLoader */ protected void configureTemplateLoader(TemplateLoader templateLoader) { @@ -306,7 +308,9 @@ public class FreemarkerManager { * <li>loads settings from the classpath file /freemarker.properties * </ul> * - * @param servletContext + * @param servletContext the servlet context + * @return a instance of the freemarker configuration object + * @throws TemplateException in case of errors during creating the configuration */ protected Configuration createConfiguration(ServletContext servletContext) throws TemplateException { Configuration configuration = new Configuration(Configuration.VERSION_2_3_0); @@ -394,9 +398,10 @@ public class FreemarkerManager { * {@link ClassTemplateLoader} if the template path starts with "class://", * a {@link FileTemplateLoader} if the template path starts with "file://", * and a {@link WebappTemplateLoader} otherwise. + * + * @param servletContext the servlet path * @param templatePath the template path to create a loader for * @return a newly created template loader - * @throws IOException */ protected TemplateLoader createTemplateLoader(ServletContext servletContext, String templatePath) { TemplateLoader templatePathLoader = null; @@ -432,6 +437,8 @@ public class FreemarkerManager { /** * Load the settings from the /freemarker.properties file on the classpath * + * @param servletContext the servlet context + * * @see freemarker.template.Configuration#setSettings for the definition of valid settings */ protected void loadSettings(ServletContext servletContext) { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java index b052da0..52ad637 100644 --- a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java +++ b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java @@ -115,7 +115,7 @@ public class FreemarkerResult extends StrutsResultSupport { /* * Struts results are constructed for each result execution * - * the current context is availible to subclasses via these protected fields + * the current context is available to subclasses via these protected fields */ protected String location; private String pContentType = "text/html"; @@ -141,6 +141,8 @@ public class FreemarkerResult extends StrutsResultSupport { /** * allow parameterization of the contentType * the default being text/html + * + * @return the content type */ public String getContentType() { return pContentType; @@ -156,6 +158,12 @@ public class FreemarkerResult extends StrutsResultSupport { * It them implements the template processing workflow by calling the hooks for * preTemplateProcess and postTemplateProcess * </p> + * + * @param locationArg location argument + * @param invocation the action invocation + * + * @throws IOException in case of IO errors + * @throws TemplateException in case of freemarker template errors */ public void doExecute(String locationArg, ActionInvocation invocation) throws IOException, TemplateException { this.location = locationArg; @@ -244,6 +252,9 @@ public class FreemarkerResult extends StrutsResultSupport { * The default implementation obtains the configuration from the ConfigurationManager instance. * </b> * </p> + * + * @return the freemarker configuration object + * @throws TemplateException in case of freemarker configuration errors */ protected Configuration getConfiguration() throws TemplateException { return freemarkerManager.getConfiguration(ServletActionContext.getServletContext()); @@ -261,6 +272,8 @@ public class FreemarkerResult extends StrutsResultSupport { * The default implementation returns {@link Configuration#getObjectWrapper()} * </b> * </p> + * + * @return the object wrapper from configuration */ protected ObjectWrapper getObjectWrapper() { return configuration.getObjectWrapper(); @@ -273,6 +286,9 @@ public class FreemarkerResult extends StrutsResultSupport { /** * The default writer writes directly to the response writer. + * + * @return Writer the response writer + * @throws IOException in case of IO errors */ protected Writer getWriter() throws IOException { if(writer != null) { @@ -300,6 +316,9 @@ public class FreemarkerResult extends StrutsResultSupport { * <li>exception - optional : the JSP or Servlet exception as per the servlet spec (for JSP Exception pages) * <li>struts - instance of the StrutsUtil class * </ul> + * + * @return TemplateModel returns the created template model + * @throws TemplateModelException in case of errors during creating the model */ protected TemplateModel createModel() throws TemplateModelException { ServletContext servletContext = ServletActionContext.getServletContext(); @@ -316,6 +335,8 @@ public class FreemarkerResult extends StrutsResultSupport { * Returns the locale used for the {@link Configuration#getTemplate(String, Locale)} call. The base implementation * simply returns the locale setting of the action (assuming the action implements {@link LocaleProvider}) or, if * the action does not the configuration's locale is returned. Override this method to provide different behaviour, + * + * @return the locale from action if action implements the {@link LocaleProvider}) or local from configuration */ protected Locale deduceLocale() { if (invocation.getAction() instanceof LocaleProvider) { @@ -327,8 +348,13 @@ public class FreemarkerResult extends StrutsResultSupport { /** * the default implementation of postTemplateProcess applies the contentType parameter + * + * @param template the freemarker template + * @param model the template model + * + * @throws IOException in case of IO errors */ - protected void postTemplateProcess(Template template, TemplateModel data) throws IOException { + protected void postTemplateProcess(Template template, TemplateModel model) throws IOException { } /** @@ -338,7 +364,10 @@ public class FreemarkerResult extends StrutsResultSupport { * A typical action to perform here is to inject application-specific * objects into the model root * + * @param template the freemarker template + * @param model the template model * @return true to process the template, false to suppress template processing. + * @throws IOException in case of IO errors */ protected boolean preTemplateProcess(Template template, TemplateModel model) throws IOException { Object attrContentType = template.getCustomAttribute("content_type"); @@ -383,7 +412,7 @@ public class FreemarkerResult extends StrutsResultSupport { } /** - * Writes to the stream only when template processing completed successfully + * @param writeIfCompleted Writes to the stream only when template processing completed successfully */ public void setWriteIfCompleted(boolean writeIfCompleted) { this.writeIfCompleted = writeIfCompleted; http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerThemeTemplateLoader.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerThemeTemplateLoader.java b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerThemeTemplateLoader.java index 5c56463..f19118c 100644 --- a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerThemeTemplateLoader.java +++ b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerThemeTemplateLoader.java @@ -25,6 +25,8 @@ public class FreemarkerThemeTemplateLoader implements TemplateLoader{ /** * Initialize the loader for the given parent. + * + * @param parent the parent template loader */ public void init(TemplateLoader parent) { this.parentTemplateLoader = parent; http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java b/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java index 2d83a8d..7b85a82 100644 --- a/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java +++ b/core/src/main/java/org/apache/struts2/views/jsp/IteratorStatus.java @@ -38,7 +38,7 @@ package org.apache.struts2.views.jsp; * <s:iterator status="status" value='{0, 1}'> * Index: <s:property value="%{#status.index}" /> <br /> * Count: <s:property value="%{#status.count}" /> <br /> - * </s:iterator> + * </s:iterator> * </pre> * * <p>will print</p> http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java b/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java index e9d229a..0789417 100644 --- a/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java +++ b/core/src/main/java/org/apache/struts2/views/jsp/iterator/IteratorGeneratorTag.java @@ -84,7 +84,7 @@ import javax.servlet.jsp.JspException; * <% * Iterator i = (Iterator) pageContext.getAttribute("myAtt"); * while(i.hasNext()) { - * String s = (String) i.next(); %> + * String s = (String) i.next(); %> * <%=s%> <br/> * <% } * %> @@ -148,8 +148,10 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport { } /** - * @s.tagattribute required="true" type="String" + * {@literal @}s.tagattribute required="true" type="String" * description="the separator to be used in separating the <i>val</i> into entries of the iterator" + * + * @param separator the seperator */ @StrutsTagAttribute(required=true, description="The separator to be used in separating the <i>val</i> into entries of the iterator") public void setSeparator(String separator) { @@ -157,8 +159,10 @@ public class IteratorGeneratorTag extends StrutsBodyTagSupport { } /** - * @s.tagattribute required="true" + * {@literal @}s.tagattribute required="true" * description="the source to be parsed into an iterator" + * + * @param val the value */ @StrutsTagAttribute(required=true, description="The source to be parsed into an iterator") public void setVal(String val) { http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/views/jsp/iterator/SortIteratorTag.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/jsp/iterator/SortIteratorTag.java b/core/src/main/java/org/apache/struts2/views/jsp/iterator/SortIteratorTag.java index 4ae8054..7e6f853 100644 --- a/core/src/main/java/org/apache/struts2/views/jsp/iterator/SortIteratorTag.java +++ b/core/src/main/java/org/apache/struts2/views/jsp/iterator/SortIteratorTag.java @@ -84,7 +84,7 @@ import org.apache.struts2.views.jsp.StrutsBodyTagSupport; * * @see org.apache.struts2.util.SortIteratorFilter * - * @s.tag name="sort" tld-body-content="JSP" + * {@literal @}s.tag name="sort" tld-body-content="JSP" * description="Sort a List using a Comparator both passed in as the tag attribute." */ @StrutsTag(name="sort", tldTagClass="org.apache.struts2.views.jsp.iterator.SortIteratorTag", http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/views/jsp/iterator/SubsetIteratorTag.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/jsp/iterator/SubsetIteratorTag.java b/core/src/main/java/org/apache/struts2/views/jsp/iterator/SubsetIteratorTag.java index aa702da..daa062f 100644 --- a/core/src/main/java/org/apache/struts2/views/jsp/iterator/SubsetIteratorTag.java +++ b/core/src/main/java/org/apache/struts2/views/jsp/iterator/SubsetIteratorTag.java @@ -111,7 +111,7 @@ import javax.servlet.jsp.JspException; * * <pre> * <!-- START SNIPPET: example3 --> - * <!-- C: List with start --> + * <!-- C: List with start --> * <s:subset source="myList" count="13" start="3"> * <s:iterator> * <s:property /> @@ -145,7 +145,7 @@ import javax.servlet.jsp.JspException; * </pre> * * - * @s.tag name="subset" tld-body-content="JSP" + * {@literal @}s.tag name="subset" tld-body-content="JSP" * description="Takes an iterator and outputs a subset of it" */ @StrutsTag(name="subset", tldTagClass="org.apache.struts2.views.jsp.iterator.SubsetIteratorTag", @@ -175,8 +175,10 @@ public class SubsetIteratorTag extends StrutsBodyTagSupport { } /** - * @s.tagattribute required="false" type="Integer" + * {@literal @}s.tagattribute required="false" type="Integer" * description="Indicate the starting index (eg. first entry is 0) of entries in the source to be available as the first entry in the resulting subset iterator" + * + * @param start start */ @StrutsTagAttribute(type="Integer", description="Indicate the starting index (eg. first entry is 0) of entries in the source to be available as the first entry in the resulting subset iterator") http://git-wip-us.apache.org/repos/asf/struts/blob/775c82a7/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java b/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java index 9828eaf..31a3658 100644 --- a/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java +++ b/core/src/main/java/org/apache/struts2/views/velocity/VelocityManager.java @@ -55,7 +55,6 @@ import java.util.*; /** * Manages the environment for Velocity result types - * */ public class VelocityManager { private static final Logger LOG = LogManager.getLogger(VelocityManager.class); @@ -132,6 +131,9 @@ public class VelocityManager { * <li><strong>action</strong> - the current Struts action</li> * </ul> * + * @param stack the current {@link ValueStack} + * @param req the current HttpServletRequest + * @param res the current HttpServletResponse * @return a new StrutsVelocityContext */ public Context createContext(ValueStack stack, HttpServletRequest req, HttpServletResponse res) { @@ -171,9 +173,9 @@ public class VelocityManager { * perform any initialization of the contexts. All that must be done in the * context itself. * - * @param servletRequest - * @param servletResponse - * @param extraContext + * @param servletRequest the servlet request object + * @param servletResponse the servlet response object + * @param extraContext map with extra context * @return an VelocityContext[] of contexts to chain */ protected VelocityContext[] prepareChainedContexts(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Map extraContext) { @@ -361,6 +363,8 @@ public class VelocityManager { * the StrutsVelocityContext. The intent is to allow these contexts to store helper objects that the ui * developer may want access to. Examples of reasonable VelocityContexts would be an IoCVelocityContext, a * SpringReferenceVelocityContext, and a ToolboxVelocityContext + * + * @param contexts comma separated velocity context's */ @Inject(StrutsConstants.STRUTS_VELOCITY_CONTEXTS) public void setChainedContexts(String contexts) { @@ -382,6 +386,8 @@ public class VelocityManager { /** * Initializes the ServletToolboxManager for this servlet's * toolbox (if any). + * + * @param context the servlet context */ protected void initToolbox(ServletContext context) { /* if we have a toolbox, get a manager for it */ @@ -420,7 +426,9 @@ public class VelocityManager { * <li>on the classpath</li> * </ul> * - * @param context the current ServletContext. may <b>not</b> be null + * @param context the current ServletContext. may <b>not</b> be null + * + * @return the new velocity engine */ protected VelocityEngine newVelocityEngine(ServletContext context) { if (context == null) { @@ -455,18 +463,18 @@ public class VelocityManager { * <li>we need to define the various Struts custom user directives such as #param, #tag, and #bodytag</li> * </ul> * - * @param context - * @param p + * @param context the servlet context + * @param properties velocity properties */ - private void applyDefaultConfiguration(ServletContext context, Properties p) { + private void applyDefaultConfiguration(ServletContext context, Properties properties) { // ensure that caching isn't overly aggressive /** * Load a default resource loader definition if there isn't one present. * Ben Hall (22/08/2003) */ - if (p.getProperty(Velocity.RESOURCE_LOADER) == null) { - p.setProperty(Velocity.RESOURCE_LOADER, "strutsfile, strutsclass"); + if (properties.getProperty(Velocity.RESOURCE_LOADER) == null) { + properties.setProperty(Velocity.RESOURCE_LOADER, "strutsfile, strutsclass"); } /** @@ -476,14 +484,14 @@ public class VelocityManager { * Ben Hall (22/08/2003) */ if (context.getRealPath("") != null) { - p.setProperty("strutsfile.resource.loader.description", "Velocity File Resource Loader"); - p.setProperty("strutsfile.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); - p.setProperty("strutsfile.resource.loader.path", context.getRealPath("")); - p.setProperty("strutsfile.resource.loader.modificationCheckInterval", "2"); - p.setProperty("strutsfile.resource.loader.cache", "true"); + properties.setProperty("strutsfile.resource.loader.description", "Velocity File Resource Loader"); + properties.setProperty("strutsfile.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); + properties.setProperty("strutsfile.resource.loader.path", context.getRealPath("")); + properties.setProperty("strutsfile.resource.loader.modificationCheckInterval", "2"); + properties.setProperty("strutsfile.resource.loader.cache", "true"); } else { // remove strutsfile from resource loader property - String prop = p.getProperty(Velocity.RESOURCE_LOADER); + String prop = properties.getProperty(Velocity.RESOURCE_LOADER); if (prop.indexOf("strutsfile,") != -1) { prop = replace(prop, "strutsfile,", ""); } else if (prop.indexOf(", strutsfile") != -1) { @@ -492,7 +500,7 @@ public class VelocityManager { prop = replace(prop, "strutsfile", ""); } - p.setProperty(Velocity.RESOURCE_LOADER, prop); + properties.setProperty(Velocity.RESOURCE_LOADER, prop); } /** @@ -501,10 +509,10 @@ public class VelocityManager { * Unfortunately, there does not appear to be a macro for the class loader keywords * Matt Ho - Mon Mar 17 00:21:46 PST 2003 */ - p.setProperty("strutsclass.resource.loader.description", "Velocity Classpath Resource Loader"); - p.setProperty("strutsclass.resource.loader.class", "org.apache.struts2.views.velocity.StrutsResourceLoader"); - p.setProperty("strutsclass.resource.loader.modificationCheckInterval", "2"); - p.setProperty("strutsclass.resource.loader.cache", "true"); + properties.setProperty("strutsclass.resource.loader.description", "Velocity Classpath Resource Loader"); + properties.setProperty("strutsclass.resource.loader.class", "org.apache.struts2.views.velocity.StrutsResourceLoader"); + properties.setProperty("strutsclass.resource.loader.modificationCheckInterval", "2"); + properties.setProperty("strutsclass.resource.loader.cache", "true"); // components StringBuilder sb = new StringBuilder(); @@ -518,14 +526,14 @@ public class VelocityManager { String directives = sb.toString(); - String userdirective = p.getProperty("userdirective"); + String userdirective = properties.getProperty("userdirective"); if ((userdirective == null) || userdirective.trim().equals("")) { userdirective = directives; } else { userdirective = userdirective.trim() + "," + directives; } - p.setProperty("userdirective", userdirective); + properties.setProperty("userdirective", userdirective); } private void addDirective(StringBuilder sb, Class clazz) {