Action class:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import com.opensymphony.xwork2.ActionSupport;
import
java.util.Date;
/**
* <p> Validate a user login. </p>
*/
public class Login extends ActionSupport {
public
String execute() throws Exception
{
System.out.println("Validating login");
if(!getUsername().equals("Admin") || !getPassword().equals("Admin"))
{
addActionError("Invalid user name or password! Please try again!");
return ERROR;
}
else
{
return SUCCESS;
}
}
// ---- Username property ----
/**
* <p>Field to store User username.</p>
* <p/>
*/
private String username = null;
/**
* <p>Provide User username.</p>
*
* @return Returns the User username.
*/
public String getUsername() {
return username;
}
/**
* <p>Store new User username</p>
*
* @param value The username to set.
*/
public void setUsername(String value) {
username = value;
}
// ---- Username property ----
/**
* <p>Field to store User password.</p>
* <p/>
*/
private String password = null;
/**
* <p>Provide User password.</p>
*
* @return Returns the User password.
*/
public String getPassword() {
return password;
}
/**
* <p>Store new User password</p>
*
* @param value The password to set.
*/
public void setPassword(String value) {
password = value;
}
}
******************************************************
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>
<package name="default" extends="struts-default">
<action name="login">
<result>login.jsp</result>
</action>
<action name="doLogin" class="Login">
<result name="input">/login.jsp</result>
<result name="error">/login.jsp</result>
<result>/loginsuccess.jsp</result>
</action>
</package>
</struts>
********************************************************
Login.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Struts 2 Login Application!</title>
<s:head theme="ajax"/>
<link href="<s:url value="/css/main.css"/>" rel="stylesheet" type="text/css"/>
</head>
<body>
<s:tabbedPanel id="rtb">
<s

iv id="1" label="Administration" theme="ajax" labelposition="top">
<br>RTB Administration
</s

iv>
<s

iv id="admin" label="User" theme="ajax" href="setProfile.action"
refreshOnShow="true">
hjhfsjkdh
</s

iv>
<s

iv id="prov" label="Provisioning" theme="ajax">
fafdsfas
</s

iv>
</s:tabbedPanel>
</body>
</html>
********************************************************888
web.xml:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
******************************************************************
And jar files have been included under my WEB-INF/lib.....
1. struts-2.0.11-core.jar, freemarker-2.3.8.jar, common-logging1.1.jar,ognl-2.6.11.jar,xwork-2.0.4.jar
Please im wasting more than a week, but before also i was facing this error 'dojo is not defined', but for my friend he is working in 'LINUX' machine and for him it is working fine and when i got the same project from him and ran it in my machine it is working fine and im not sure what i have changed in it, now it is not working. Very very urgent Ahmeed.
Looking forward for your reply.
Thanks.