MicroStrategy ONE

Customizing the main application URL

This scenario shows you how to customize the main application URL for requests sent to MicroStrategy Web. This root URL has three distinct parts, as shown below

http://webserver/MicroStrategy/servlet/mstrWeb

The root URL calls a central controller. Parameters are appended to the root URL to tell the controller how the request should be internally forwarded and handled.

Environment Context Root Servlet Context Servlet Name

J2EE

MicroStrategy

servlet

mstrWeb

Each of the three parts of the main application URL can be customized. 

The first customization is performed outside of MicroStrategy, but the other two require plug-ins as part of the customization. The instructions treat each customization separately so two different plug-ins are created. If you are customizing both the servlet context and the servlet name, you can consolidate the customizations into one plug-in.

Customizing the context root

The context root is the name of the application in a J2EE environment. By default, the context root is the string MicroStrategy in the environment. Customizing the context root is handled by the application server, outside of MicroStrategy.

To modify the context root in a J2EE environment, you can rename the default WAR file (MicroStrategy.war) before you deploy the application. You can also modify the name of the WAR file during deployment, but the way you do this depends on the application server you are using. Refer to the instructions provided by the vendor for your application server.

Customizing the servlet context

The servlet context is the string servlet in a J2EE environment. The steps below show you how to change the servlet context to myWeb for MicroStrategy Web and MicroStrategy Web Administrator. You can extrapolate from these steps to change the servlet context to some other string.

To customize the servlet context, you manually update the value of the <url-pattern> elements in the web.xml configuration file, use the Web Customization Editor to create a plug-in that updates specific links in the MicroStrategy Web Administrator page, and modify that plug-in so that it uses the new servlet context.:

To manually update web.xml:

  1. Make a backup copy of web.xml, located under WEB-INF in your MicroStrategy Web installation directory. You can use this to restore web.xml if needed.  

  2. Open web.xml and change servlet to myWeb, as shown below.

    Before customization: :

    Copy
    <servlet-mapping>
       <servlet-name>mstrWeb</servlet-name>
       <url-pattern>/servlet/mstrWeb</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
       <servlet-name>mstrWebAdmin</servlet-name>
       <url-pattern>/servlet/mstrWebAdmin</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
       <servlet-name>TaskProcessorServlet</servlet-name>
       <url-pattern>/servlet/taskProc</url-pattern>
    </servlet-mapping>

    After customization:

    Copy
    <servlet-mapping>
       <servlet-name>mstrWeb</servlet-name>
       <url-pattern>/myWeb/mstrWeb</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
       <servlet-name>mstrWebAdmin</servlet-name>
       <url-pattern>/myWeb/mstrWebAdmin</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
       <servlet-name>TaskProcessorServlet</servlet-name>
       <url-pattern>/myWeb/taskProc</url-pattern>
    </servlet-mapping>
  3. Save web.xml.

To create a plug-in that updates specific links in the MicroStrategy Web Administrator page using the Web Customization Editor:

  1. Launch the Web Customization Editor.  

  2. From the Windows menu, select Preferences, then MicroStrategy to create a new plug-in and enable the settings for administrative pages.  

    1. For Customization Folder, click Change. Give the new plug-in a meaningful name, such as myCustomServletContext, and click OK.  

    2. Select Show Advanced Options, then select Admin Pages under Options.  

  3. On the Application Settings tab, expand MicroStrategy Web Configuration to view the list of settings that can be modified to perform customizations.  

  4. Expand AdminPages to view the list of administrative pages used in MicroStrategy Web.  

  5. Double click login(Main Servlet’s login Page) to display the Basic Properties editor in the right pane. 

    1. Select the Template Properties tab at the bottom of the editor.  

    2. In the Template File text field, change /servlet/mstrWeb to /myWeb/mstrWeb.  

  6. Double click welcome(Main Servlet).

    1. Select the Template Properties tab at the bottom of the editor.  

    2. In the Template File text field, change /servlet/mstrWeb to /myWeb/mstrWeb.  

  7. Save your changes (to Admin_pageConfig.xml).
  8. Close the Web Customization Editor.
  9. Expand your plug-in folder and rename the jsp folder to myWeb.
  10. Copy the following configuration files from WEB-INF\xml in your MicroStrategy Web installation directory and paste them in the WEB-INF\xml directory in your plug-in folder.
    • Admin_pageConfig.xml
    • pageConfig.xml
    • serverAdminConfig.xml
  11. Open each of these files in a text editor, replace all instances of jsp with myWeb, and save your changes.

