You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Benussi <ma...@hotmail.com> on 2005/06/07 08:08:01 UTC

Tomcat Struts form population problem in PRODUCTION

I am submitting a Struts form in my live application but the values seem to
be getting lost between my browser and the population of my ActionForm. This
only happens if the login page is the first request of the session.

 

If you click around on the site (even once) and then submit the form the
values are taken.

 

:S

 

NB This only happens in my live environment (Tomcat 5, LINUX).


Re: Tomcat Struts form population problem in PRODUCTION

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
What I mean by security is, what sort of user authentication? For your 
login, that is. I assume that it's hand-rolled and you're accessing some 
sort of data store to verify the password given by the user.

I'll also assume that you've got the struts-config mapping correct, so 
that the correct formbean is being created for the URL you are 
submitting to, and that the formbean has property getters and setters 
matching the field names.

Could you have 2 instances of your formbean and be using the wrong one?

Could you be submitting twice (due to a freaky HTML mistake) or 
submitting to the wrong URL?

Try debugging the params in the request itself - here's my JSP debug method
<%
out.println("App");
java.util.Enumeration e = 
pageContext.getAttributeNamesInScope(PageContext.APPLICATION_SCOPE);
Object value;
while (e != null && e.hasMoreElements())
{
     String key = (String)e.nextElement();
     value = null;
     if (key != null)
         value = pageContext.getAttribute(key, 
PageContext.APPLICATION_SCOPE);
     out.println(key + ": " + value);
}
out.println("Session");
e = pageContext.getAttributeNamesInScope(PageContext.SESSION_SCOPE);
while (e != null && e.hasMoreElements())
{
     String key = (String)e.nextElement();
     value = null;
     if (key != null)
         value = pageContext.getAttribute(key, PageContext.SESSION_SCOPE);
     out.println(key + ": " + value);
}
out.println("Request");
e = pageContext.getAttributeNamesInScope(PageContext.REQUEST_SCOPE);
while (e != null && e.hasMoreElements())
{
     String key = (String)e.nextElement();
     value = null;
     if (key != null)
         value = pageContext.getAttribute(key, PageContext.REQUEST_SCOPE);
     out.println(key + ": " + value);
}
%>




On 07/06/05 09:19&nbsp;Mark Benussi wrote:
> There is no security implemented.
> 
> When the form is submitted it calls the BeanUtils.populate method.
> 
> With debgging enabled no values are copied into my form on the first 
> submission of the form if the form is within a page that was produced as 
> the result of the first ever session request to a url on the server 
> (phew!).
> 
> 
> ----Original Message Follows----
> From: Adam Hardy <ah...@cyberspaceroad.com>
> Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Tomcat Struts form population problem in PRODUCTION
> Date: Tue, 07 Jun 2005 09:03:32 +0100
> 
> What sort of security are you using? Container-managed? SSL?
> 
> And what exactly do you mean? Which values disappear? The login form 
> fields?
> 
> 
> 
> On 07/06/05 07:08&nbsp;Mark Benussi wrote:
> 
>> I am submitting a Struts form in my live application but the values 
>> seem to
>> be getting lost between my browser and the population of my 
>> ActionForm. This
>> only happens if the login page is the first request of the session.
>>
>>
>>
>> If you click around on the site (even once) and then submit the form the
>> values are taken.
>>
>>
>>
>> :S
>>
>>
>>
>> NB This only happens in my live environment (Tomcat 5, LINUX).
>>
>>
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 


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


Re: Tomcat Struts form population problem in PRODUCTION

Posted by Mark Benussi <ma...@hotmail.com>.
I imaging the JSP must be session aware as the strust tags are included in 
the jsp and compile --> The tags would look for a bean to populate the 
fields.

----Original Message Follows----
From: Emmanouil Batsis <Em...@eurodyn.com>
Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
To: Struts Users Mailing List <us...@struts.apache.org>
Subject: Re: Tomcat Struts form population problem in PRODUCTION
Date: Tue, 07 Jun 2005 12:22:13 +0300

Mark Benussi wrote:

>There is no security implemented.


Is it possible that the JSP is not session aware and thus a session is not 
created to carry the form (and it's fields?)?

---------------------------------------------------------------------
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: Tomcat Struts form population problem in PRODUCTION

Posted by Emmanouil Batsis <Em...@eurodyn.com>.
Mark Benussi wrote:

> There is no security implemented.


Is it possible that the JSP is not session aware and thus a session is 
not created to carry the form (and it's fields?)?

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


Re: Tomcat Struts form population problem in PRODUCTION

Posted by Mark Benussi <ma...@hotmail.com>.
There is no security implemented.

When the form is submitted it calls the BeanUtils.populate method.

With debgging enabled no values are copied into my form on the first 
submission of the form if the form is within a page that was produced as the 
result of the first ever session request to a url on the server (phew!).


----Original Message Follows----
From: Adam Hardy <ah...@cyberspaceroad.com>
Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
To: Struts Users Mailing List <us...@struts.apache.org>
Subject: Re: Tomcat Struts form population problem in PRODUCTION
Date: Tue, 07 Jun 2005 09:03:32 +0100

What sort of security are you using? Container-managed? SSL?

And what exactly do you mean? Which values disappear? The login form fields?



On 07/06/05 07:08&nbsp;Mark Benussi wrote:
>I am submitting a Struts form in my live application but the values seem to
>be getting lost between my browser and the population of my ActionForm. 
>This
>only happens if the login page is the first request of the session.
>
>
>
>If you click around on the site (even once) and then submit the form the
>values are taken.
>
>
>
>:S
>
>
>
>NB This only happens in my live environment (Tomcat 5, LINUX).
>
>


---------------------------------------------------------------------
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: Tomcat Struts form population problem in PRODUCTION

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
What sort of security are you using? Container-managed? SSL?

And what exactly do you mean? Which values disappear? The login form fields?



On 07/06/05 07:08&nbsp;Mark Benussi wrote:
> I am submitting a Struts form in my live application but the values seem to
> be getting lost between my browser and the population of my ActionForm. This
> only happens if the login page is the first request of the session.
> 
>  
> 
> If you click around on the site (even once) and then submit the form the
> values are taken.
> 
>  
> 
> :S
> 
>  
> 
> NB This only happens in my live environment (Tomcat 5, LINUX).
> 
> 


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


Re: Tomcat Struts form population problem in PRODUCTION

Posted by Anto Paul <an...@gmail.com>.
On 6/7/05, Mark Benussi <ma...@hotmail.com> wrote:
> I am submitting a Struts form in my live application but the values seem to
> be getting lost between my browser and the population of my ActionForm. This
> only happens if the login page is the first request of the session.
> 
> 
> 
> If you click around on the site (even once) and then submit the form the
> values are taken.
> 
> 
> 
> :S
> 
> 
> 
> NB This only happens in my live environment (Tomcat 5, LINUX).
> 
> 
> 

Dont crosspost. Is there Apache infront of Tomcat ?. I have noticed
this kind of problem in Tomcat 4.1 + Apache 1.3  combination but
couldn't find the reason.
-- 
rgds
Anto Paul

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