You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wendy Smoak <We...@asu.edu> on 2003/11/19 17:45:22 UTC

Improvements on an old Struts app

I gather that this is frowned upon:
      <forward name="resolution"      path="/resolveName.do" />

However, when I wrote the app, I couldn't find a way around it.  The
flow is that you type a name in field 1 on form A, you get a list of
possible matches, and you pick one and return to form A which inserts
that name in field 1.  

The complication is that there are multiple fields on form A that need
this behavior.  And then there's form B and C that also need to use this
name resolution.

I had to resort to sticking String in request scope and using that as
the target of the resolution form (which isn't a Struts form):
<form action="<c:out value="${returnTo}"/>" method="POST">

I'm using a recent nightly build.  Is there anything in there that can
solve the "go back where you came from" problem?  And once you get back
where you came from, I also need to know which field you were trying to
resolve.

If it sounds like a mess, it is!  (But it's working...)

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM 

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


Re: Improvements on an old Struts app

Posted by Vic Cekvenich <ce...@baseBeans.com>.
You know in Struts you could submit on entering a field to get your 
options, but you did not do that I assume for good reasons.

Let me try this as a stab:

Please read this:
http://jibbering.com/2002/4/httprequest.html
section on "Calling a server-side Script without refreshing the page"

Then once you understand that, this: 
http://www-106.ibm.com/developerworks/library/wa-resc/?dwzone=web or 
other similar, even XML-RPC via .js.

So I would design this is:
Type in a field.
.js calls to get a list for an options sellection
And capture the selection.

Of course since you need to do this a few times, you can write some 
helper reusable methods.
The form saves should still be done in Strtus.

.V


Wendy Smoak wrote:
> I gather that this is frowned upon:
>       <forward name="resolution"      path="/resolveName.do" />
> 
> However, when I wrote the app, I couldn't find a way around it.  The
> flow is that you type a name in field 1 on form A, you get a list of
> possible matches, and you pick one and return to form A which inserts
> that name in field 1.  
> 
> The complication is that there are multiple fields on form A that need
> this behavior.  And then there's form B and C that also need to use this
> name resolution.
> 
> I had to resort to sticking String in request scope and using that as
> the target of the resolution form (which isn't a Struts form):
> <form action="<c:out value="${returnTo}"/>" method="POST">
> 
> I'm using a recent nightly build.  Is there anything in there that can
> solve the "go back where you came from" problem?  And once you get back
> where you came from, I also need to know which field you were trying to
> resolve.
> 
> If it sounds like a mess, it is!  (But it's working...)
> 




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