[opencms-dev] Export jsp pages

Christian Steinert christian_steinert at web.de
Tue May 30 11:56:05 CEST 2006


Dear Aldo
> I'm using OpenCms to build a site with Carlo.
I don't know what "Carlo" is? Are the jsps directly executed by your 
servlet container, or by yet another system in a more indirect way?
> We have taken a single page, named login.jsp in the OpenCms envorment 
> an then
> we have tried to solve the problem setting the advanced properties:
>  
> export=true and export name=login.jsp...
Hmm, this is what I expected would work. This is strange. Probably a 
good idea to write a bug report. Of course you cannot wait for it being 
resolved but in this way at least the behavior will hopefully be 
corrected at some point.

You could try one of the following
1. you could add the extension .jsp.html to the extensions of JSP pages. 
If you want to limit this for only some directories, then this should be 
possible
by adding something like this to your web.xml (config pieces are taken 
from tomcat 4.1's own - global - web.xml file)

   <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>logVerbosityLevel</param-name>
            <param-value>WARNING</param-value>
        </init-param>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

<!-- treat files with extension .jsp.html as if they were jsps.
       do this only in URLs that start with /my/path/;
       all sub-paths will be affected by this -->
<servlet-mapping>
  <servlet-name>jsp</servlet-name>
  <url-pattern>/my/path/*.jsp.html</url-pattern>
</servlet-mapping>


2, if that doesn't work (but it SHOULD) or if you don't want this, you 
could try something more crude:
- copy your login.jsp file into the template-folder of a module
- create an xmlpage in your website folder, which is also called 
login.jsp (although it is an HTML page, but who cares.). Assign your 
login.jsp-"template" to the "login.jsp"-xmlpage
In this way, your REAL jsp will still be called, when the xmlpage is 
requested. The xmlpage is just a dummy entry point.
- for your xmlpage set export=true and export name=login.jsp
- Publish. See if the publishing keeps the name just as it is for your 
"xmlpage", which in just fact triggers your JSP.

I have no idea if the second proposal works and of course it's ugly. But 
these are the only things that come to my mind.
> How can we export all the files as XXX.jsp?
no, no, your settings were alright. I don't know why it does not work 
anyway...
Really a good idea to write a bug report.

Regards
Christian



More information about the opencms-dev mailing list