code not working properly
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);
}
}
in the above code if i enter a valid username and password i am redirected to the correct page but if i enter an invalid details at the first attempt i am redirected to the correct page but after that if i again try to login using either the correct or incorrect details i am not directed to the proper page.. please help....
View Answers
Related Tutorials/Questions & Answers:
code not working properlycode not
working properly protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException...);
}
}
in the above
code if i enter a valid username and password i am
Code not workingCode not working i want to write my first applet. I wrote the java program and html
code for that. while im running in appletviewer it is asking for security permissions. so, i created a policy file and linked it with html file
Advertisements
Why is this code workingWhy is this
code working Looking at this piece of
code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _point{
int x;
int y;
} point;
int main (void)
{
point *ptr;
point obj
My Servlet code not working - Development processMy Servlet
code not working HHi,
After executing servlet am getting blank screen. Am using weblogic server and Eclipse editor. But jsp is
working fine.
Steps(what i did )
1)Created servlet (In eclipse) and export it (saved
calender working in struts - Strutscalender
working in struts when i execute the following
code ,that is
working properly
if i convert to struts html tags that
code is not
working
please help me to rectify the problem
output not coming properly - JSP-Servletoutput not coming properly I am not getting the output
properly when i had written my
code like below:
Add Employee Details
for( j=0;j<11;j++)
{
out.println("Department
code Datagrid not workingDatagrid not working The
code here is
working fine, apart from the fact that that I'm using netbeans 6.5 and the servlet v2.5 and struts 1.1....
working. please help me out
htpasswd working htpasswd
working hii,
What does htpasswd do?
hello,ADS_TO_REPLACE_1
htpasswd creates a new user in a specified group, and asks to specify a password for that user
html dropdown not working firefoxhtml dropdown not
working firefox I am writing a Dropdown
code in HTML which is not
working in firefox. What could be the reason as it's perfectly
working in IE and Crome.
Thanks
Why this is not working...?Why this is not
working...? import java.util.*;
public class Family {
int size_of_family=0;
public Person[] members=new Person[size_of_family...);
f.printOutFamily();
}
}
Post the
code of Student.java
Dynamic-update not working in Hibernate.Dynamic-update not
working in Hibernate. Why is dynamic update not
working in hibernate?
Dynamic-update is not
working. It means when... am giving you a small block of
code for updating of employee detail-
public
Nitobi Grid is not working in IE10/IE11Nitobi Grid is not
working in IE10/IE11 Nitobi grid is
working in IE8, but not
working in IE10/IE11.
we are using above two javascript files to open the grid
ModuleNotFoundError: No module named 'working'ModuleNotFoundError: No module named '
working' Hi,
My Python... '
working'
How to remove the ModuleNotFoundError: No module named '
working... to install padas library.
You can install
working python with following command
ModuleNotFoundError: No module named 'working'ModuleNotFoundError: No module named '
working' Hi,
My Python... '
working'
How to remove the ModuleNotFoundError: No module named '
working... to install padas library.
You can install
working python with following command
ModuleNotFoundError: No module named 'working'ModuleNotFoundError: No module named '
working' Hi,
My Python... '
working'
How to remove the ModuleNotFoundError: No module named '
working... to install padas library.
You can install
working python with following command
Working Example for Spring AOP - SpringWorking Example for Spring AOP Hi All,
I need a complete
working Java example /
Code/Logic for Spring -Aspect Oriented Programming.
Code provided will be highly appreciated.
--
Deepak Lal
php <? ?> tag not workingphp tag not working why PHP tags not
working in my application?
This might happen when your shortopentag is turned off. So, you...("shortopen_tag", 1); in your
code;
add the following line to your .htaccess file
r set working directoryr set
working directory Hi,
How to set
working directory in r.... There are command to set the
working directory in R.
Working directory is the base... project.
After setting
working directory you can load data files without providing
Sql querry not working of slabs.
CBID is cutblock ID.
My
code:
ResultSet rc=st.executeQuery("select... should get ROWCOUNT:1
For the first two times my query is getting executed
properly window.open() not working - Ajax is that the pop up window is not at all
working.. Once I click the button, the page... I went wrong, in the above piece of
code..
Regards,
Ragavendran.R
CodeCode
code for connecting c lang to database
code code
how to write this in java
codecode
code for android sample program
codecode please provide
code for custom tags.by using currdate tag we need to get current date?please give me
code code code hi
I need help in creating a java
code that reminds user on a particular date about their festival.
i have no clue of how to do it..
am looking forward to seek help from you
code the correct
code for a program.The output of the program is listed below...: {Block 5}
ADDRESS-3: {San Juan}
POST
CODE:{6745}
ENTER
CODE (XX TO stop)
CODE:{FF1}
QUANTITY:{2}
CODE:{TR4}
QUANTITY:{1}
CODE:XX
INVOICE FOR YOUR ORDER
Harry
code code to create the RMI
client on the local machine:
import java.rmi.*;
public... : "+e);
}
}
}
However, when the preceding
code is executed it results... the correct
code Working of POS TerminalWorking of POS Terminal Hi there, thanks for this post. Just curious how actual POS terminal will interact with PHP. PHP doesn't provide hardware interaction.
Thanks for reply.
Regards.
(adsbygoogle
UIWebView zoom not workingUIWebView zoom not working Hi,
I don't know why UIWebView zoom not
working? Tell the solution.
Thanks
Hi,
Open the .xib file and set scalesPageToFit to YES.
Thanks
codecode i have four textboxes.whenever i click on up,down,left or down arrows then the cursor move to another textbox based on the key pressed.i want
code for this in javascript
code line of
code to print the amount he should be paid as allowance