diff --git a/src/main/java/com/sangupta/jerry/web/filters/ExceptionCatchingFilter.java b/src/main/java/com/sangupta/jerry/web/filters/ExceptionCatchingFilter.java index 5410ce4..58dd64e 100644 --- a/src/main/java/com/sangupta/jerry/web/filters/ExceptionCatchingFilter.java +++ b/src/main/java/com/sangupta/jerry/web/filters/ExceptionCatchingFilter.java @@ -43,10 +43,13 @@ * {@link RuntimeException}. * * @author sangupta - * + * @since 1.0.0 */ public class ExceptionCatchingFilter implements Filter { + /** + * My internal logger + */ private static final Logger LOGGER = LoggerFactory.getLogger(ExceptionCatchingFilter.class); /** @@ -76,7 +79,23 @@ public void init(FilterConfig filterConfig) throws ServletException { } /** - * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) + * @param request + * the incoming {@link ServletRequest} instance + * + * @param response + * the outgoing {@link ServletResponse} instance + * + * @param chain + * the {@link FilterChain} being executed + * + * @throws IOException + * if something fails + * + * @throws ServletException + * if something fails + * + * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, + * javax.servlet.ServletResponse, javax.servlet.FilterChain) */ @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { diff --git a/src/main/java/com/sangupta/jerry/web/filters/JavascriptMinificationFilter.java b/src/main/java/com/sangupta/jerry/web/filters/JavascriptMinificationFilter.java index 7b30313..555a023 100644 --- a/src/main/java/com/sangupta/jerry/web/filters/JavascriptMinificationFilter.java +++ b/src/main/java/com/sangupta/jerry/web/filters/JavascriptMinificationFilter.java @@ -57,12 +57,18 @@ * using Google closure compiler. * * @author sangupta - * + * @since 1.0.0 */ public class JavascriptMinificationFilter implements Filter { + /** + * My internal logger + */ private static final Logger LOGGER = LoggerFactory.getLogger(JavascriptMinificationFilter.class); + /** + * Cache that holds minified files so that they can be served faster + */ private final Map CACHE = new HashMap(); @Override @@ -78,6 +84,23 @@ public void destroy() { /** * Compress JS and CSS files using the Google compiler. * + * @param servletRequest + * the incoming {@link ServletRequest} instance + * + * @param servletResponse + * the outgoing {@link ServletResponse} instance + * + * @param filterChain + * the {@link FilterChain} being executed + * + * @throws IOException + * if something fails + * + * @throws ServletException + * if something fails + * + * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, + * javax.servlet.ServletResponse, javax.servlet.FilterChain) */ @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { @@ -197,12 +220,16 @@ private boolean isJavascript(String type) { } /** - * Compress the Javascript. - * - * @param uri - * @param code - * @return - */ + * Compress the Javascript. + * + * @param uri + * the URI for the JS file + * + * @param code + * the actual Javascript code + * + * @return the compressed code for the JS file + */ private String compressJavascriptEmbedded(final String uri, final String code) { if(code == null || code.isEmpty()) { return code; @@ -230,11 +257,13 @@ private String compressJavascriptEmbedded(final String uri, final String code) { } /** - * UnGZIP a given byte stream. - * - * @param bytes - * @return - */ + * UnGZIP a given byte stream. + * + * @param bytes + * the byte-stream to unGZIP + * + * @return the unGZIPed byte-array + */ private byte[] unGZip(byte[] bytes) { if(bytes == null || bytes.length == 0) { return bytes; @@ -280,11 +309,14 @@ private byte[] unGZip(byte[] bytes) { } /** - * Check if a byte stream is GZIP compressed or not. - * - * @param bytes - * @return - */ + * Check if a byte stream is GZIP compressed or not. + * + * @param bytes + * the byte-array representing the stream + * + * @return true if its compressed with GZIP, false + * otherwise + */ private boolean isGZip(byte[] bytes) { if(bytes == null || bytes.length == 0) { return false; diff --git a/src/main/java/com/sangupta/jerry/web/filters/JavascriptReorderingFilter.java b/src/main/java/com/sangupta/jerry/web/filters/JavascriptReorderingFilter.java index 008d4d6..51aaf18 100644 --- a/src/main/java/com/sangupta/jerry/web/filters/JavascriptReorderingFilter.java +++ b/src/main/java/com/sangupta/jerry/web/filters/JavascriptReorderingFilter.java @@ -51,7 +51,7 @@ * parser to achieve the same. * * @author sangupta - * + * @since 1.0.0 */ public class JavascriptReorderingFilter implements Filter { @@ -67,6 +67,29 @@ public void destroy() { // do nothing } + /** + * Move all included JavaScript files to the end of BODY tag in the same order + * that they appeared in the original HTML response. + * + * @param servletRequest + * the incoming {@link ServletRequest} instance + * + * @param servletResponse + * the outgoing {@link ServletResponse} instance + * + * @param filterChain + * the {@link FilterChain} being executed + * + * @throws IOException + * if something fails + * + * @throws ServletException + * if something fails + * + * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, + * javax.servlet.ServletResponse, javax.servlet.FilterChain) + * + */ @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { // try and see if this request is for an HTML page diff --git a/src/main/java/com/sangupta/jerry/web/filters/LeverageBrowserCacheFilter.java b/src/main/java/com/sangupta/jerry/web/filters/LeverageBrowserCacheFilter.java index 46aac55..dc6d22e 100644 --- a/src/main/java/com/sangupta/jerry/web/filters/LeverageBrowserCacheFilter.java +++ b/src/main/java/com/sangupta/jerry/web/filters/LeverageBrowserCacheFilter.java @@ -22,6 +22,8 @@ package com.sangupta.jerry.web.filters; import java.io.IOException; +import java.util.HashSet; +import java.util.Set; import javax.servlet.Filter; import javax.servlet.FilterChain; @@ -35,6 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.sangupta.jerry.util.AssertUtils; import com.sangupta.jerry.util.DateUtils; /** @@ -43,14 +46,50 @@ * number of calls. * * @author sangupta + * @since 1.0.0 */ public class LeverageBrowserCacheFilter implements Filter { - private static final String[] STATIC_RESOURCE_EXTENSIONS = { ".css", ".png" , ".js", ".gif", ".jpg" }; + private static final Set STATIC_RESOURCE_EXTENSIONS = new HashSet<>(); + + static { + STATIC_RESOURCE_EXTENSIONS.add(".css"); + STATIC_RESOURCE_EXTENSIONS.add(".png"); + STATIC_RESOURCE_EXTENSIONS.add(".js"); + STATIC_RESOURCE_EXTENSIONS.add(".git"); + STATIC_RESOURCE_EXTENSIONS.add(".jpg"); + STATIC_RESOURCE_EXTENSIONS.add(".jpeg"); + STATIC_RESOURCE_EXTENSIONS.add(".woff"); + STATIC_RESOURCE_EXTENSIONS.add(".bmp"); + STATIC_RESOURCE_EXTENSIONS.add(".tiff"); + } private static final Logger LOGGER = LoggerFactory.getLogger(LeverageBrowserCacheFilter.class); private static String ONE_YEAR_AS_SECONDS = String.valueOf(((long) DateUtils.ONE_YEAR / 1000l)); + + /** + * Add the given extension to the list of static resources. + * + * @param extension + * the extension to add + * + * @return true if extension was added, false + * otherwise + */ + public static boolean addStaticExtension(String extension) { + if(AssertUtils.isEmpty(extension)) { + return false; + } + + if(!extension.startsWith(".")) { + extension = "." + extension; + } + + extension = extension.toLowerCase(); + + return STATIC_RESOURCE_EXTENSIONS.add(extension); + } @Override public void init(FilterConfig filterConfig) throws ServletException { @@ -63,13 +102,27 @@ public void destroy() { } /** - * - * @param servletRequest - * @param servletResponse - * @param filterChain - * @throws IOException - * @throws ServletException - */ + * Execute the filter by appending the Expires and + * Cache-Control response headers. + * + * @param servletRequest + * the incoming {@link ServletRequest} instance + * + * @param servletResponse + * the outgoing {@link ServletResponse} instance + * + * @param filterChain + * the {@link FilterChain} being executed + * + * @throws IOException + * if something fails + * + * @throws ServletException + * if something fails + * + * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, + * javax.servlet.ServletResponse, javax.servlet.FilterChain) + */ @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; @@ -109,13 +162,7 @@ private boolean isStaticResource(String uri) { } String currentExtension = uri.substring(index); - for(String extension : STATIC_RESOURCE_EXTENSIONS) { - if(extension.equals(currentExtension)) { - return true; - } - } - - // nothing found - return false; + + return STATIC_RESOURCE_EXTENSIONS.contains(currentExtension); } } diff --git a/src/main/java/com/sangupta/jerry/web/filters/RequestCapturingFilter.java b/src/main/java/com/sangupta/jerry/web/filters/RequestCapturingFilter.java index a4ab62e..d0124cf 100644 --- a/src/main/java/com/sangupta/jerry/web/filters/RequestCapturingFilter.java +++ b/src/main/java/com/sangupta/jerry/web/filters/RequestCapturingFilter.java @@ -41,7 +41,7 @@ * information is logged at INFO level. * * @author sangupta - * + * @since 1.0.0 */ public class RequestCapturingFilter implements Filter { @@ -52,6 +52,27 @@ public void init(FilterConfig filterConfig) throws ServletException { // do nothing } + /** + * + * @param request + * the incoming {@link ServletRequest} instance + * + * @param response + * the outgoing {@link ServletResponse} instance + * + * @param chain + * the {@link FilterChain} being executed + * + * @throws IOException + * if something fails + * + * @throws ServletException + * if something fails + * + * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, + * javax.servlet.ServletResponse, javax.servlet.FilterChain) + * + */ @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if(LOGGER.isInfoEnabled()) { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/AllJavascriptTag.java b/src/main/java/com/sangupta/jerry/web/taglib/AllJavascriptTag.java index 374c227..f7a09f7 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/AllJavascriptTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/AllJavascriptTag.java @@ -37,7 +37,8 @@ * location in the page. * * @author sangupta - * + * @since 1.0.0 + * */ public class AllJavascriptTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/AnonymousTag.java b/src/main/java/com/sangupta/jerry/web/taglib/AnonymousTag.java index cfcc7b8..63757a0 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/AnonymousTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/AnonymousTag.java @@ -27,7 +27,11 @@ import com.sangupta.jerry.security.SecurityContext; /** + * Include the body if the user is an anoymous user, as returned by the + * {@link SecurityContext#isAnonymousUser()} method. + * * @author sangupta + * @since 1.0.0 * */ public class AnonymousTag extends BodyTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/Base62Tag.java b/src/main/java/com/sangupta/jerry/web/taglib/Base62Tag.java index 62d0203..9b79939 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/Base62Tag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/Base62Tag.java @@ -30,8 +30,11 @@ import com.sangupta.jerry.encoder.Base62Encoder; /** + * Encode/decode the given value via {@link Base62Encoder}. + * * @author sangupta - * + * @since 1.0.0 + * */ public class Base62Tag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/Base64Tag.java b/src/main/java/com/sangupta/jerry/web/taglib/Base64Tag.java index 1bf5374..fa946fe 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/Base64Tag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/Base64Tag.java @@ -33,8 +33,12 @@ import com.sangupta.jerry.util.AssertUtils; /** + * Encode/decode the given value via {@link Base64Encoder} - optionally can + * store the encoded/decoded value in a request attribute. + * * @author sangupta - * + * @since 1.0.0 + * */ public class Base64Tag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/CheckBoxTag.java b/src/main/java/com/sangupta/jerry/web/taglib/CheckBoxTag.java index 25a1a7c..2caf7b7 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/CheckBoxTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/CheckBoxTag.java @@ -31,7 +31,7 @@ /** * @author sangupta - * + * @since 1.0.0 */ public class CheckBoxTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/DateFormatTag.java b/src/main/java/com/sangupta/jerry/web/taglib/DateFormatTag.java index a7b498e..35434dd 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/DateFormatTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/DateFormatTag.java @@ -34,7 +34,7 @@ * Formats a given date in a standard default pattern, or used supplied pattern. * * @author sangupta - * + * @since 1.0.0 */ public class DateFormatTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/EncodeUriComponentTag.java b/src/main/java/com/sangupta/jerry/web/taglib/EncodeUriComponentTag.java index 85aeebb..e2b24e4 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/EncodeUriComponentTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/EncodeUriComponentTag.java @@ -37,7 +37,7 @@ * or saves as a request attribute. * * @author sangupta - * + * @since 1.0.0 */ public class EncodeUriComponentTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/FormatSizeTag.java b/src/main/java/com/sangupta/jerry/web/taglib/FormatSizeTag.java index 5742f99..bbc0a2f 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/FormatSizeTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/FormatSizeTag.java @@ -30,8 +30,11 @@ import com.sangupta.jerry.util.ReadableUtils; /** + * Show the human readable value for the given size in bytes. If the value + * is less than 0, the tag does not do anything. + * * @author sangupta - * + * @since 1.0.0 */ public class FormatSizeTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/HexFormatTag.java b/src/main/java/com/sangupta/jerry/web/taglib/HexFormatTag.java index 8e6b643..ae50dd6 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/HexFormatTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/HexFormatTag.java @@ -32,7 +32,7 @@ * the string is written back as is. * * @author sangupta - * + * @since 1.0.0 */ public class HexFormatTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/JavascriptIncludeTag.java b/src/main/java/com/sangupta/jerry/web/taglib/JavascriptIncludeTag.java index 5f234b4..bc77a0b 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/JavascriptIncludeTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/JavascriptIncludeTag.java @@ -34,7 +34,7 @@ /** * @author sangupta - * + * @since 1.0.0 */ public class JavascriptIncludeTag extends BodyTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/OptionTag.java b/src/main/java/com/sangupta/jerry/web/taglib/OptionTag.java index 84898bf..a60b8ae 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/OptionTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/OptionTag.java @@ -30,7 +30,7 @@ /** * * @author sangupta - * + * @since 1.0.0 */ public class OptionTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/RadioButtonTag.java b/src/main/java/com/sangupta/jerry/web/taglib/RadioButtonTag.java index e3e6bc1..fcf9012 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/RadioButtonTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/RadioButtonTag.java @@ -31,7 +31,7 @@ /** * @author sangupta - * + * @since 1.0.0 */ public class RadioButtonTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/SignedInTag.java b/src/main/java/com/sangupta/jerry/web/taglib/SignedInTag.java index 7357f63..d047f06 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/SignedInTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/SignedInTag.java @@ -28,7 +28,7 @@ /** * @author sangupta - * + * @since 1.0.0 */ public class SignedInTag extends BodyTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/TimeAgoTag.java b/src/main/java/com/sangupta/jerry/web/taglib/TimeAgoTag.java index 200efd0..5ecead1 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/TimeAgoTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/TimeAgoTag.java @@ -32,7 +32,7 @@ /** * @author sangupta - * + * @since 1.0.0 */ public class TimeAgoTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/taglib/UserNameTag.java b/src/main/java/com/sangupta/jerry/web/taglib/UserNameTag.java index 31080e1..3df185b 100644 --- a/src/main/java/com/sangupta/jerry/web/taglib/UserNameTag.java +++ b/src/main/java/com/sangupta/jerry/web/taglib/UserNameTag.java @@ -31,7 +31,7 @@ /** * @author sangupta - * + * @since 1.0.0 */ public class UserNameTag extends SimpleTagSupport { diff --git a/src/main/java/com/sangupta/jerry/web/wrapper/ByteArrayServletOutputStream.java b/src/main/java/com/sangupta/jerry/web/wrapper/ByteArrayServletOutputStream.java index d050363..f178186 100644 --- a/src/main/java/com/sangupta/jerry/web/wrapper/ByteArrayServletOutputStream.java +++ b/src/main/java/com/sangupta/jerry/web/wrapper/ByteArrayServletOutputStream.java @@ -34,7 +34,7 @@ * and manipulate what has been written by the servlet. * * @author sangupta - * + * @since 1.0.0 */ public class ByteArrayServletOutputStream extends ServletOutputStream { @@ -56,7 +56,7 @@ public class ByteArrayServletOutputStream extends ServletOutputStream { /** * Return the writer object associated with this. * - * @return + * @return the {@link PrintWriter} instance */ public PrintWriter getWriter() { this.writerObtained = true; @@ -66,7 +66,7 @@ public PrintWriter getWriter() { /** * Return the current size of the data that has been written. * - * @return + * @return the length of the data so far written */ public int getLength() { if (this.writerObtained) { @@ -79,7 +79,7 @@ public int getLength() { /** * Get the entire byte-stream. * - * @return + * @return the internal {@link ByteArrayOutputStream} */ public ByteArrayOutputStream getByteArrayOutputStream() { return this.outputStream; @@ -88,7 +88,7 @@ public ByteArrayOutputStream getByteArrayOutputStream() { /** * Get the raw bytes written to this stream. * - * @return + * @return the raw bytes written so far */ public byte[] getBytes() { if (this.writerObtained) { diff --git a/src/main/java/com/sangupta/jerry/web/wrapper/HttpServletResponseWrapperImpl.java b/src/main/java/com/sangupta/jerry/web/wrapper/HttpServletResponseWrapperImpl.java index 803be0c..5866b80 100644 --- a/src/main/java/com/sangupta/jerry/web/wrapper/HttpServletResponseWrapperImpl.java +++ b/src/main/java/com/sangupta/jerry/web/wrapper/HttpServletResponseWrapperImpl.java @@ -42,7 +42,7 @@ * response code etc. * * @author sangupta - * + * @since 1.0.0 */ public class HttpServletResponseWrapperImpl extends HttpServletResponseWrapper { @@ -63,16 +63,24 @@ public class HttpServletResponseWrapperImpl extends HttpServletResponseWrapper { Locale locale; /** - * - * @param response - */ + * Create an instance of this wrapper from the given {@link ServletResponse} + * instance, if the actual incoming instance is {@link HttpServletResponse} + * + * @param response + * the {@link ServletResponse} instance + * + */ public HttpServletResponseWrapperImpl(ServletResponse response) { this((HttpServletResponse) response); } /** - * @param response - */ + * Create an instance of this wrapper from the given + * {@link HttpServletResponse} instance + * + * @param response + * the {@link HttpServletResponse} instance + */ public HttpServletResponseWrapperImpl(HttpServletResponse response) { super(response); @@ -87,40 +95,58 @@ public byte[] getBytes() { } /** - * Copy this response to the given {@link ServletResponse} instance. - * - * @param response - * @throws IOException - */ + * Copy this response to the given {@link ServletResponse} instance. + * + * @param response + * the {@link ServletResponse} instance to copy this response to + * + * @throws IOException + * if anything fails + */ public void copyToResponse(ServletResponse response) throws IOException { this.copyToResponse((HttpServletResponse) response); } /** - * Copy the altered response to the given {@link ServletResponse} instance. - * - * @param response - * @param alteredResponse - * @throws IOException - */ + * Copy the altered response to the given {@link ServletResponse} instance. + * + * @param response + * the {@link ServletResponse} instance to copy this response to + * + * @param alteredResponse + * the altered response to write + * + * @throws IOException + * if anything fails + */ public void copyToResponse(ServletResponse response, byte[] alteredResponse) throws IOException { this.copyToResponse((HttpServletResponse) response, alteredResponse); } /** - * Copy this response with the given {@link HttpServletResponse} instance. - * - * @param response - * @throws IOException - */ + * Copy this response with the given {@link HttpServletResponse} instance. + * + * @param response + * the {@link HttpServletResponse} instance to write to + * + * @throws IOException + * if anything fails + */ public void copyToResponse(HttpServletResponse response) throws IOException { this.copyToResponse(response, null); } /** - * - * @param response - * @throws IOException + * Copy the altered response to the given {@link HttpServletResponse} instance. + * + * @param response + * the {@link HttpServletResponse} instance to copy this response to + * + * @param alteredResponse + * the altered response to write + * + * @throws IOException + * if anything fails */ public void copyToResponse(HttpServletResponse response, byte[] alteredResponse) throws IOException { // character encoding diff --git a/src/main/java/com/sangupta/jerry/web/wrapper/ModifiedServletResponse.java b/src/main/java/com/sangupta/jerry/web/wrapper/ModifiedServletResponse.java index c42710c..531a123 100644 --- a/src/main/java/com/sangupta/jerry/web/wrapper/ModifiedServletResponse.java +++ b/src/main/java/com/sangupta/jerry/web/wrapper/ModifiedServletResponse.java @@ -37,7 +37,7 @@ * sent back to the client. * * @author sangupta - * + * @since 1.0.0 */ public class ModifiedServletResponse { @@ -72,23 +72,29 @@ public ModifiedServletResponse(HttpServletResponseWrapperImpl wrapper, byte[] by } /** - * Copy this modified response to the given {@link ServletResponse} object. The flush method is - * invoked in the end. - * - * @param response - * @throws java.io.IOException - */ + * Copy this modified response to the given {@link ServletResponse} object. + * The flush method is invoked in the end. + * + * @param response + * the {@link ServletResponse} instance + * + * @throws java.io.IOException + * if anything fails + */ public void copyToResponse(ServletResponse response) throws IOException { this.copyToResponse((HttpServletResponse) response); } /** - * Copy this modified response to the given {@link HttpServletResponse} object. The flush method is - * invoked in the end. - * - * @param response - * @throws IOException - */ + * Copy this modified response to the given {@link HttpServletResponse} + * object. The flush method is invoked in the end. + * + * @param response + * the {@link HttpServletResponse} instance + * + * @throws IOException + * if anything fails + */ public void copyToResponse(HttpServletResponse response) throws IOException { // character encoding if(this.characterEncoding != null) { diff --git a/src/main/java/com/sangupta/jerry/web/wrapper/UserAwareHttpServletRequestWrapper.java b/src/main/java/com/sangupta/jerry/web/wrapper/UserAwareHttpServletRequestWrapper.java index 6b7bec2..011c38b 100644 --- a/src/main/java/com/sangupta/jerry/web/wrapper/UserAwareHttpServletRequestWrapper.java +++ b/src/main/java/com/sangupta/jerry/web/wrapper/UserAwareHttpServletRequestWrapper.java @@ -29,7 +29,7 @@ /** * * @author sangupta - * + * @since 1.0.0 */ public class UserAwareHttpServletRequestWrapper extends HttpServletRequestWrapper { @@ -43,6 +43,7 @@ public class UserAwareHttpServletRequestWrapper extends HttpServletRequestWrappe * Convenience constructor * * @param request + * the {@link HttpServletRequest} instance to wrap around */ public UserAwareHttpServletRequestWrapper(HttpServletRequest request) { super(request); @@ -52,7 +53,10 @@ public UserAwareHttpServletRequestWrapper(HttpServletRequest request) { * Convenience constructor * * @param request + * the {@link HttpServletRequest} instance to wrap around + * * @param principal + * the user {@link Principal} to use */ public UserAwareHttpServletRequestWrapper(HttpServletRequest request, Principal principal) { super(request);