Direct Access to the Decision-making Platform via IP Address in Tomcat

  • Last update:August 29, 2025
  • iconNote:
    This document is only applicable to projects that are not deployed on FineOps.

    In some cases, you may need to access FineReport projects deployed on FineOps via domain name/IP address. For details, see Accessing Projects Through IP Address/Domain Name.

    Overview

    Application Scenario

    • You want to access the platform, but /webroot/decision does not exist in the access path.

    • You want to access the Tomcat project via IP address or domain name.

    • You want the URL for accessing the platform or the address for accessing templates to be shorter.

    Function Description

    After Tomcat server deployment, you can start the Tomcat server and visit the URL http://localhost:8080/webroot/decision to enter the data decision-making system.

    You may want to access the data decision-making system directly through IP address.

    You can modify the port number and establish a virtual directory to directly enter the decision-making system through IP address (for example, http://localhost).

    iconNote:
    This document only introduces how to access projects through IP address. If you want to access projects via domain name, you can bind the IP address to the domain name according to your actual situation. This document does not elaborate further.

    Procedure

    For example, this document will take the access to http://localhost as an example for introduction.

    Modifying the Port Number

    If no other network programs occupy port number 80, you can set the port number of the Tomcat server to 80.

    Since port 80 is the default port, you do not need to add the port number of the Tomcat server when accessing the report page.

    1. Open the server.xml file in Tomcat installation directory\conf\, and modify the port number, as shown in the following figure.

     1.png

    The code is as follows:

    <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

    2. Restart the Tomcat server and visit http://localhost /webroot/decision to enter the decision-making system.

    Setting the Welcome Page

    Each web server has a default welcome page. You can modify the page to display the platform page.

    Create the a.html file in the directory Tomcat installation directory\webapps\webroot as the default home page of the web server.

    Setting the Page Displayed on PC and in the DataAnalyst App

    You can download and unzip the file a.zip to obtain the a.html file.

    The file a.html calls the iframe to integrate the platform product demonstration page. The code is as follows:

    <html>
      <head>
        <title>FineReport Report</title>
        <link rel="stylesheet" type="text/css" href="/decision/file?path=/com/fr/web/core/css/leaflet.css&type=plain&parser=plain"/>
         <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1.0, user-scalable=no">
      </head>
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
        <iframe id="reportFrame" src="decision" allowfullscreen="true"
          name="itemslist" frameborder="0" width="100%" height="100%"></iframe>
      </body>
    </html>
    iconNote:
    This line of code, <link rel="stylesheet" type="text/css" href="/decision/file?path=/com/fr/web/core/css/leaflet.css&type=plain&parser=plain"/>, is used to solve the problem of abnormal map display after the chart toolbar in the decision-making system goes full-screen.

    Restart the Tomcat server and visit http://localhost/webroot/a.html to enter the login page of the decision-making system.

    Setting the Page Displayed on the HTML5Terminal

    You can download and decompress the file a.zipto obtain the a.html file.

    The file a.html calls the iframe to integrate the platform product demonstration page. The code is as follows:

    <html>
      <head>
        <title>FineReport Report</title>
        <link rel="stylesheet" type="text/css" href="/decision/file?path=/com/fr/web/core/css/leaflet.css&type=plain&parser=plain"/>
          <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1.0, user-scalable=no">
      </head>
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
        <iframe id="reportFrame" src="decision" allowfullscreen="true"
          name="itemslist" frameborder="0" width="100%" height="100%"></iframe>
      </body>
    </html>
    iconNote:
    You need to install the HTML5 Mobile Display plugin when setting the page displayed on the HTML5 terminal.

    Creating a Virtual Directory

    Create a virtual directory by modifying the configuration file.

    Adjusting the Project Path

    The report project webroot is placed in the Tomcat installation directory\webapps directory by default, and will be loaded when the server is started. After you create the virtual directory, the webroot project will be loaded again through the configuration file when you start the Tomcat server. If the webroot project is loaded twice, error messages and server crashes will occur.

    Therefore, you need to move the webroot project in Tomcat installation directory\webapps out of the Tomcat deployment directory, and the project needs to be placed onto the disk in the same path as the Tomcat project.

    This document moves the folder webroot from Tomcat installation directory\webapps\webroot to the path E:\webroot. The following figure shows the effect.

    icon

    Note:



    You should move (should not copy) the webroot file. After the move, no webroot file is left in the webapps directory in Tomcat installation directory.

    2-p.png

    Modifying the server.xml File

    Modify the server.xml file in Tomcat installation directory\conf, and add code between the host tags in the file server.xml, as shown in the following figure.

     3.png

    The code is as follows:

    <Context path="" docBase="D:\webroot" debug="0" reloadable="false" />

    The following table describes the code.

    Parameter
    Description
    path

    Name of the virtual directory

    If you want to display the home page after entering the IP address, you can leave this key value empty.

    docBase

    Path of the virtual directory

    The path of webroot set in section "Adjusting the Project Path" is E:\webroot.

    debug

    0

    reloadable

    false

    Modifying the web.xml File

    Modify the web.xml file in the path Tomcat installation directory\conf. Add the following code before the tag </web-app> at the end of the web.xml file to display the custom welcome page a.html.

    iconNote:
    You can create a web.xml file in webroot\WEB-INF, if the file does not exist. You are advised to obtain the relevant original files from the official Tomcat website according to your Tomcat version.

    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>a.html</welcome-file>
      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    The following figure shows the effect.

     4.png

    Effect Preview

    PC

    Restart the Tomcat server, and access http://localhost to enter the a.html page and access the data decision system, as shown in the following figure. (In this document, the device is visited in the local environment, so http://localhost is used, and the actual access address is http://IP address).

     5.png

    Mobile Terminal (HTML5 Terminal)

    Restart the Tomcat server and visit http://IP address, as shown in the following figure.

     6.jpg

    iconNote:
    For details about the access in the DataAnalyst app, see section "Mobile Terminal."

    Entering the Server Address

    Remote Design

    When entering the server address for remote design, you need to omit webroot and keep decision.

    Option
    Value
    Hostname/IP address

    Input the content according to the actual situation.

    Port number

    80

    Web application

    Null

    Serverlet

    decision

    Username and Password

    Input the content according to the actual situation.

    You can configure the working directory as shown in the following figure.

     7.png

    Mobile Terminal

    When you enter the server address in App, H5, WeChat, and DingTalk integrated environments, webroot should be omitted, but decision must be retained.

    Option
    Value
    Hostname/IP address

    Input the content according to the actual situation.

    Port number

    80

    Web application

    Null

    Serverlet

    decision

    Username and Password

    Input the content according to the actual situation.

    You can configure the working directory as shown in the following figure.

     8.jpg

    Notes

    Incomplete Page Display in the IE9 Browser

    Problem

    After you complete the Tomcat deployment according to the previous configuration, the page can not be displayed completely in the IE9 browser.

    Solution

    You can modify the code in the a.html file in section "Setting the Welcome Page." The code is as follows:

    <html>  
        <head>  
            <title>FineReport</title>
            <meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge"/>
            <link rel="stylesheet" type="text/css" href="/decision/file?path=/com/fr/web/core/css/leaflet.css&type=plain&parser=plain"/>
      <style type="text/css">
              html, body
        {
          margin: 0px 0px;
          width: 100%;
          height: 100%;
        }
              iframe
        {
          margin: 0px 0px;
          width: 100%;
          height: 100%;
        }
      </style>
        </head>  
        <body>  
            <iframe id="reportFrame" src="decision" name="itemslist" frameborder="0"></iframe>
        </body>  
    </html>

    Attachment List


    Theme: Deployment and Integration
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy