1.What I am trying to do:
My question concerns the implementation of Dynamic Web Project on live server. How do I make a web application that works locally, will work on a live server?
2 What I did:
The steps I have taken:
Create Java App in Eclipse (using Servlet, Tomcat)
My very simple, test code:
package com.test; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/HelloWorld") public class Test extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.print("Hello World"); }
}
Export of the war file
- Uploaded my Java WAR package to my public_html directory. (I don't have access to any manager who could support my implementations, the only way is to connect to the server via SSH/FTP and upload a .war file to public_html)
Run the unzip to extract the package.
Added the. htaccess file with following text: SetHandler Jakar-servlet SetEnv JK_WORKER_NAME ajp13
3 What is not working?
By passing this url: http:///~(myusername)/Test/HelloWorld
ERROR: Not Found The requested URL /~(myusername)/Test/HelloWorld was not found on this server.
Apparently I don't fully understand the subject of implementation on the server, I swear that I tried to look for an answer, but now I'm in the trap, I can't move on.