jeudi 25 février 2016

browser asks to resend data when page is reloaded

I am writing an application using struts2. I am facing a problem in the login part. When a login is performed,it will redirect to the index.jsp page.Now the problem arises. The problem is when after loggin in, index.jsp is reloaded, browser asks me resend data. I dont know why it is happening? here is my struts.xml code for authenticate action:-

<action name="authenticate" class="com.action.LoginAction">  
    <result name="success">index.jsp</result>
    <result name="failure">loginerror.jsp</result> 
</action>

and here is code for the login action class:-

public String execute() {
    if(sessionMap.containsKey("project_user")){
        return "success";
    }

    Project_User project_User=Login.checkCredentials(email_id,password);

    if(project_User!=null) {
        sessionMap.put("project_user", project_User);
        return "success";
    } else
        return "failure";
}

also when index.jsp comes, the url area of browser remians unchanged, the link in url field of browser still shows the action name like:- localhost:8084/Tek-Hub/authenticate/ if anyone knows about it plzzz help me. Thanxx

Aucun commentaire:

Enregistrer un commentaire