submitting corect user and passowrd, it again comes on login.jsp

submitting corect user and passowrd, it again comes on login.jsp

i am submit username and password in login.jsp, after submit correct username and password, it again come in login.jsp.

Here some files:

Struts.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />

<include file="mypackage.xml"/>

<!-- Add packages here -->

</struts>

mypackage.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

<package name="mypackage" namespace="/" extends="tiles-default">

<action name="Login" class="com.struts2.LoginAction">
<result name="input">/login.jsp</result>
<result name="success">/Home.jsp</result>
<result name="error">/login.jsp</result>
</action>

<action name="customer" class="com.struts2.CustomerAction">
<result name="success" type="tiles">/logged.success.tiles</result>

<result name="input" type="tiles">/index.tiles</result>
</action>

</package>
</struts>

LoginAction.java:
package com.struts2;
import java.sql.*;
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction extends ActionSupport{

private static final long serialVersionUID = 1L;

public String execute() throws Exception {

if (this.username_txt.equals("vijaykumar")
&& this.password_txt.equals("vijaykumar")) {
System.out.println("now going for success********************");
return "success";
} else {
System.out.println("here for error------------------");
addActionError(getText("error.login"));
return "error";
}
}
private String username_txt;
private String password_txt;
public String getPassword_txt() {
return password_txt;
}
public void setPassword_txt(String password_txt) {
this.password_txt = password_txt;
}
public String getUsername_txt() {
return username_txt;
}
public void setUsername_txt(String username_txt) {
this.username_txt = username_txt;
}
}

login.jsp:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Login page</title>
</head>

<body>
<s:form action="Login">
<s:textfield key="username_txt"/>
<s:password key="password_txt" />
<s:submit/>
</s:form>
</body>
</html>

please suggest.
thanks.
View Answers

May 6, 2010 at 4:44 PM

Hi Friend,

Please visit the following link:

http://www.roseindia.net/struts/struts2/struts2login.shtml

Hope that it will be helpful for you.
Thanks