Customizing the servlet name

The servlet name is the string mstrweb in a J2EE environment. The steps below show you how to change the servlet name to myServlet. You can extrapolate from these steps to change the servlet name to some other string. 

To customize the servlet name, you manually modify web.xml and index.jsp, and use the Web Customization Editor to update Admin_PageConfig.xml.  

  • To manually update the value of the <servlet-name> elements in web.xml:  

    1. Make a backup copy of web.xml, located under WEB-INF in your MicroStrategy Web installation directory. You can use this to restore web.xml if needed.  

    2. Open web.xml and change mstrWeb to myServlet, as shown in bold text below. :

      Before customization:

      <web-app>

         ...

         <servlet>

            <servlet-name>mstrWeb</servlet-name>

            <display-name>Main Servlet</display-name>

            <servlet-class>com.microstrategy.web.servlets.MainServlet</servlet-class>

            <load-on-startup>1</load-on-startup>

         </servlet>

         ...

         <servlet-mapping>

             <servlet-name>mstrWeb</servlet-name>

             <url-pattern>/servlet/mstrWeb</url-pattern>

         </servlet-mapping>

         ...

         <servlet-mapping>

             <servlet-name>mstrWeb</servlet-name>

             <url-pattern>/export/*</url-pattern>

         </servlet-mapping>

          ...

      </web-app>

      After customization:

      <web-app>

         ...

         <servlet>

            <servlet-name>myServlet</servlet-name>

            <display-name>Main Servlet</display-name>

            <servlet-class>com.microstrategy.web.servlets.MainServlet</servlet-class>

            <load-on-startup>1</load-on-startup>

         </servlet>

         ...

         <servlet-mapping>

             <servlet-name>myServlet</servlet-name>

             <url-pattern>/servlet/myServlet</url-pattern>

         </servlet-mapping>

         ...

         <servlet-mapping>

             <servlet-name>myServlet</servlet-name>

             <url-pattern>/export/*</url-pattern>

         </servlet-mapping>

          ...

      </web-app>

    3. Save web.xml.

    To update Admin_PageConfig.xml using the Web Customization Editor:

    1. Launch the Web Customization Editor.  

    2. From the Windows menu, select Preferences, then MicroStrategy to create a new plug-in and enable the settings for administrative pages.

      1. For Customization Folder, click Change. Give the new plug-in a meaningful name, such as myCustomServletContext and click OK.  

      2. Select Show Advanced Options, then select Admin Pages under Options.  

    3. On the Application Settings tab, expand MicroStrategy Web Configuration to view the list of settings that can be modified to perform customizations.  

    4. Expand Web Configuration Settings.  

    5. Right-click MicroStrategy Configuration Settings and select Rename Application Servlet.  

    6. In the text field on the Rename Application Servlet dialog box, change mstrWeb to myServlet and click OK.
    7. Expand AdminPages to view the list of administrative pages used in MicroStrategy Web.:

      The Web Administrator page has links to MicroStrategy Web. You need to update these links to use the updated servlet name.  

      • Double click login(Main Servlet’s login Page).

        1. Select the Template Properties tab at the bottom in the right pane.  

        2. In the Template File text field, change /servlet/mstrWeb to /servlet/myServlet

      • Double click welcome(Main Servlet).

        1. Select the Template Properties tab.
           

        2. In the Template File text field, change /servlet/mstrWeb to /servlet/myServlet

    8. Exit the Web Customization Editor. 

  • To manually update index.jsp:

    If you enter the MicroStrategy Web URL as http://webserver/MicroStrategy without entering the servlet context or name, MicroStrategy Web automatically redirects the URL to http://webserver/MicroStrategy/servlet/mstrWeb. To automatically redirect the URL to http://webserver/MicroStrategy/servlet/myServlet instead, make the following changes:

    1. Make a backup copy of index.jsp, located in the MicroStrategy root folder. You can use this to restore index.jsp if needed.  

    2. Open index.jsp and change “/servlet/mstrWeb” to /servlet/myServlet, as shown in the bold text below. :

      Before customization:

      <%

      String randNum = (String)session.getAttribute( "validateRandNum");

      response.sendRedirect("servlet/mstrWeb");

      %>


      After customization:

      <%

      String randNum = (String)session.getAttribute( "validateRandNum");

      response.sendRedirect("servlet/myServlet");

      %>

    3. Save index.jsp.