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:
-
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.
-
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> - Save web.xml.
To create a plug-in that updates specific links in the MicroStrategy Web Administrator page using the Web Customization Editor:
-
From the Windows menu, select Preferences, then MicroStrategy to create a new plug-in and enable the settings for administrative pages.
-
For Customization Folder, click Change. Give the new plug-in a meaningful name, such as myCustomServletContext, and click OK.
-
Select Show Advanced Options, then select Admin Pages under Options.
-
On the Application Settings tab, expand MicroStrategy Web Configuration to view the list of settings that can be modified to perform customizations.
-
Expand AdminPages to view the list of administrative pages used in MicroStrategy Web.
-
Double click login(Main Servlet’s login Page) to display the Basic Properties editor in the right pane.
-
Select the Template Properties tab at the bottom of the editor.
-
In the Template File text field, change /servlet/mstrWeb to /myWeb/mstrWeb.
-
Double click welcome(Main Servlet).
-
Select the Template Properties tab at the bottom of the editor.
-
In the Template File text field, change /servlet/mstrWeb to /myWeb/mstrWeb.
- Save your changes (to Admin_pageConfig.xml).
- Close the Web Customization Editor.
- Expand your plug-in folder and rename the jsp folder to myWeb.
- 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
- Admin_pageConfig.xml
- 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:
-
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.
-
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>
-
Save web.xml.
To update Admin_PageConfig.xml using the Web Customization Editor:
-
From the Windows menu, select Preferences, then MicroStrategy to create a new plug-in and enable the settings for administrative pages.
-
For Customization Folder, click Change. Give the new plug-in a meaningful name, such as myCustomServletContext and click OK.
-
Select Show Advanced Options, then select Admin Pages under Options.
-
On the Application Settings tab, expand MicroStrategy Web Configuration to view the list of settings that can be modified to perform customizations.
-
Expand Web Configuration Settings.
-
Right-click MicroStrategy Configuration Settings and select Rename Application Servlet.
- In the text field on the Rename Application Servlet dialog box, change mstrWeb to myServlet and click OK.
-
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).
-
Select the Template Properties tab at the bottom in the right pane.
-
In the Template File text field, change /servlet/mstrWeb to /servlet/myServlet.
-
-
Double click welcome(Main Servlet).
-
Select the Template Properties tab.
-
In the Template File text field, change /servlet/mstrWeb to /servlet/myServlet.
-
-
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:
-
Make a backup copy of index.jsp, located in the MicroStrategy root folder. You can use this to restore index.jsp if needed.
-
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");
%>
-
Save index.jsp.