You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Fred Lo <ap...@hotmail.com> on 2001/03/12 10:27:31 UTC

forwarding to original page

Hello all,

I have an application that contain support for multiple languages, we opt 
for the multiple language/multiple jsp option, where each language of the 
system will contain its own set of jsp.

We now have a problem that during validation, when there is an error, we 
would like the page forwarded back to the original jsp (of the originating 
language). But right now the mapping only allow us to define one input form, 
so upon looking at the source file, I think we can redefine 
processValidate() of ActionServlet a bit, instead of getting the input form 
from the mapping, we can get it from a parameter:

// Has an input form been specified for this mapping?
String uri = (request.getParameter(Constants.INPUT_FORM));
if (uri == null || uri.equals(""))
{ uri = mapping.getInput(); }
....

The idea is like this, is our approach correct? (pls don't say we shouldn't 
have a duplicate set of jsp) Or there is some better way to achieve that?

Thanks a lot.

Fred Lo
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


Re: forwarding to original page

Posted by Maya Muchnik <mm...@pumatech.com>.
You can check with Validator  05. release :
http://home.earthlink.net/~dwinterfeldt/
It has a multiple language error support.
Maya
P.S. Is any connection your site with http://explorer.msn.com

Fred Lo wrote:

> Hello all,
>
> I have an application that contain support for multiple languages, we opt
> for the multiple language/multiple jsp option, where each language of the
> system will contain its own set of jsp.
>
> We now have a problem that during validation, when there is an error, we
> would like the page forwarded back to the original jsp (of the originating
> language). But right now the mapping only allow us to define one input form,
> so upon looking at the source file, I think we can redefine
> processValidate() of ActionServlet a bit, instead of getting the input form
> from the mapping, we can get it from a parameter:
>
> // Has an input form been specified for this mapping?
> String uri = (request.getParameter(Constants.INPUT_FORM));
> if (uri == null || uri.equals(""))
> { uri = mapping.getInput(); }
> ....
>
> The idea is like this, is our approach correct? (pls don't say we shouldn't
> have a duplicate set of jsp) Or there is some better way to achieve that?
>
> Thanks a lot.
>
> Fred Lo
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com


Re: forwarding to original page

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 12 Mar 2001, Fred Lo wrote:

> Hello all,
> 
> I have an application that contain support for multiple languages, we opt 
> for the multiple language/multiple jsp option, where each language of the 
> system will contain its own set of jsp.
> 
> We now have a problem that during validation, when there is an error, we 
> would like the page forwarded back to the original jsp (of the originating 
> language). But right now the mapping only allow us to define one input form, 
> so upon looking at the source file, I think we can redefine 
> processValidate() of ActionServlet a bit, instead of getting the input form 
> from the mapping, we can get it from a parameter:
> 
> // Has an input form been specified for this mapping?
> String uri = (request.getParameter(Constants.INPUT_FORM));
> if (uri == null || uri.equals(""))
> { uri = mapping.getInput(); }
> ....
> 
> The idea is like this, is our approach correct? (pls don't say we shouldn't 
> have a duplicate set of jsp) Or there is some better way to achieve that?
>

Subclassing ActionServlet, and then overriding processValidate() to do
what you are describing above, certainly seems like a viable
approach.  This is the primary reason that the processing logic in
ActionServlet has been divided into so many protected methods - so that
you can easily specialize the parts you want, without having to recode the
entire processing flow.
 
> Thanks a lot.
> 
> Fred Lo

Craig