パッケージ org.iplass.mtp.impl.web

クラス WebUtil

java.lang.Object
org.iplass.mtp.impl.web.WebUtil

public class WebUtil extends Object
  • メソッドの概要

    修飾子とタイプ
    メソッド
    説明
    static org.iplass.mtp.command.RequestContext
     
    static String
     
    static String
    getTenantContextPath(jakarta.servlet.http.HttpServletRequest req)
     
    getTenantWebInfo(org.iplass.mtp.tenant.Tenant tenant)
     
    static void
    include(String actionName, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page)
    actionNameで指定される別のActionをinclude。
    static void
    include(String actionName, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page, org.iplass.mtp.command.RequestContextWrapper requestContext)
    actionNameで指定される別のActionをinclude。
    static void
    includeTemplate(String templateName, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page)
    直接テンプレートをinclude(Commandは実行されない)。
    static void
    includeTemplate(String templateName, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page, org.iplass.mtp.command.RequestContextWrapper requestContext)
    直接テンプレートをinclude(Commandは実行されない)。
    static boolean
    isDirectAccess(jakarta.servlet.http.HttpServletRequest req)
     
    static boolean
     
    static boolean
    needTrustedLogin(String requestPath)
     
    static void
    renderContent(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page)
    レイアウトテンプレートで、コンテンツをレンダリングする場所で呼び出す。
    static void
    setCacheControlHeader(WebRequestStack req, boolean cache, boolean shared, long maxAge)
    ResponceHeaderにキャッシュの設定をする。
    static void
    setCacheControlHeader(WebRequestStack req, boolean cache, long maxAge)
    ResponceHeaderにキャッシュの設定をする。
    static void
    setContentDispositionHeader(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, ContentDispositionType type, String fileName)
    ResponseHeaderにContentDispositionの設定をする。
    static void
    ResponseHeaderにContentDispositionの設定をする。

    クラスから継承されたメソッド java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • メソッドの詳細

    • needTrustedLogin

      public static boolean needTrustedLogin(String requestPath)
    • isValidInternalUrl

      public static boolean isValidInternalUrl(String url)
    • getRequestContext

      public static org.iplass.mtp.command.RequestContext getRequestContext()
    • includeTemplate

      public static void includeTemplate(String templateName, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page) throws IOException, jakarta.servlet.ServletException
      直接テンプレートをinclude(Commandは実行されない)。
      パラメータ:
      templateName - テンプレート名
      req -
      resp -
      context -
      page -
      例外:
      IOException
      jakarta.servlet.ServletException
    • includeTemplate

      public static void includeTemplate(String templateName, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page, org.iplass.mtp.command.RequestContextWrapper requestContext) throws IOException, jakarta.servlet.ServletException
      直接テンプレートをinclude(Commandは実行されない)。 その際、引数のRequestContextWrapperで入力値を上書きする。
      パラメータ:
      templateName - テンプレート名
      req -
      resp -
      context -
      page -
      requestContext -
      例外:
      IOException
      jakarta.servlet.ServletException
    • include

      public static void include(String actionName, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page) throws IOException, jakarta.servlet.ServletException
      actionNameで指定される別のActionをinclude。
      パラメータ:
      actionName -
      req -
      resp -
      context -
      page -
      例外:
      IOException
      jakarta.servlet.ServletException
    • include

      public static void include(String actionName, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page, org.iplass.mtp.command.RequestContextWrapper requestContext) throws IOException, jakarta.servlet.ServletException
      actionNameで指定される別のActionをinclude。 その際、引数のRequestContextWrapperで引数を上書きする。
      パラメータ:
      actionName -
      req -
      resp -
      context -
      page -
      requestContext -
      例外:
      IOException
      jakarta.servlet.ServletException
    • getTenantContextPath

      public static String getTenantContextPath(jakarta.servlet.http.HttpServletRequest req)
    • isDirectAccess

      public static boolean isDirectAccess(jakarta.servlet.http.HttpServletRequest req)
    • getStaticContentPath

      public static String getStaticContentPath()
    • renderContent

      public static void renderContent(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, jakarta.servlet.ServletContext context, jakarta.servlet.jsp.PageContext page) throws IOException, jakarta.servlet.ServletException
      レイアウトテンプレートで、コンテンツをレンダリングする場所で呼び出す。
      パラメータ:
      req -
      resp -
      context -
      page -
      例外:
      IOException
      jakarta.servlet.ServletException
    • setCacheControlHeader

      public static void setCacheControlHeader(WebRequestStack req, boolean cache, long maxAge)
      ResponceHeaderにキャッシュの設定をする。 ただし、クライアント直リクエストかつレスポンスが未コミットの場合にのみ設定。
      パラメータ:
      req -
      cache -
    • setCacheControlHeader

      public static void setCacheControlHeader(WebRequestStack req, boolean cache, boolean shared, long maxAge)
      ResponceHeaderにキャッシュの設定をする。 ただし、クライアント直リクエストかつレスポンスが未コミットの場合にのみ設定。
      パラメータ:
      req -
      cache -
      shared - 共有キャッシュであるか
    • setContentDispositionHeader

      public static void setContentDispositionHeader(WebRequestStack req, ContentDispositionType type, String fileName) throws IOException
      ResponseHeaderにContentDispositionの設定をする。
      パラメータ:
      req - リクエスト
      type - ContentDispositionType
      fileName - ファイル名
      例外:
      IOException
    • setContentDispositionHeader

      public static void setContentDispositionHeader(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp, ContentDispositionType type, String fileName) throws IOException
      ResponseHeaderにContentDispositionの設定をする。
      パラメータ:
      req - HttpServletRequest
      resp - HttpServletResponse
      type - ContentDispositionType
      fileName - ファイル名
      例外:
      IOException
    • getTenantWebInfo

      public static TenantWebInfo getTenantWebInfo(org.iplass.mtp.tenant.Tenant tenant)