« Return to Thread: [auth] Error when I try to do login

Re: [auth] Error when I try to do login

by svetrini :: Rate this Message:

Reply to Author | View in Thread

how do you configure   <form-beans>  in the struts-auth.xml configuration file?
And the form's name in the jsp?



2008/5/10 Rocco Fusella <rfusella@...>:
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
   


2008/5/9 Stefano Vetrini <stvnove@...>:
On Fri, 2008-05-09 at 14:01 +0200, Rocco Fusella wrote:
>
> 13:41:28,343 INFO  [UserAction] login(username = root, password =
> null) - start

I think the problem is there... from the stack trace you send me, I
can't understand why password is nul

bye


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
smartweb-user mailing list
https://lists.sourceforge.net/lists/listinfo/smartweb-user


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
smartweb-user mailing list
smartweb-user@...
https://lists.sourceforge.net/lists/listinfo/smartweb-user



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
smartweb-user mailing list
smartweb-user@...
https://lists.sourceforge.net/lists/listinfo/smartweb-user

 « Return to Thread: [auth] Error when I try to do login