Injection parameters
--------------------

                 Key: WW-2942
                 URL: https://issues.apache.org/struts/browse/WW-2942
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.1.4
         Environment: Windows XP SP2, Eclipse 3.4.1, jetty, etc..
            Reporter: Pablo S. Borges


the problem of the form below,

import java.io.Serializable;

public class EUser implements Serializable {

        private String login;
        private String password;
        
        public EUser() {
        }

        public String getLogin() {
                return login;
        }

        public void setLogin(String login) {
                this.login = login;
        }

        public String getPassword() {
                return password;
        }

        public void setPassword(String password) {
                this.password = password;
        }
}


import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport {
        
        private EUser eUser;

        /**
         * 
         * @return
         * @throws Exception
         */
        public String authenticate() throws Exception {
                return SUCCESS;
        }

        public EUser getEUser() {
                return eUser;
        }

        public void setEUser(EUser user) {
                eUser = user;
        }
}

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd";>

<html>
        <head>
                <title>Login</title>
        </head>
        <body>
                <s:form action="User!authenticate" theme="simple"
                        name="frmUserAuthenticate">
                        <h2>
                                Login
                        </h2>
                        <s:textfield name="eUser.login" id="login" 
maxLength="12" size="20" />
                        <h2>
                                Password
                        </h2>
                        <s:password name="eUser.password" id="password" 
maxLength="12"
                                size="20" />
                        <s:submit name="btnAuthenticate"></s:submit>
                </s:form>
        </body>
</html>

----
note that the action I created an attribute with the private eUser get and set 
methods. And in jsp I am referencing this object eUser, only that it does not 
automatically injected and when I give an submit the form.

Now I saw that one possible solution would be to implement the interface 
ModelDrive<EUser> and profiting from eUser jsp. Ai works correctly.

Now I ask this is a bug? Thank you.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to