Error 404: The requested resource is not available using HelloWorld servlet [duplicate]

Try this (if the Java EE V6) package crunch; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; @WebServlet(name=”hello”,urlPatterns={“/hello”}) // added this line public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println(“Hello World”); } } now reach the servlet by http://127.0.0.1:8080/yourapp/hello where 8080 is default Tomcat … Read more

How can I get NSURLResponse body?

Why do you cancel the connection? After all, 404 can have content body as well. Just don’t cancel it, and let the program call the next delegate NSURLConnection method. When the data [the content body] is sent – (void)connection:(NSURLConnection *) didReceiveData:(NSData *) is called, you need to retrieve the data there. Read corresponding part in … Read more

Angular 2 Hosted on IIS: HTTP Error 404

We have to make IIS fall back to index.html by adding a rewrite rule. Step 1: Install IIS URL Rewrite Module Step 2: Add a rewrite rule to web.config <?xml version=”1.0″ encoding=”utf-8″?> <configuration> <system.webServer> <rewrite> <rules> <rule name=”AngularJS Routes” stopProcessing=”true”> <match url=”.*” /> <conditions logicalGrouping=”MatchAll”> <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” /> <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” /> … Read more