0
Can you help me do this exercise? I need to create a way doGet
and then create another file to be the output of my Save the problem and I have no idea how I do this junction between the two... follows the code
package br.com.servlets;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ServletName extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = 7475043552851895502L;
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) {
char primeiroNome = request.getParameter('primeiro').value;
char segundoNome = request.getParameter('segundo').value;
var resultado = primeiroNome + " " + segundoNome;
if(primeiroNome == "" || segundoNome == ""){
alert("os campos devem ser preenchidos!");
}else{
alert(resultado);
}
}
}
As well "create another file" you are referring to the answer of the get request ?
– rnd_rss
that same friend.
– Lucas Marcolino