You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by xianwinwin <xi...@gmail.com> on 2008/04/02 21:17:28 UTC

rrrrr...why my field returns null????

Can anyone advise why my bean is null.

I have the following jsp page:

<html>
<head>
    <s:head theme="ajax"/> 
</head>
<body>
   
<s:form 		
		theme="ajax"
		id="myForm"
		cssStyle="font-size :	8pt; font-family: verdana" 
		action="notes_insert" 
		method="post" >

	<s:textarea rows="5" cols="60" name="str" label="Add Note"
required="true"/>

	
	<s:submit  align="center"  targets="myForm" theme="ajax"/> 	
	
</s:form>

when the user cllicks submit - the action 'insert' kicksin but the bean
(Note) is null (yes, i have getter and setter)




//action
@Validation
public class NoteAction extends BaseSupport implements Serializable
{		
	private String str;
	
	 
	@SkipValidation
	public String insert()
	{    		
		System.out.println("the value is "+ str);
	}


	public String getStr()
	{
		return str;
	}

	public void setStr(String str)
	{
		this.str = str;
	}
}

-- 
View this message in context: http://www.nabble.com/rrrrr...why-my-field-returns-null-----tp16449038p16449038.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: rrrrr...why my field returns null????

Posted by xianwinwin <xi...@gmail.com>.
I checked it on both IE7 and FireFox - no error on the js and the value is
NULL

any idea?!?!




