You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Pablo S. Borges (JIRA)" <ji...@apache.org> on 2008/12/31 14:28:37 UTC

[jira] Created: (WW-2942) Injection parameters

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.


[jira] Resolved: (WW-2942) Injection parameters

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-2942.
---------------------------------

    Resolution: Not A Problem

Please ask questions on the user mailing list, also, include the mapping for your action which is the only piece missing,

> 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.