Hi All,
I have following problem with
orion.
In myservlet ana jsp pages i store some
informations in the session (some object for example user object,or cusotmer
ex)
and when i tried to access any object in the
session some times i recieved java.lag.ClassCastException.
I know in what case this exception throwed
but in other application servers(resin,tomcat,weblogic) i didnot recieved any
time this exception.
My code looklies this..Let say after loggin
the system i store the user object inthe session and all of the jsp pages i
checks the user object is valid inthe session.
User user = (User)
session.getAttribute("user');
commands return some times castexception.I suppose
it return only this exceptiuon when the session is allready timeout.But normally
if the session is expired the user object should return as null.(so i will
understant the session expired and i will redirect the page login page
again..)but onthe orion (only) it throws exception..Same thing is also for
request.getAttribute("some_object_name") it also throws this exception but some
times it workss.
And second thing in the the servlet body any
time if you forward the response and request object with
RequestDispatcher.forward(req,res) command
the response and request should forwarded successfuly but when you try to
forward them second time you will get an exception IllegalStateException.This
normal.But on the orion you can forward them more then once time and you will
not cacth an exception..So the code listed below make strange
thingg.
try {
Do something
//
}
catch (Exception ex) {
request.setAttribute("exception",
ex.getMessage());
url = "/error/error.jsp"; ServletContext sc = getServletContext(); RequestDispatcher rd = sc.getRequestDispatcher(response.encodeURL(url)); rd.forward(request,response); }
url="success.jsp";
ServletContext sc =
getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher(response.encodeURL(url)); rd.forward(request,response); Normaly this code procces like this if you
cacth an exception while proccesing try body your request and response object
forwarded the error.jsp page.you will see the error.jsp and the following code
procced but it could not run because you allready forward them some at the secon
time you get an exceptiopn but its not important because you saw the error.jsp
and the other parts not works.
But in orion i forward objects to the
error.jsp and also it forward the object also success.jsp.So you will see the
both of page in navigator window at the same time..an it not trows this
illagelStateException.and also if you are proccessing some operation with
forwarded response and request object in your succes page it colud run properly
because the response and request object not forwarded properly for second page
in fact..
so these are the my problems..
Any comments welcome..
Thanxx..
|