You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcus Biel <Ma...@bmw.de> on 2002/11/07 09:51:31 UTC

how to delete ActionForm ?

I got an "AddRecord.jsp", "AddRecordAction" and "AddRecordForm"
and last but not least an "ShowAddedRecord.jsp" that displays the record
that was added.
When I added a new record to database, I want to forward to the same
jsp, "AddRecord.jsp", so that the user can add further records.
The problem now is that
a) If I set this Action to scope="request", I can't redisplay the record
if I set it to scope="session", 
b)when I forward to the same page again, "AddRecord.jsp" all field are
filled witht the values of the old record.
c) When I set value of the form to value="" it works, but when an error
occurrs and the validate method gets called,
all fields are left blank instead of filled.
d) redirecting neither helped, because I am not using an action on the
last page, just a link to the first page.

Have you got a better solution ?
Someone suggested to delete the form, but I don't know how to do this /
guess it won't work / or wouldn't be following the mvc design to
delete the form on jsp.


thx in advance,

marcus

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how to delete ActionForm ?

Posted by Postfach 4711 <po...@gmx.de>.
Hello Marcus,

Thursday, November 7, 2002, 9:51:31 AM, you wrote:

MB> I got an "AddRecord.jsp", "AddRecordAction" and "AddRecordForm"
MB> and last but not least an "ShowAddedRecord.jsp" that displays the record
MB> that was added.
MB> When I added a new record to database, I want to forward to the same
MB> jsp, "AddRecord.jsp", so that the user can add further records.
MB> The problem now is that
MB> a) If I set this Action to scope="request", I can't redisplay the record
I always prefer to use request scope. So:
What exactly do you mean by 'I can't redisplay the record'?

MB> if I set it to scope="session", 
MB> b)when I forward to the same page again, "AddRecord.jsp" all field are
MB> filled witht the values of the old record.
MB> c) When I set value of the form to value="" it works, but when an error
MB> occurrs and the validate method gets called,
MB> all fields are left blank instead of filled.
MB> d) redirecting neither helped, because I am not using an action on the
MB> last page, just a link to the first page.

MB> Have you got a better solution ?
MB> Someone suggested to delete the form, but I don't know how to do this /
MB> guess it won't work / or wouldn't be following the mvc design to
MB> delete the form on jsp.
I have never heard of this.

MB> thx in advance,

MB> marcus

MB> --
MB> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
MB> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
Dirk


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>