Reputation: 21
I am learning how to build a Java project in IntelliJ. But I can't make it build automatically, while running the Jetty:run command.
I already set the IDE to autobuild when saving and to build when idle for 10 secs, and set the compiler.automake.allow.when.app.running to 1. All of these methods worked doing in my mac, but in windows it doesn't work.
I have a servlet like so:
package br.com.alura.maven.lojaweb;
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(urlPatterns={"/contato"})
public class ContatoServlet extends HttpServlet{
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter writer = resp.getWriter();
writer.println("<html><h2>My message here!</h2></html>");
writer.close();
}
}
When I change the message and save, I hope to find it changed in the browser
Upvotes: 0
Views: 1411