Laurie Harper wrote:
> 
> If it works without theme set to ajax, it's probably a client-side 
> issue. What browser are you using? Are there any Javascript errors
> reported?
> 
> L.
> 
> xianwinwin wrote:
>> thank you Laurie for your reply.
>> 
>> I made a type - its str not the Note. so the str is null :-(
>> 
>> when I remove the theme="ajax" it works fine. BUT I need it there (the
>> idea
>> that the form will disappear once the action is completed).
>> 
>> how do I get the value of the str? rrrrrr :-(
>> I've been trying different variation - nothing! 
>> 
>> thanks for any pointer!  
>> 
>> 
>> 
>> Laurie Harper wrote:
>>> Your action doesn't have a bean of name/type Note, it only has a single 
>>> String property 'str'. Did you mean this property is not being set? From 
>>> the code you've included, it should be set from the textfield so you 
>>> must have something configured wrong. What does your action mapping look 
>>> like? Are you using the default interceptor stack or have you specified 
>>> a different one?
>>>
>>> L.
>>>
>>> xianwinwin wrote:
>>>> Can anyone advise why my bean is null.
>>>>
>>>> I have the following jsp page:
>>>>
>>>> <html>
>>>> <head>
>>>>     <s:head theme="ajax"/> 
>>>> </head>
>>>> <body>
>>>>    
>>>> <s:form 		
>>>> 		theme="ajax"
>>>> 		id="myForm"
>>>> 		cssStyle="font-size :	8pt; font-family: verdana" 
>>>> 		action="notes_insert" 
>>>> 		method="post" >
>>>>
>>>> 	<s:textarea rows="5" cols="60" name="str" label="Add Note"
>>>> required="true"/>
>>>>
>>>> 	
>>>> 	<s:submit  align="center"  targets="myForm" theme="ajax"/> 	
>>>> 	
>>>> </s:form>
>>>>
>>>> when the user cllicks submit - the action 'insert' kicksin but the bean
>>>> (Note) is null (yes, i have getter and setter)
>>>>
>>>>
>>>>
>>>>
>>>> //action
>>>> @Validation
>>>> public class NoteAction extends BaseSupport implements Serializable
>>>> {		
>>>> 	private String str;
>>>> 	
>>>> 	 
>>>> 	@SkipValidation
>>>> 	public String insert()
>>>> 	{    		
>>>> 		System.out.println("the value is "+ str);
>>>> 	}
>>>>
>>>>
>>>> 	public String getStr()
>>>> 	{
>>>> 		return str;
>>>> 	}
>>>>
>>>> 	public void setStr(String str)
>>>> 	{
>>>> 		this.str = str;
>>>> 	}
>>>> }
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/rrrrr...why-my-field-returns-null-----tp16449038p16491758.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: rrrrr...why my field returns null????

Posted by Laurie Harper <la...@holoweb.net>.
If it works without theme set to ajax, it's probably a client-side 
issue. What browser are you using? Are there any Javascript errors reported?

L.

xianwinwin wrote:
> thank you Laurie for your reply.
> 
> I made a type - its str not the Note. so the str is null :-(
> 
> when I remove the theme="ajax" it works fine. BUT I need it there (the idea
> that the form will disappear once the action is completed).
> 
> how do I get the value of the str? rrrrrr :-(
> I've been trying different variation - nothing! 
> 
> thanks for any pointer!  
> 
> 
> 
> Laurie Harper wrote:
>> Your action doesn't have a bean of name/type Note, it only has a single 
>> String property 'str'. Did you mean this property is not being set? From 
>> the code you've included, it should be set from the textfield so you 
>> must have something configured wrong. What does your action mapping look 
>> like? Are you using the default interceptor stack or have you specified 
>> a different one?
>>
>> L.
>>
>> xianwinwin wrote:
>>> Can anyone advise why my bean is null.
>>>
>>> I have the following jsp page:
>>>
>>> <html>
>>> <head>
>>>     <s:head theme="ajax"/> 
>>> </head>
>>> <body>
>>>    
>>> <s:form 		
>>> 		theme="ajax"
>>> 		id="myForm"
>>> 		cssStyle="font-size :	8pt; font-family: verdana" 
>>> 		action="notes_insert" 
>>> 		method="post" >
>>>
>>> 	<s:textarea rows="5" cols="60" name="str" label="Add Note"
>>> required="true"/>
>>>
>>> 	
>>> 	<s:submit  align="center"  targets="myForm" theme="ajax"/> 	
>>> 	
>>> </s:form>
>>>
>>> when the user cllicks submit - the action 'insert' kicksin but the bean
>>> (Note) is null (yes, i have getter and setter)
>>>
>>>
>>>
>>>
>>> //action
>>> @Validation
>>> public class NoteAction extends BaseSupport implements Serializable
>>> {		
>>> 	private String str;
>>> 	
>>> 	 
>>> 	@SkipValidation
>>> 	public String insert()
>>> 	{    		
>>> 		System.out.println("the value is "+ str);
>>> 	}
>>>
>>>
>>> 	public String getStr()
>>> 	{
>>> 		return str;
>>> 	}
>>>
>>> 	public void setStr(String str)
>>> 	{
>>> 		this.str = str;
>>> 	}
>>> }
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
> 


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


Re: rrrrr...why my field returns null????

Posted by xianwinwin <xi...@gmail.com>.
thank you Laurie for your reply.

I made a type - its str not the Note. so the str is null :-(

when I remove the theme="ajax" it works fine. BUT I need it there (the idea
that the form will disappear once the action is completed).

how do I get the value of the str? rrrrrr :-(
I've been trying different variation - nothing! 

thanks for any pointer!  



Laurie Harper wrote:
> 
> Your action doesn't have a bean of name/type Note, it only has a single 
> String property 'str'. Did you mean this property is not being set? From 
> the code you've included, it should be set from the textfield so you 
> must have something configured wrong. What does your action mapping look 
> like? Are you using the default interceptor stack or have you specified 
> a different one?
> 
> L.
> 
> xianwinwin wrote:
>> Can anyone advise why my bean is null.
>> 
>> I have the following jsp page:
>> 
>> <html>
>> <head>
>>     <s:head theme="ajax"/> 
>> </head>
>> <body>
>>    
>> <s:form 		
>> 		theme="ajax"
>> 		id="myForm"
>> 		cssStyle="font-size :	8pt; font-family: verdana" 
>> 		action="notes_insert" 
>> 		method="post" >
>> 
>> 	<s:textarea rows="5" cols="60" name="str" label="Add Note"
>> required="true"/>
>> 
>> 	
>> 	<s:submit  align="center"  targets="myForm" theme="ajax"/> 	
>> 	
>> </s:form>
>> 
>> when the user cllicks submit - the action 'insert' kicksin but the bean
>> (Note) is null (yes, i have getter and setter)
>> 
>> 
>> 
>> 
>> //action
>> @Validation
>> public class NoteAction extends BaseSupport implements Serializable
>> {		
>> 	private String str;
>> 	
>> 	 
>> 	@SkipValidation
>> 	public String insert()
>> 	{    		
>> 		System.out.println("the value is "+ str);
>> 	}
>> 
>> 
>> 	public String getStr()
>> 	{
>> 		return str;
>> 	}
>> 
>> 	public void setStr(String str)
>> 	{
>> 		this.str = str;
>> 	}
>> }
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/rrrrr...why-my-field-returns-null-----tp16449038p16461868.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: rrrrr...why my field returns null????

Posted by Laurie Harper <la...@holoweb.net>.
Your action doesn't have a bean of name/type Note, it only has a single 
String property 'str'. Did you mean this property is not being set? From 
the code you've included, it should be set from the textfield so you 
must have something configured wrong. What does your action mapping look 
like? Are you using the default interceptor stack or have you specified 
a different one?

L.

xianwinwin wrote:
> Can anyone advise why my bean is null.
> 
> I have the following jsp page:
> 
> <html>
> <head>
>     <s:head theme="ajax"/> 
> </head>
> <body>
>    
> <s:form 		
> 		theme="ajax"
> 		id="myForm"
> 		cssStyle="font-size :	8pt; font-family: verdana" 
> 		action="notes_insert" 
> 		method="post" >
> 
> 	<s:textarea rows="5" cols="60" name="str" label="Add Note"
> required="true"/>
> 
> 	
> 	<s:submit  align="center"  targets="myForm" theme="ajax"/> 	
> 	
> </s:form>
> 
> when the user cllicks submit - the action 'insert' kicksin but the bean
> (Note) is null (yes, i have getter and setter)
> 
> 
> 
> 
> //action
> @Validation
> public class NoteAction extends BaseSupport implements Serializable
> {		
> 	private String str;
> 	
> 	 
> 	@SkipValidation
> 	public String insert()
> 	{    		
> 		System.out.println("the value is "+ str);
> 	}
> 
> 
> 	public String getStr()
> 	{
> 		return str;
> 	}
> 
> 	public void setStr(String str)
> 	{
> 		this.str = str;
> 	}
> }
> 


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