I
maybe something wrong in configuration files or something in jsp page
or code. The strange thing I noticed is that the object form in Action is null.
In fact the exception was launched in the code of auth at this point " credential.setUsername((String) dform.get("username"));" where the object dform is null.
DynaActionForm dform = (DynaActionForm) form;
if (!this.logout(form, request, response, mapping).equals("success")) return failure;
logger.info("login(username = " + request.getParameter("username") + ", password = "
+ request.getParameter("secret") + ") - start");
Credentials credential = new Credentials();
//super.valorize(form, credential, request.getLocale());
credential.setUsername((String) dform.get("username"));
credential.setSecret((String) dform.get("secret"));
I send you my configuration files, jsp and class action because I certainly something wrong in configurations.
STRUTS FILE
<action path="/login" parameter="login" type="net.smartlab.web.auth.UserAction" input="/italiano/login.jsp">
<forward name="success" path="/italiano/area_riservata.do" redirect="true" contextRelative="true"/>
<forward name="failure" path="/home.html" redirect="false" contextRelative="true"/>
</action>
JSP FILE LOGIN.JSP
<%@page contentType="text/html; charset=iso-8859-1" language="java" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/smart-auth.tld" prefix="auth" %>
<%@taglib uri="/WEB-INF/smartweb.tld" prefix="page"%>
<head>
<title>..:: FUDA ::..</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<BODY>
<p class="voci">Area riservata</p>
<form action="<%= request.getContextPath() %>/forward.do?prefix=/auth&page=/login.do" method="post">
<fieldset>
<p>
<label class="field" for="username">User:</label>
<input id="username" class="field" type="text" maxlength="20" name="username"/>
<label class="field" for="password">Password:</label>
<input id="secret" class="field" type="password" maxlength="20" tabindex="2" name="secret"/>
<input class="button" type="submit" value="Login"/>
</p>
</fieldset>
</form>
</BODY>
</HTML>
thank you
Rocco