[Opensource] Would like to double check the following
Innovest Ken
innovest_11 at yahoo.com
Wed Oct 2 03:07:10 PDT 2002
hi Mike and Larry
I have run the following codes in expresso and it
seems working. It redirects to the error
page if the user does not have the required privileges
in httpsession. But I'm not sure whether it is legal
in Expresso, so can u guys just do a quick check for
me, really appreciate it, the following has been
shortened to be left only the relevant codes:
public ControllerResponse newState(String newState,
ControllerRequest request) throws ControllerException,
NonHandleableException
{
if (!privList.containsKey(priv_id))
{
ControllerResponse resp = new ControllerResponse();
errPage("No permission to access this module!",
request, resp);
return resp;
}
ControllerResponse resp = super.newState(newState,
request);
return resp;
}
private void errPage(String error, ControllerRequest
request, ControllerResponse response) throws Exception
{
response.setCustomResponse(true);
HttpServletRequest req =
(HttpServletRequest)((ServletControllerRequest)request).getServletRequest();
RequestDispatcher dispatcher =
req.getRequestDispatcher("/spear/jsp/access/errPage.jsp");
HttpServletResponse resp =
(HttpServletResponse)((ServletControllerRequest)request).getServletResponse();
req.setAttribute("error", error);
dispatcher.forward(req, resp);
}
I cannot use setstyle in newstate() because of
nullpointer in action perform(). I new
ControllerResponse(), and I want to
ControllerResponse.setRequest(), but failed because
setrequest is not public.
If it is ok, I intend to put this as the ancestor
controller for my application so all other controllers
will inherit from this controller. Please advise,
thanks!
hi Larry
For the session timeout feature, I'll download the
latest 4.02 rc2 expresso, and upgrade my 4.0 to 4.02
to make use of the session timeout. I'll just copy my
application directory over, hopefully not much
problem.
But if I change the forward in logon.do in
struts-config to my application login page
"application/login.jsp", it should be ok right?
So that if session timeout, it will goto my
application login page. Please advise, thanks.
Innovest
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
More information about the Opensource
mailing list