Related Tutorials/Questions & Answers:
submitting corect user and passowrd, it again comes on login.jsp - Struts
submitting corect user and passowrd, it again comes on login.jsp  i am submit username and password in login.jsp, after submit correct username and password, it again come in login.jsp. Here some files: Struts.xml
regarding login.jsp code - Java Beginners
regarding login.jsp code  i tried to implement the login.jsp code example given in roseindia.net. but it is saying invalid loginbean. after compilation. can any pls send me the correct code that implements the login with jsp
Advertisements
jsp page submitting
jsp page submitting  whenever i am submitting the jsp page it downloads some unknown file on tomcat server
There and Back Again
There and Back Again       The weblog of Joshua Eichorn, AJAX, PHP and Open Source Read full DescriptionADS_TO_REPLACE_1
ModuleNotFoundError: No module named 'again'
ModuleNotFoundError: No module named 'again'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'again' How to remove the ModuleNotFoundError: No module named 'again'
ModuleNotFoundError: No module named 'again'
ModuleNotFoundError: No module named 'again'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'again' How to remove the ModuleNotFoundError: No module named 'again'
STACK - WHY THE OUTPUT COMES LIKE THIS?
STACK - WHY THE OUTPUT COMES LIKE THIS?  //: holding/StackTest.java import net.mindview.util.*; public class StackTest { public static void main... has dog My WHY THE OUTPUT COMES LIKE
What comes after big data?
What comes after big data?  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: What comes... learn the topic "What comes after big data?". Also tell me which
Submitting Web site to search engine
;ADS_TO_REPLACE_1 Before submitting your web site to search please... search engines manually or use professional paid services for submitting your
again java - Java Beginners
again java  i will ask iam using servlets ,in one program my requirement is if there is a image(if u like) in anywhere and we browse that image... to the user UPLOAD THE FILE   Choose the file To Upload:  
again java - Java Beginners
again java  Hi, i will ask iam using servlets ,in one program my requirement is if there is a image(if u like) in anywhere and we browse... to the user UPLOAD THE FILE   Choose the file To Upload
escaping user input in php
escaping user input in php  Is it possible to escape the user input while submitting data into database in PHP
how to genrate login id and password after submitting the sign up form?
how to genrate login id and password after submitting the sign up form?  i m working on a online voting project in that i have a user sign up form so i want 2 knw that after user submit all the details i that sign up form than
How to prevent the page refresh while submitting the form??
How to prevent the page refresh while submitting the form??  Hi. Requirement: There are two drop down boxes.Dropdown2 should load corresponding to the select of Dropdown1. Im hitting a db for this every time.Hence the page loads
again with xml - XML
again with xml  hi all i am a beginner in xml so pls give me the details regarding the methods used in it. wat will return the methods getElementsByTagName(), getChildNodes(), getParentNode(), nextSibling(),etc and when
Not Submitting Data - Design concepts & design patterns
Not Submitting Data  Hello Deepak , Thanks for replying me....but m not understanding ur code my problems is on designing web site.I am designing a website and in that there is one feedback form when we submit a form
java again - Date Calendar
java again  I can't combine your source code yesterday, can you help me again. My problem is how we get result jtextfield2 from if jtexfield1 we enter(jTextfield keypressed) then the result out to jTextfield2, This my jFrame
ModuleNotFoundError: No module named 'lambada-again'
ModuleNotFoundError: No module named 'lambada-again'  Hi, My... 'lambada-again' How to remove the ModuleNotFoundError: No module named 'lambada-again' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'lambada-again'
ModuleNotFoundError: No module named 'lambada-again'  Hi, My... 'lambada-again' How to remove the ModuleNotFoundError: No module named 'lambada-again' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'lambada-again'
ModuleNotFoundError: No module named 'lambada-again'  Hi, My... 'lambada-again' How to remove the ModuleNotFoundError: No module named 'lambada-again' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'n-again'
ModuleNotFoundError: No module named 'n-again'  Hi, My Python...-again' How to remove the ModuleNotFoundError: No module named 'n-again... to install padas library. You can install n-again python with following command
ModuleNotFoundError: No module named 'nested_again'
ModuleNotFoundError: No module named 'nested_again'  Hi, My Python... 'nested_again' How to remove the ModuleNotFoundError: No module named 'nested_again' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'showit-again'
ModuleNotFoundError: No module named 'showit-again'  Hi, My Python... 'showit-again' How to remove the ModuleNotFoundError: No module named 'showit-again' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'testpay-again'
ModuleNotFoundError: No module named 'testpay-again'  Hi, My... 'testpay-again' How to remove the ModuleNotFoundError: No module named 'testpay-again' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'testpay-again'
ModuleNotFoundError: No module named 'testpay-again'  Hi, My... 'testpay-again' How to remove the ModuleNotFoundError: No module named 'testpay-again' error? Thanks   Hi, In your python
matching database again - Java Beginners
matching database again  Dear experts, So happy I get through this ask a question page again. Thank God. I want to say "A BIG THANK YOU" for helping me about the matching codes. It is working now after fine tuning
Problem submitting a struts form containing a dojo script - Struts
Problem submitting a struts form containing a dojo script  Hello there, Is there any way to make use of dojo with struts 1 ? Actually, I'm facing a problem submitting a struts form containing a dojo script for a dynamic
Read data again - Java Beginners
Read data again  sir, i still hav a problem,first your code will be change like this : in netbeans out message error 5. Can you help me again. My database like my question before.Can you fix and find the problem in my code
Read data again - Java Beginners
Read data again  Hey, i want to ask again about how to read data from txt, My DB: kd_div varchar(15), nm_div varchar(30), dep varchar(25), jab varchar(35), cab varchar(15), ket varchar(30) My data in txt file is://i
Hi..Again Doubt .. - Java Beginners
Hi..Again Doubt ..  Thank u for ur Very Good Response...Really great.. i have completed that.. If i click the RadioButton,,ActionListenr should get call. It should add to the MS Acess table..Plz check this out.... hope u ill
doesnt run again - Java Beginners
the soltion   Hi I am sending u again the code, this code run in my
User Module
User Module The user first need to make registration on the website... the java language test paper. After submitting the test paper he views the result. User does the following task Login to the application ADS_TO_REPLACE_1
Hi .Again me.. - Java Beginners
Hi .Again me..  Hi Friend...... can u pls send me some code on JPanel.. JPanel shoul have 1pic 1RadioButton .. Like a Voter List... REsponse me..  Hi friend, import java.io.*; import java.awt.
ModuleNotFoundError: No module named 'make-figures-great-again'
ModuleNotFoundError: No module named 'make-figures-great-again'  Hi...: No module named 'make-figures-great-again' How to remove the ModuleNotFoundError: No module named 'make-figures-great-again' error? Thanks  
ModuleNotFoundError: No module named 'testing-python-again'
ModuleNotFoundError: No module named 'testing-python-again'  Hi...: No module named 'testing-python-again' How to remove the ModuleNotFoundError: No module named 'testing-python-again' error? Thanks   Hi
ModuleNotFoundError: No module named 'testing-python-again'
ModuleNotFoundError: No module named 'testing-python-again'  Hi...: No module named 'testing-python-again' How to remove the ModuleNotFoundError: No module named 'testing-python-again' error? Thanks   Hi
if there is an invalid entry in html:file control then form is not submitting. - Struts
if there is an invalid entry in html:file control then form is not submitting.  Hi, I have used html:file to upload the files. this is working fine in all the cases expect one usecase. 1) click on browse button and select
Drop Down Reloads again in IE..How to prevent this?
Drop Down Reloads again in IE..How to prevent this?  Hi i was using two drop down box..One for Displaying date followed by another for Dispalying Month..If i Select/Change Month from the 2nd drop down then the 1st drop down
user validation
user validation  i hv just started with my lessons in jsp n also doin...(); } } /* if(userName.equals(request.getParameter("user")) &amp;&...("")) { out.println("&lt;a href="login.jsp"&gt;&lt;b&gt;Login &lt
Plz chk it and reply again - Java Beginners
Plz chk it and reply again  Hi Deepak, Thanks for fast reply,your application is good,u write this code for user click the view database.... But I want user input in name textbox like that a then click search all
After Logout Back Button Should not work again
be creating session and adding some attribute during login process of user. Please
help again plz sorry - Java Beginners
help again plz sorry  Thanks for giving me thread code but i have a question this code is comletelly right and i want to make it runs much faster for that i made 5 threads but 2 things i dont understand 1- with one
Design a registration.jsp page with input for user registration details
Design a registration.jsp page with input for user registration details  Design a registration.jsp page with input for user registration details like... submitting this details, display the details onto the display.jsp page using
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?
time again it doesnt call it. Why..?  **struts.xml** <?xml version...;result>/pages/sms/login.jsp</result> </action> <...; <result >/pages/sms/login.jsp</result> <
Script on the page used too much memory. Reload to enable script again.
Script on the page used too much memory. Reload to enable script again. ... to enable script again". After getting this error other pages also not working. Logout and login again not working. if open the new tab then only working other
user in mysql
user in mysql  how to create user in mysql?   Please visit the following link: http://www.roseindia.net/mysql/mysql5/mysql-creating-account.shtml (adsbygoogle = window.adsbygoogle || []).push
the last data entered into database is getting stored again after refreshing
the last data entered into database is getting stored again after refreshing  hey all i made a shout box using php and mysql but the last data entered into the DB is getting retrieved again as i refresh the page.. even
user registration
user registration  hi frnds...am working on a project in JSP.i want to create a user registration form with username,password,mail id and check box option for community selection.once the details are registered i want to save
How to display data fom MySQL DataBase-table in to JSP file by submitting a value in combobox.
How to display data fom MySQL DataBase-table in to JSP file by submitting a value in combobox.   I have the same problem.plz help me. I have MySQL DataBase/DB Name:lokesh; Table Name:TR_list; columns:nodename,packageno,TR
hi again - Java Beginners

Ads