Class JSPUtil


  • public class JSPUtil
    extends Object
    Class with a bunch of very useful JSP utilities in it.

    Created by Jeff Gaynor
    on 10/12/11 at 3:11 PM

    • Constructor Detail

      • JSPUtil

        public JSPUtil()
    • Method Detail

      • fwd

        public static void fwd​(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse res,
                               String resource)
                        throws IOException,
                               javax.servlet.ServletException
        Forwards a request
        Parameters:
        req -
        res -
        resource -
        Throws:
        IOException
        javax.servlet.ServletException
      • isEmpty

        public static boolean isEmpty​(String x)
        Returns if a string is null or of zero length.
        Parameters:
        x -
        Returns:
      • getParameter

        public static String getParameter​(javax.servlet.http.HttpServletRequest request,
                                          Object key)
        Gets a parameter from the request and invokes the objects toString method. This is very useful if you have URIs or URLs and need to check the request for values.
        Parameters:
        request -
        key -
        Returns:
      • handleException

        public static void handleException​(Throwable t,
                                           javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response,
                                           String page)
                                    throws IOException,
                                           javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException