Forwarding to dynamic action

2002-12-05 Thread Markus Pedratscher \(WebBS\)
Hi,
I am struggling with an action forward problem.

My application has a baseAction which is the parent of some of my actions.
It checks if a user is logged in. If the user is logged it the child action
is executed.

If the user is not logged in it takes the user to the login form. For now I
store the originally requested action, i.e. I store request.getServletPath()
+ "?" + request.getQueryString() in a session variable (not good I know) and
if the login is successfull I want to take the user back to the originally
requestd action. I don't want to use forwards to do this as I would have to
list all my secure pages in struts-config (global or action forwards).

What I want to do it to 'redirect' the user from one Action to another
Action by using something like 'mapping.findForward("/myAction.do?x=y&u-r")
from within my loginAction.

Any ideas on how to do that with struts or a workaround?

Thanks for your help.
Markus


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to access ActionErrors from within FormAction

2002-11-15 Thread Markus Pedratscher \(WebBS\)
The problem is that if I want to display the error in a Javascript 'alert'
box
I don't want the html header and footer, I just want the message.

The problem with this is to get the error text *only*. The only way I've
found is
to use

String error = RequestUtils.message(pageContext,
"org.apache.struts.action.MESSAGE",
"org.apache.struts.action.LOCALE",
"errors.login.detailsInvalid");

That works fine in a jsp but I don't want this logic in my jsp and
I can't access pageContext from within the Action.

Does anyone know how to get the error text (access application.properties)
from within an Action.

Thanks for your help,
Markus

-Original Message-
From: edgar [mailto:edgar@;blue-moose.net]
Sent: Friday, November 15, 2002 1:32 PM
To: 'Struts Users Mailing List'
Subject: RE: How to access ActionErrors from within FormAction


Why is this an issue?  Just to put any error.header or error.footer in
the properties file.

If you must, the following will get you the list of errors:

 ActionErrors ae = (ActionErrors)
request.getAttribute(Action.ERROR_KEY);

Edgar

-Original Message-
From: Markus Pedratscher (WebBS) [mailto:markp@;webbs.tv]
Sent: Friday, November 15, 2002 5:56 AM
To: '[EMAIL PROTECTED]'
Subject: How to access ActionErrors from within FormAction


Hi,
I'm fairly new to struts and I'm having the following problem.

I want to display an error message in an js alert box. My understanding
is that I can't do that with  because if wraps the error.header
and .error.footer around each message and does not have an attribute to
disable this behavior.

Therefore what I want to do is to get the message from
application.properties and then store it in the form bean. The problem
is that I can't figure out which class/method to use to read the message
from application.properties (from within my formAction). I'm looking for
something like this:

String messageText = messageContext.getMessage(messageKey);

Can anyone help?
Thanks
Markus


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


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




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




How to access ActionErrors from within FormAction

2002-11-15 Thread Markus Pedratscher \(WebBS\)
Hi,
I'm fairly new to struts and I'm having the following problem.

I want to display an error message in an js alert box. My understanding is
that I can't do that with  because if wraps the error.header and
.error.footer around each message and does not have an attribute to disable
this behavior.

Therefore what I want to do is to get the message from
application.properties and then store it in the form bean. The problem is
that I can't figure out which class/method to use to read the message from
application.properties (from within my formAction). I'm looking for
something like this:

String messageText = messageContext.getMessage(messageKey);

Can anyone help?
Thanks
Markus


--
To unsubscribe, e-mail:   
For additional commands, e-mail: