Question about errors tag

2000-12-05 Thread Doug Ahmann

I've noticed a potential problem with the way errors are handled, and the
ErrorsTag class. I'm assuming I'm missing something. (I'm new to Struts)

Picture the following:

A jsp page, login.jsp. It has a form.
An action class, LoginAction.java.
A form class, LoginForm.java.

LoginAction does exactly what you would expect. It checks the database for
the user and password. If the user or password is invalid, it loads a
message into errors, and then calls saveErrors() in ActionBase.

The difference in what I'm doing vs. the Struts examples is that, rather
than using forward functionality to return back to login.jsp on errors, I'm
using redirect instead. I don't want the URL in the browser to be login.do.

You see the problem. Errors are stored to the request context, which is no
longer valid after the redirect, therefore the errors tag can not retrieve
the errors.

I would suggest that session context should be used for the errors tag for
cases just like this, although that causes problems as well. The problem
will be, when does it get removed from the session?

Is there another way to accomplish the same thing, without tacking the error
on to the redirect URL?

Thanks,
Doug

---
Doug Ahmann
Macromedia, Inc.
(612) 840-9544




Question about localization

2000-12-01 Thread Doug Ahmann

Greetings,

I don't know a lot about localization, so I'm hoping you wise men and women
out there can point me in the right direction.

Here is what we need to accomplish:

The server we're creating needs to be usable simultaneously by multiple
users in multiple languages. Our app uses Struts/JSP and the Model 2
architecture. What is the "best practice" or the "correct" Java/Struts way
of accomplishing this?

Is there a way to use the same JSP pages, or is it best to have multiple
contexts (/en/, /fr/, etc)?

Thanks,
Doug

---
Doug Ahmann
Macromedia, Inc.
(612) 840-9544