title: Apache Struts: Cannot retrieve ActionForward
body: <p>I am trying to learn the Apache Struts framework and I have written a small application that does class enrollments but whenever I try and load up my application it just spits out the following exception:</p>
  
  <pre><code>javax.servlet.ServletException: 
    org.apache.jasper.JasperException: 
      javax.servlet.ServletException: 
        javax.servlet.jsp.JspException: Cannot create rewrite URL: 
            java.net.MalformedURLException: Cannot retrieve ActionForward named adminLogin
  </code></pre>
  
  <p>My <code>index.jsp</code> page looks like:  </p>
  
  <pre><code>&lt;%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%&gt;
  &lt;logic:redirect forward="showLogin"/&gt;
  </code></pre>
  
  <p>The relevant parts of my <code>struts-config.xml</code>:</p>
  
  <pre><code>&lt;global-forwards&gt;
      &lt;forward name="showLogin" path="/showLogin.do" /&gt;
  &lt;/global-forwards&gt;
  &lt;action-mappings&gt;
      &lt;action path="/showLogin" forward="/pages/choose.jsp" /&gt;
      &lt;action path="/adminLogin" forward="/pages/adminLogin.jsp" /&gt;
  &lt;/action-mappings&gt;
  </code></pre>
  
  <p>And finally the <code>choose.jsp</code> file:</p>
  
  <pre><code>&lt;%@ page import="javax.sql.*"%&gt;
  &lt;%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%&gt;
  &lt;%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%&gt;
  
  &lt;h1&gt;Who are you?&lt;/h1&gt;
  &lt;ul&gt;
      &lt;li&gt;&lt;html:link forward="adminLogin"&gt;Administrator&lt;/html:link&gt;&lt;/li&gt;
      &lt;li&gt;&lt;html:link forward="instructorLogin"&gt;Instructor&lt;/html:link&gt;&lt;/li&gt;
      &lt;li&gt;&lt;html:link forward="studentLogin"&gt;Student&lt;/html:link&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>