could anyone please help with the code.
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
// TODO Auto-generated method stub
response.setContentType("text/html");
PrintWriter out=response.getWriter();
HttpSession session=request.getSession();
session.setAttribute("lErrorMsg",null);
String target="jsp/hrms_default.jsp";
String action=request.getParameter("action_submit");
//String actionchngpswd=request.getParameter("actionchngpswd");
//String username=request.getParameter("username");
System.out.println("user_name");
/* If the details are submitted with the user name and other fields */
System.out.println(action);
if(action.equalsIgnoreCase("hrms_user_login_submit"))
{
/* Requesting all the details from the jsp page */
System.out.println("inside action_submit");
String userId=request.getParameter("user_id");
String userName=request.getParameter("user_name");
String password=request.getParameter("user_password");
System.out.println(userId);
/* Setting the details to the bean class */
userLogin_bean obj=new userLogin_bean();
obj.setUser_Id(userId);
obj.setPassword(password);
obj.setUserName(userName);
userLogin_model modelObj=new userLogin_model();
System.out.println("model obj created");
try
{
boolean valid=modelObj.checkLogin(obj);
if(valid==true)
{
System.out.println("user valid");
target="jsp/hrms_default.jsp";
}
else
{
System.out.println("invalid user");
// String lErrorMsg="user does not exist";
//session.setAttribute("lErrorMsg",lErrorMsg);
target="jsp/Hrms_user_login.jsp";
}
//RequestDispatcher requestDispatcher=request.getRequestDispatcher(target);
//requestDispatcher.forward(request, response);
}
catch (SQLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
RequestDispatcher requestDispatcher=request.getRequestDispatcher(target);
requestDispatcher.forward(request, response);
}
}
could anyone please check the code. If i enter the correct username and password it redirects me to the correct page but if I enter the incorrect username and password then it redirects me to different page
View Answers
January 29, 2012 at 5:05 PM
You may debug it in tomcat when the request comes to Servlet.
Check for the exception also.
------------------------------------
Chandraprakash Sarathe
http://javaved.blogspot.com/
January 29, 2012 at 5:18 PM
the problem is if i enter username and password correctly then it works fine and if i enter it incorrectly once it again redirects me correctly but after entering the details again after failed attempt then it does not redirect correctly.
January 29, 2012 at 5:18 PM
the problem is if i enter username and password correctly then it works fine and if i enter it incorrectly once it again redirects me correctly but after entering the details again after failed attempt then it does not redirect correctly.
Related Tutorials/Questions & Answers:
could anyone please help with the code.could anyone please help with the
code. protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException...(request, response);
}
}
could anyone please check the
code. If i enter
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyoneCan any one
please help me in this ,,,,,,, need java
code for this ,,,,
please anyone The Airport Valet Parking Company (AVP) is a company which provides a convenient medium cost parking solution to users of a local airport. Key
Advertisements
Please help with this codePlease help with this code I need some
help getting the Search method below to work with the menu, and I also cannot figure out how to get my bubble sort to work. I've spent a long time on this and think my brain is just fried
ajax code please help to solve this........ajax
code please help to solve this. in this i am trying to get data... null;
}
please help me
when i am running this it show an error...;<a href="help.jsp">
help instruction</a></li>
<
Not sure whats wrong with my code HELP PLEASE?!?!Not sure whats wrong with my
code HELP PLEASE?!?! I cant figure out what I am doing wrong in my
code can
anyone help me out???
Grades ADS_TO_REPLACE_1
function computeGrade( )
{
var hw, lab, midt, fin, avg;
hw
please help me to give code - Java Beginnersplease help me to give code Write a function, sliding(word, num)that behaves as follows. It should print out each slice of the original word having length num, aligned vertically as shown below. A call to sliding(examples, 4
please help me to give code - Java Beginnersplease help me to give code Write a function with a signature cheerlead(word) that prints a typical cheer as follows. The word robot:
Gimme an R
Gimme an O
Gimme a B
Gimme an O
Gimme a T
What did you give me?
ROBOT
Please help me fix this code - MobileApplicationsPlease help me fix this code
Please help me in this area of
code... in the background of the forms in this
code
i want to sum all expenses amount... expenses)", "
Please fill all required field \n \n * This signify required field
please help me to give code - Java Beginnersplease help me to give code Write a program that prints an n-level stair case made of text. The user should choose the text character and the number of stairs in the stair case
*
**
***
****
Hi friend
please help me to give code - Java Beginnersplease help me to give code Write a program that uses loops to generate an n x n times table. The program should get n from the user. As a model here is a 4 x4 version:
| 1 2 3 4
please help me to give code - Java Beginnersplease help me to give code Write a program that reads a file named famous.txt and prints out the line with the longest length. In the case of a tie, you may print out only one of them. For example in the file:
Alan Turing
Please help me to modify my java code from php code];
}
}
I tried like this (see below JSP
code) ... but this is not giving me the exact result as the above PHP
code is giving. So
please help me to convert...Modify Java
code from PHP Code i want to covert this php
code int
Please help me to modify my java code from php codePlease help me to modify my java
code from php code i want to covert...) ... but this is not giving me the exact result as the above PHP
code is giving. So
please... same, as they alter it before.
Please help me on this topic "how to order rows
please helpplease help
please send me the
code of dynamic stack in java without using the built in functions
could someone help in this ........could someone
help in this ........ dear Sir/Mrs
I'll be thankful for helping me on this .......
write a program that reads 10 numbers. find the largest number and count the occurrence of the largest number from a declared
please help//please help// Number square cube
1 1 1
3 9 27
5 25 125
7 49 343
9 81 729
total 165 1225
â?? this is the ouput..;;; i
please help//please help// Number square cube
1 1 1
3 9 27
5 25 125
7 49 343
9 81 729
total 165 1225
â?? this is the ouput..;;; i
please help//please help// Number square cube
1 1 1
3 9 27
5 25 125
7 49 343
9 81 729
total 165 1225
â?? this is the ouput..;;; i
help please?help please? Define a class named Circle with the following properties:
â?¢ An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both data fields
help please?help please? Define a class named Circle with the following properties:
List item
â?¢ An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
help please?help please? Define a class named Circle with the following properties:
List item
An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
help please?help please? Define a class named Circle with the following properties:
List item
An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
help please?help please? Define a class named Circle with the following properties:
List item
An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
Please HelpPlease Help How do I create an attribute that represents the following:
A grayscale 'color' value, that is, an integer between 0 and 255 inclusive, where 0
corresponds to the darkest black and 255 to the brightest white
Please HelpPlease Help How do I create an attribute that represents the following:
A grayscale â??colorâ?? value, that is, an integer between 0 and 255 inclusive, where 0
corresponds to the darkest black and 255 to the brightest white
help please file.. Or atleast
help me with
code here.. I tried checking session alive...
help please hi i am done with register application using jsps servlets htmls. But i couldnt imp one thing that.. Wen u login to ur account browser
Please helpPlease help Problem: Write a program that does addition, subtraction, multiplication and division operation on real numbers. The operation started with a user entered 2 numbers and click one of the operation buttons
java please please helpjava
please please help Dear Friends plz
help me to complete this program
import java.util.*;
public class StringDemo {
static...[] to HashMap so that i can seperate key and value using Map.Entry.Please
help me!
help please?help please? Define a class named Circle with the following properties:
? An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both data fields
Please helpPlease help Problem: Write a program that does addition, subtraction, multiplication and division operation on real numbers. The operation started with a user entered 2 numbers and click one of the operation buttons
please helpplease help public class AllContact extends javax.swing.JFrame {
/** Creates new form AllContact */
public AllContact() {
initComponents();
try{
Connection1 con =new Connection1();
Connection conobj
urgent...pleAse help me.....please!urgent...
pleAse help me.....
please!
please help me urgent! how can i do dictionary with the use of array
code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
could any one help me?could any one
help me? I'm a student in the faculty of computer and information science we will make graduation project "taxi dispatcher" we need to use mobile "x6 nokia" in car and send the coordinate of car through gps which
Could someone Possibly help me with this Could someone Possibly
help me with this think of a number and allow the user to guess it
import java.util.*;
public class ThinkNumber...();
}
System.out.println("Correct!!!!!!!");
}
}
But when the
code is run I do
please help me.please help me.
Please send me a
code of template in opencms and its procedure.so i can implement the
code.
Thanks
trinath
please help meplease help me Dear sir, I have a problem. How to write JSP coding... before. This name list should get from the database.
Please help me.
By the way, I'm using access database and jsp
code.
Thank you
please help me.please help me. How to read a properties file in java with a suitable example.
Please send me.
Thanks
Trinath
Please visit the following link:
Java read properties file