RE: Feature request

2001-04-23 Thread Craig R. McClanahan



On Mon, 23 Apr 2001, Nanduri, Amarnath wrote:

> One thing you can do is use a  tag which contains the name of the jsp
> page. When you submit to the same action, and when you want to show errors
> to the input page, get this value out of the  tag and forward to that
> page.
> 
> I would strongly suggest you use a separate action class for every jsp .
> That way it woule be easier to maintain and debug. 
> If you think all the pages perform almost the same action(s) i would suggest
> you use an inheritance mechanism.
> 

You can actually have it both ways ...

It is entirely legal to have more than one  element that uses the
same Action class for the "type" attribute.  Then, you still get the
benefits of having all the code in one place, but you can also configure
the "input" attribute of each  individually.

If you do this, the standard validation performed by Struts will return to
the corret input page, *and* you can do so programmatically from within
the common Action by saying:

String inputPath = mapping.getInput();
return (new ActionForward(inputPath));

> cheers,
> Amar..
> 
Craig




RE: Feature request

2001-04-23 Thread Nanduri, Amarnath

One thing you can do is use a  tag which contains the name of the jsp
page. When you submit to the same action, and when you want to show errors
to the input page, get this value out of the  tag and forward to that
page.

I would strongly suggest you use a separate action class for every jsp .
That way it woule be easier to maintain and debug. 
If you think all the pages perform almost the same action(s) i would suggest
you use an inheritance mechanism.

cheers,
Amar..

-Original Message-
From: alex [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 2:26 AM
To: [EMAIL PROTECTED]
Subject: Re: Feature request


hi all. 

i wonder who can help me resolve this problem.
i am making a program based on struts.
there are some circumstances that serval pages invoke one same
action. and if some errors occured i want to show these errors in 
the previous page, but i cannot judge where the page is, cuz,
there are many pages can invoke this action.



thanks alot

redbeebird.



Re: Feature request

2001-04-22 Thread alex

hi all. 

i wonder who can help me resolve this problem.
i am making a program based on struts.
there are some circumstances that serval pages invoke one same
action. and if some errors occured i want to show these errors in 
the previous page, but i cannot judge where the page is, cuz,
there are many pages can invoke this action.



thanks alot

redbeebird.




Re: Feature request

2001-04-22 Thread Craig R. McClanahan



On Wed, 18 Apr 2001, James Howe wrote:

> I'm using the  tag to add parameters to a dynamically generated 
> URL used by some javascript on my JSP page.  The problem with  
> is that it doesn't URL encode the result.  In general, this is probably a 
> good thing.  However, there are times when it would be nice to have the 
> value encoded.  Would it be possible to add an additional optional tag to 
> WriteTag which would indicate whether the result was to be URLEncoded?  The 
> default would be false which would not require any changes in current 
> code.  Also, if there is an alternative way to get this functionality, 
> please let me know.  Unfortunately I can't use the "link" tag in this 
> circumstance.
> 
> Basically I have a line in my file which looks like this:
> 
> 
> 
> In other words, I'm building up the parameters to the location URL based on 
> property values in a particular bean.
> 
> Thanks.
> 
> 

Just to avoid confusion, are you talking about calling
response.encodeURL() to make sure that the session id is included for
clients that do not use cookies?  If so, doing it only on the value of the
"key" parameter (as shown in your example above) would not be sufficient
even if it was supported -- you can only call encodeURL() with the
*entire* URL you want to have encoded.

However, that doesn't mean an encode="true" option might not be
useful.  It would go along with the filter attribute (to filter out
characters sensitive in HTML) that defaults to "true".

Craig