I am working on a jsp page where i want to redirect to pages according to following condition. only the else part is working even when i type Google in text field. P.S. I am hosting it on localhost Glassfish Server
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String x = request.getParameter("browse");
if (x == "Google" || x == "google") {
response.sendRedirect("http://www.google.com");
} else if (x == "youtube" || x == "Youtube" || x == "you tube" || x == "Music") {
response.sendRedirect("http://www.youtube.com");
}else {
response.sendRedirect("http://localhost:11146/Project_Julie/" + x + ".jsp");
}
%>
</body>
</html>