Write this in the action:
public void validate() {
if(!"admin".equals(name)||!"admin".equals(password)){
addActionError("Username or password is incorrect");
}
}
in jsp
<%@ taglib uri="/struts-tags" prefix="s" %>
...
<body>
<s:actionerror/>
</body>
Remember to write this sentence in struts.xml: <result name="input">/login.jsp</result>