In other words:

we have

public class BaseAction extends Action
{
public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
{
.........
doPerform(mapping, form, request, response);
.........

}
protected Data getData()
{
.....
return data;
}
....
}

------------------------------------------------------------------------

public ExtendedAction class extends BaseAction
{
public doPerform (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
{
...
.....getData().....
...
}
}

We want do getData() doing some stuff based in request or session info, but we can not change the interface. The idea would be to obtain current request o session from Thread.currentThread().

Any idea?,

Adolfo.

From: "Adolfo Miguelez" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: help!!!!! SOS.
Date: Mon, 20 Jan 2003 12:38:40 +0000

Hi all,

a really difficult question with maybe no response. We have a subclass of a BaseAction whcih inherits form Action. BaseAction in turns publish a method inherited getData(). The point is that getData is implemented such as it needs the request to perform some kind of operations.

We would like to avoid modifying the interface to getData(request) to maintain backwards compatibility.

The question is: is there any way to find out current request or session from Thread.currentThread() inside getData() in the BaseAction class.

Porbably it could be solved by maintaining a table with Thread/request values, but I do not know if such a info would be already provided by the servlet API or any.

Any help wpould be appreciated since it is a ugly trouble.

Regards,

Adolfo.

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

_________________________________________________________________
MSN 8: advanced junk mail protection and 2 months FREE*. http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to