Click here to Skip to main content
15,907,149 members
Home / Discussions / Java
   

Java

 
GeneralRe: Hi friends I need some help regarding the following program will you please help me Pin
Richard MacCutchan2-Jan-15 4:54
mveRichard MacCutchan2-Jan-15 4:54 
GeneralRe: Hi friends I need some help regarding the following program will you please help me Pin
Leela Krishna Yadav2-Jan-15 5:14
Leela Krishna Yadav2-Jan-15 5:14 
AnswerRe: Hi friends I need some help regarding the following program will you please help me Pin
Richard MacCutchan2-Jan-15 5:46
mveRichard MacCutchan2-Jan-15 5:46 
GeneralRe: Hi friends I need some help regarding the following program will you please help me Pin
Leela Krishna Yadav2-Jan-15 5:59
Leela Krishna Yadav2-Jan-15 5:59 
QuestionHelp option in a JAR FILE Pin
ramina sen30-Dec-14 20:40
ramina sen30-Dec-14 20:40 
AnswerRe: Help option in a JAR FILE Pin
Richard MacCutchan30-Dec-14 22:09
mveRichard MacCutchan30-Dec-14 22:09 
GeneralRe: Help option in a JAR FILE Pin
ramina sen30-Dec-14 22:16
ramina sen30-Dec-14 22:16 
GeneralRe: Help option in a JAR FILE Pin
Richard MacCutchan30-Dec-14 22:47
mveRichard MacCutchan30-Dec-14 22:47 
Questionproblem to connect Java EE application to database Pin
Imad_dz29-Dec-14 6:31
Imad_dz29-Dec-14 6:31 
SuggestionRe: problem to connect Java EE application to database Pin
Richard MacCutchan29-Dec-14 23:13
mveRichard MacCutchan29-Dec-14 23:13 
Questionpagination in java swing Pin
bilalshameem25-Dec-14 23:44
bilalshameem25-Dec-14 23:44 
AnswerRe: pagination in java swing Pin
Richard MacCutchan26-Dec-14 1:05
mveRichard MacCutchan26-Dec-14 1:05 
Question[EDIT] CLASS cannot be resolved to a type Pin
AmbiguousName23-Dec-14 8:56
AmbiguousName23-Dec-14 8:56 
QuestionRe: CLASS cannot be resolved to a type Pin
Richard MacCutchan23-Dec-14 21:38
mveRichard MacCutchan23-Dec-14 21:38 
AnswerRe: [EDIT] CLASS cannot be resolved to a type Pin
alexey_s22-Jan-15 8:15
alexey_s22-Jan-15 8:15 
QuestionGabor Patch Generator Pin
amirsharifzadeh20-Dec-14 22:01
amirsharifzadeh20-Dec-14 22:01 
SuggestionRe: Gabor Patch Generator Pin
Richard MacCutchan20-Dec-14 22:14
mveRichard MacCutchan20-Dec-14 22:14 
QuestionHow to Use Delimiters in my program(Does not work and Crashes) Pin
Kaytlyn Grace Lau20-Dec-14 7:44
Kaytlyn Grace Lau20-Dec-14 7:44 
AnswerRe: How to Use Delimiters in my program(Does not work and Crashes) Pin
Richard MacCutchan20-Dec-14 21:06
mveRichard MacCutchan20-Dec-14 21:06 
AnswerRe: How to Use Delimiters in my program(Does not work and Crashes) Pin
Richard MacCutchan21-Dec-14 4:01
mveRichard MacCutchan21-Dec-14 4:01 
GeneralRe: How to Use Delimiters in my program(Does not work and Crashes)(SOLVED) Pin
Kaytlyn Grace Lau21-Dec-14 9:18
Kaytlyn Grace Lau21-Dec-14 9:18 
GeneralRe: How to Use Delimiters in my program(Does not work and Crashes)(SOLVED) Pin
Richard MacCutchan21-Dec-14 22:44
mveRichard MacCutchan21-Dec-14 22:44 
Question[SOLVED] Does not redirect properly Pin
Django_Untaken14-Dec-14 20:52
Django_Untaken14-Dec-14 20:52 
Hello. I am trying to authenticate input from databse using JDBC and then redirect the user to another page accordingly. Here is my code for small servlet that does authentication
Java
public class ServletAuthUser extends HttpServlet
{
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	{
	  try
	  {
		String sUserName = request.getParameter("username");
		String sPassword = request.getParameter("password");

		String sURL = "Jdbc:Odbc:ServletsDB_DSN";
		String sForName = "sun.jdbc.odbc.JdbcOdbcDriver";
		MyDatabase db = new MyDatabase(sURL, sForName);		
			
		boolean bIsUserValid = (sUserName.equals("admin") && sPassword.equals("admin")) ? true : false;//boolean bIsUserValid = db.AuthUser(sUserName, sPassword);
		db.CloseConnection();
			
		if(bIsUserValid == true)
        		response.sendRedirect("welcome.html");
		else
			response.sendRedirect("error.html");
}

And here is my welcome page.
HTML
<html>
	<head>
		<title>Welcome</title>
	</head>
	<body>
		<h1>Welcome ADMIN.</h1>
	</body>
</html>


I have tried recompiling the servlets and then restarted the apache server several times but my login servlets still shows me the old output that I tried little ago (another servlet which generates data using JDBC). Why is it still showing the same old output despite recompiling the servlet and restarting the server? Please ask for any info if you need. Thanks for any input.


EDIT
I was not writing the deployment descriptor properly.

modified 19-Dec-14 14:13pm.

QuestionRe: Does not redirect properly Pin
Richard MacCutchan14-Dec-14 22:19
mveRichard MacCutchan14-Dec-14 22:19 
QuestionLogin Details Authentication Pin
JayantiSh13-Dec-14 12:08
JayantiSh13-Dec-14 12:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.