struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Jackson" <joshua.j...@gmail.com>
Subject Struts2: Create instance from struts form
Date Mon, 10 Sep 2007 04:55:15 GMT
Dear all,

I'm trying to create an instance from struts form as such:
<s:textfield name="#member.name" label="%{getText('name')}" />

I am expecting that the member instance is created by the form so I
can use it in Action as such:

private Member member;
	
	private String name;
		
	public String create() throws Exception
	{
		logger.debug("Inside create");
		logger.info("Member name = " + member.getName());
		
		return SUCCESS;
	}

	public Member getMember()
	{
		return member;
	}

	public void setMember(Member member)
	{
		this.member = member;
	}


I already have the member configured in spring as such:
    <bean id="member" class="com.taxandtech.projexion.model.Member"
scope="prototype"/>

    <bean id="memberAction"
class="com.taxandtech.projexion.web.MemberAction" scope="prototype">
    	<property name="member" ref="member"/>
    </bean>

But still the member can not be called from struts2 action. Is this
possible to do in struts2? If it does, can somebody help me giving me
hints on what I have missed.

Thanks in advance

-- 
It's not just about coding, it's a matter of fulfilling your core being

YM!: thejavafreak
Blog: http://joshuajava.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message