[opencms-dev] Flex and Servlet API 2.2

Publius Ismanescu publiusi at wwdb.org
Wed Mar 5 17:16:17 CET 2003


Hi Alexander,

I would appreciate if you cand send me whatever information
you have at this point on the CmsJspActionElement.
I want to test this with the example index.jsp that is in opencms at this
point.
I hope using this Bean I will be able to solve the problem I have described
bellow.

Thank you
Publius


-----Original Message-----
From: owner-opencms-dev at www.opencms.org
[mailto:owner-opencms-dev at www.opencms.org]On Behalf Of Publius Ismanescu
Sent: February 26, 2003 7:23 PM
To: opencms-dev at www.opencms.org
Subject: Re: [opencms-dev] Flex and Servlet API 2.2


Hi Alexander,

I deployed opencms 5.0 rc1 on websphere 4.0 using your suggestion. I
created a jar file with the servlet 2.3 new api's.(not including the
servlet 2.2 classes).

I also changed the taglib to jsp1.1.
When I type the url :
http://localhost:9080/opencms/opencms/system/workplace/action/index.html
 I get the login and after login
the opencms application is up .
When I use the the following url:
http://localhost:9080/opencms/opencms/index.jsp I get the jsp page but
without the information that has to be replaced by the tags inside the
jsp , so all the tags all replaced with blank. I did put some printout
code and this is what happens inside the CmsJspTagInfo class:
I added the 2 system.out line bellow and the output follows after that:

 javax.servlet.ServletRequest req = pageContext.getRequest();
System.out.println("This is before the if + the real path" +
pageContext.getServletConfig().getServletContext().getRealPath("/"));
System.out.println("The class for this is : " + req.getClass().getName());
 // This will always be true if the page is called through OpenCms
 if (req instanceof com.opencms.flex.cache.CmsFlexRequest) {
            com.opencms.flex.cache.CmsFlexRequest c_req =
(com.opencms.flex.cache.CmsFlexRequest)req;
            try {
                String result = infoTagAction(m_property, c_req);
                // Return value of selected property
                pageContext.getOut().print(result);
            } catch (Exception ex) {
                System.err.println("Error in Jsp 'user' tag processing:
" + ex);

System.err.println(com.opencms.util.Utils.getStackTrace(ex));
                throw new javax.servlet.jsp.JspException(ex.getMessage());
            }
        }
return SKIP_BODY;

This is the output

[2/26/03 18:21:09:023 EST] 7eee64f2 SystemOut     U This is before the
if + the real
pathd:\PROGRA~1\WEBSPH~1\APPSER~1\installedApps\opencms.ear\wasopencms.war\
[2/26/03 18:21:09:023 EST] 7eee64f2 SystemOut     U The class for this
is : com.ibm.servlet.engine.webapp.WebAppDispatcherRequest
[2/26/03 18:21:09:023 EST] 7eee64f2 SystemOut     U This is before the
if + the real
pathd:\PROGRA~1\WEBSPH~1\APPSER~1\installedApps\opencms.ear\wasopencms.war\
[2/26/03 18:21:09:033 EST] 7eee64f2 SystemOut     U The class for this
is : com.ibm.servlet.engine.webapp.WebAppDispatcherRequest
[2/26/03 18:21:09:033 EST] 7eee64f2 SystemOut     U This is before the
if + the real
pathd:\PROGRA~1\WEBSPH~1\APPSER~1\installedApps\opencms.ear\wasopencms.war\
[2/26/03 18:21:09:033 EST] 7eee64f2 SystemOut     U The class for this
is : com.ibm.servlet.engine.webapp.WebAppDispatcherRequest
[2/26/03 18:21:09:033 EST] 7eee64f2 SystemOut     U This is before the
if + the real
pathd:\PROGRA~1\WEBSPH~1\APPSER~1\installedApps\opencms.ear\wasopencms.war\
[2/26/03 18:21:09:043 EST] 7eee64f2 SystemOut     U The class for this
is : com.ibm.servlet.engine.webapp.WebAppDispatcherRequest
[2/26/03 18:21:09:043 EST] 7eee64f2 SystemOut     U This is before the
if + the real
pathd:\PROGRA~1\WEBSPH~1\APPSER~1\installedApps\opencms.ear\wasopencms.war\
[2/26/03 18:21:09:043 EST] 7eee64f2 SystemOut     U The class for this
is : com.ibm.servlet.engine.webapp.WebAppDispatcherRequest
[2/26/03 18:21:09:053 EST] 7eee64f2 SystemOut     U This is before the
if + the real
pathd:\PROGRA~1\WEBSPH~1\APPSER~1\installedApps\opencms.ear\wasopencms.war\
[2/26/03 18:21:09:053 EST] 7eee64f2 SystemOut     U The class for this
is : com.ibm.servlet.engine.webapp.WebAppDispatcherRequest
[2/26/03 18:21:09:053 EST] 7eee64f2 SystemOut     U This is before the
if + the real
pathd:\PROGRA~1\WEBSPH~1\APPSER~1\installedApps\opencms.ear\wasopencms.war\
[2/26/03 18:21:09:053 EST] 7eee64f2 SystemOut     U The class for this
is : com.ibm.servlet.engine.webapp.WebAppDispatcherRequest
[2/26/03 18:21:09:053 EST] 7eee64f2 SystemOut     U This is before the
if + the real
pathd:\PROGRA~1\WEBSPH~1\APPSER~1\installedApps\opencms.ear\wasopencms.war\
[2/26/03 18:21:09:063 EST] 7eee64f2 SystemOut     U The class for this
is : com.ibm.servlet.engine.webapp.WebAppDispatcherRequest

The request is of type
"com.ibm.servlet.engine.webapp.WebAppDispatcherRequest" and I believe
thats why the tags inside the
jsp page are not processed

I would appreciate if you can give me some thoughts , hints  to solve this

Thank you again
Publius Ismanescu


Alexander Kandzior wrote:

>Hi Publius Ismanescu,
>
>I choose Servlet 2.3 because it had the read-made wrapper classes
>available in the API.
>
>You might be able to just take the source code from the 2.3 API
>implementation, copy the wrapper classes stuff to another package, and
>use this wrappers instead of the ones from the 2.3 API.
>
>However, the classcast exception you are experiencing might not even be
>related to that issue. There are servlet container implementations that
>wrap another class around the request (e.g. Resin does). I tested it
>with Tomcat and BEA, where this works, but others seem to handle the
>requests differently. In this environments you can not classcast the
>"request" object back to a FlexRequest. This is why we do not recommend
>to use the classcast on a JSP anymore and have introduced a bean called
>CmsJspActionElement (all of this will be described in the 5.0
>documentation).
>
>To implement a different mechansim would possible but time-consuming. My
>initial idea is to have the OpenCms information stored in a
>requestContext attribute, then access the information from there in the
>mentioned CmsJspActionElement. I will be able to work on this issue for
>quite some time, though.
>
>Best Regards,
>Alex.
>
>Alexander Kandzior
>Alkacon Software - The OpenCms Experts
>http://www.alkacon.com
>
>
>






More information about the opencms-dev mailing list