Further details of OC4J problems?
Brought to you by:
cjd4,
simon_g_brown
Hi - I'm interested in the type and severity of problem
you've encountered w/ OC4J - ie, is it possible I can find
a workaround or fix or is this a dead-end bug until the
Servlet.getResourcePaths() implementation is brought up
to spec? (If you have any detail on the source/results of
the problem w/ the existing implementation, I'd be
interested in seeing that.)
Thanks,
Jim
Logged In: YES
user_id=1179004
I last two days I have encountered several problems with
OC4J in different versions. The problems with version
9.0.0.4 was in the getResourcePaths() method. I fixed the
problem with the code I have written in a bug, which has
been propably already closed. The fix includes only this change:
Class: TestResources.java
Method: init
Line: //CORPUS HACK FOR OC4J 9
Collection resources =
pageContext.getServletContext().getResourcePaths(baseUri + "/");
This change had solved my problem. But I had another
problems in instantiating JSP in tests. The message was too
ugly for me to try to study it and fix it.
So I gave up and install new OC4J version 10G 10.1.3
Developer Preview 3. In this version the method
getResourcePaths() behave correctly (but also my version
with backslash in the end works fine), but another problem
arose.
In this version (I suppose) the container newly adds
whitespaces in the JSP output when no other visible chars
are in the output. It occurs in my user test pages I have
written. This fact results in error, because in the end the
FrontController.java wants to forward request processing on
ViewResults action and the container shows an error (in
order to specification) that it is not possible to forward
processing when response is commited (something was send to
client).
So I have to modify the code of FrontControler.java this way:
Method processRequest (beginning):
//CORPUS HACK
String actionName = null;
res.setCharacterEncoding("UTF-8");
res.setContentType("text/html");
// find which action should be used
if (req.getAttribute("ActionPathInfo")==null) {
actionName = req.getPathInfo().substring(1);
} else {
actionName = (String)
req.getAttribute("ActionPathInfo");
}
//END OF CORPUS HACK
and in the end of method:
// and finally redirect to appropriate view, remembering to
prefix the path
try {
if (nextView != null) {
//CORPUS HACK
req.setAttribute("ActionPathInfo",nextView.replaceAll("servlet/",""));
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(path + "/" + nextView);
dispatcher.include(req,res);
//END OF CORPUS HACK
}
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
So to replace forwarding to including. Next I have to
remember the nextView because incude method don't modify the
path data. At last I have to make some slight modifications
in results.jsp not to call FrontendController while
downloading css and images.
In the end I have a functional TagUnit under OC4J 10G
10.1.3. I have searched for another solution for whitechars
in output, but I haven't find anything.
Maybe you have another advice?