Note that there are some explanatory texts on larger screens.

plurals
  1. POUrl mapping with my servlet?
    primarykey
    data
    text
    <p>I'm using GWT with GAE. When the user enters any of the following urls, I want to just serve my app as usual to them:</p> <pre><code>http://www.mysite.com/ http://www.mysite.com/dog http://www.mysite.com/cat </code></pre> <p>the first case works by default. I'm not sure how to get the /dog and /cat cases to work. I think I have to modify something with the url mappings to get that to work in web.xml. Essentially I'm trying to just get my app served with any url entered:</p> <pre><code>http://www.mysite.com/* </code></pre> <p>I'm trying this with a brand new project, so my web.xml looks like this:</p> <pre><code>&lt;!-- Servlets --&gt; &lt;servlet&gt; &lt;servlet-name&gt;greetServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;com.me.test.server.GreetingServiceImpl&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;greetServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/test/greet&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>and now I've appended the following below:</p> <pre><code>&lt;servlet&gt; &lt;servlet-name&gt;servletGate&lt;/servlet-name&gt; &lt;servlet-class&gt;com.me.test.server.ServletGate&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;servletGate&lt;/servlet-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>when I enter a url like:</p> <pre><code>http://localhost:8888/ http://localhost:8888/dog </code></pre> <p>I get a null pointer exception thrown on the doGet() line here:</p> <pre><code>getServletConfig().getServletContext().getRequestDispatcher("test.html").forward(request,response); </code></pre> <p>what have I missed?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload