colocating *.jsp (and *.php) with xforms apps files

classic Classic list List threaded Threaded
7 messages Options
DL
Reply | Threaded
Open this post in threaded view
|

colocating *.jsp (and *.php) with xforms apps files

DL
I want to place a *.jsp (or *.php) actually inside an app directory .. resources/apps/test/test.jsp .. to be colocated with xhtml app files .. instead of placing in xforms-jsp folder as in other jsp examples .

what should be in the <url-pattern> ??? </url-pattern> in the <filter-mapping> in web.xml ?

i.e. instead of <url-pattern>xforms-jsp</url-pattern>  what is the url-pattern for path to an app?

My aim is to parse and write an xhtml file using jsp or php and file write requires script and target file to be colocated in the same directory.

If I then run the *.jsp or *.php file in browser what is the full url .. not passing through pageflow controller?

http://localhost:8080/orbeon/ .......  /test/test.jsp ?

I have quercus java php servlet integrated into orbeon so can run *.php - but not through pageflow controller.

So the idea is to dynamically create an xform by rewriting contents using *.php script.
Reply | Threaded
Open this post in threaded view
|

Re: colocating *.jsp (and *.php) with xforms apps files

Erik Bruchez
Administrator
Patterns in web.xml are very limited. You can only specify a path
prefix, or an extension.

You can try <url-pattern>*.jsp</url-pattern> if you want all your JSPs
to go through the filter. Does this work?

We have no experience with quercus here but basically what you want is
quercus first, then the XForms filter.

-Erik

On Thu, Dec 2, 2010 at 2:04 PM, DL <[hidden email]> wrote:

>
> I want to place a *.jsp (or *.php) actually inside an app directory ..
> resources/apps/test/test.jsp .. to be colocated with xhtml app files ..
> instead of placing in xforms-jsp folder as in other jsp examples .
>
> what should be in the <url-pattern> ??? </url-pattern> in the
> <filter-mapping> in web.xml ?
>
> i.e. instead of <url-pattern>xforms-jsp</url-pattern>  what is the
> url-pattern for path to an app?
>
> My aim is to parse and write an xhtml file using jsp or php and file write
> requires script and target file to be colocated in the same directory.
>
> If I then run the *.jsp or *.php file in browser what is the full url .. not
> passing through pageflow controller?
>
> http://localhost:8080/orbeon/ .......  /test/test.jsp ?
>
> I have quercus java php servlet integrated into orbeon so can run *.php -
> but not through pageflow controller.
>
> So the idea is to dynamically create an xform by rewriting contents using
> *.php script.
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/colocating-jsp-and-php-with-xforms-apps-files-tp3070304p3070304.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
DL
Reply | Threaded
Open this post in threaded view
|

Re: colocating *.jsp (and *.php) with xforms apps files

DL
Erik Bruchez wrote
... but basically what you want is quercus first, then the XForms filter.

-Erik    
that is exactly what I've been struggling with .. how do I first invoke quercus servlet (to pre-process embedded php code to dynamically change xhtml) and then .. secondly .. invoke orbeon filter?  i.e. two passes of compilation?

what specifies the sequence of running servlets?

the order in which they are defined in web.xml .. or what?

Thanks.


Reply | Threaded
Open this post in threaded view
|

Re: Re: colocating *.jsp (and *.php) with xforms apps files

Erik Bruchez
Administrator
>> ... but basically what you want is quercus first, then the XForms filter.

>>
>> -Erik
>
> that is exactly what I've been struggling with .. how do I first invoke
> quercus servlet (to pre-process embedded php code to dynamically change
> xhtml) and then .. secondly .. invoke orbeon filter?  i.e. two passes of
> compilation?
>
> what specifies the sequence of running servlets?
>
> the order in which they are defined in web.xml .. or what?
From what I gather from the doc, it's the order of the filter mappings
in web.xml.

-Erik


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: colocating *.jsp (and *.php) with xforms apps files

Erik Bruchez
Administrator
On Fri, Dec 17, 2010 at 6:01 PM, Erik Bruchez <[hidden email]> wrote:

>>> ... but basically what you want is quercus first, then the XForms filter.
>>>
>>> -Erik
>>
>> that is exactly what I've been struggling with .. how do I first invoke
>> quercus servlet (to pre-process embedded php code to dynamically change
>> xhtml) and then .. secondly .. invoke orbeon filter?  i.e. two passes of
>> compilation?
>>
>> what specifies the sequence of running servlets?
>>
>> the order in which they are defined in web.xml .. or what?
>
> From what I gather from the doc, it's the order of the filter mappings
> in web.xml.
From the Servlet spec:

"The order the container uses in building the chain of filters to be
applied for a particular request URI is as follows:

1. First, the <url-pattern> matching filter mappings in the same order
that these elements appear in the deployment descriptor.
2. Next, the <servlet-name> matching filter mappings in the same order
that these elements appear in the deployment descriptor."

-Erik


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
DL
Reply | Threaded
Open this post in threaded view
|

Re: Re: colocating *.jsp (and *.php) with xforms apps files

DL
For information to anyone interested in experimenting with php as well as jsp ..

I copied into web-inf\lib\ these *.jars from quercus.caucho.com.

quercus.jar, resin.jar, resin-util.jar

(note: LifeRay also uses quercus php interpreter for php portlets)


In web.xml I put the <url-pattern> and <servlet-mapping> in this pecking order

quercus
orbeon

...

    <filter-mapping>
        <filter-name>orbeon-xforms-filter</filter-name>
        <url-pattern>/xforms-php/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>


    <servlet>
    <servlet-name>Quercus Servlet</servlet-name>
    <servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>


    <init-param>
      <param-name>ini-file</param-name>
      <param-value>WEB-INF/php.ini</param-value>
    </init-param>

    </servlet>

    <servlet-mapping>
      <servlet-name>Quercus Servlet</servlet-name>
      <url-pattern>*.php</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
      <welcome-file>index.php</welcome-file>
    </welcome-file-list>


...


Next I created an xforms-php folder (same level as xforms-jsp folder) and placed this hello.php file.


<?php

header("Content-type: application/xhtml+xml");

$string='<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:head>
<xhtml:title>Hello Orbeon and Quercus World Classic</xhtml:title>
</xhtml:head>
<xhtml:body>
<xhtml:instance id="test">
<xhtml:p>Hello Orbeon and Quercus World</xhtml:p>
</xhtml:instance> 
</xhtml:body>
</xhtml:html>
';


echo $string;

?>


Restarted server.

I could then launch http://localhost:8080/orbeon/xforms-php/hello.php

I can now create xforms in php inside orbeon and write these *.xhtml files into apps folder.

i.e. not going so far (yet) as to actually embed php in xhtml files.

...

Another approach is to keep quercus outside orbeon and deploy quercus.war as a separate *.war in tomcat.   This avoids the need to edit web.xml and import *.jars etc.   But having quercus jars inside orbeon allows files to be created and written into different folders.


Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: colocating *.jsp (and *.php) with xforms apps files

Erik Bruchez
Administrator
Glad to see you made progress! -Erik

On Sat, Dec 18, 2010 at 5:08 AM, DL <[hidden email]> wrote:

>
> For information to anyone interested in experimenting with php as well as jsp
> ..
>
> I copied into web-inf\lib\ these *.jars from quercus.caucho.com.
>
> quercus.jar, resin.jar, resin-util.jar
>
> (note: LifeRay also uses quercus php interpreter for php portlets)
>
>
> In web.xml I put the <url-pattern> and <servlet-mapping> in this pecking
> order
>
> quercus
> orbeon
>
> ...
>
>    <filter-mapping>
>        <filter-name>orbeon-xforms-filter</filter-name>
>        <url-pattern>/xforms-php/*</url-pattern>
>        <dispatcher>REQUEST</dispatcher>
>        <dispatcher>FORWARD</dispatcher>
>    </filter-mapping>
>
>
>    <servlet>
>    <servlet-name>Quercus Servlet</servlet-name>
>    <servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
>
>
>    <init-param>
>      <param-name>ini-file</param-name>
>      <param-value>WEB-INF/php.ini</param-value>
>    </init-param>
>
>    </servlet>
>
>    <servlet-mapping>
>      <servlet-name>Quercus Servlet</servlet-name>
>      <url-pattern>*.php</url-pattern>
>    </servlet-mapping>
>
>    <welcome-file-list>
>      <welcome-file>index.php</welcome-file>
>    </welcome-file-list>
>
>
> ...
>
>
> Next I created an xforms-php folder (same level as xforms-jsp folder) and
> placed this hello.php file.
>
>
> <?php
>
> header("Content-type: application/xhtml+xml");
>
> $string='<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml">
> <xhtml:head>
> <xhtml:title>Hello Orbeon and Quercus World Classic</xhtml:title>
> </xhtml:head>
> <xhtml:body>
> <xhtml:instance id="test">
> <xhtml:p>Hello Orbeon and Quercus World</xhtml:p>
> </xhtml:instance>
> </xhtml:body>
> </xhtml:html>
> ';
>
>
> echo $string;
>
> ?>
>
>
> Restarted server.
>
> I could then launch http://localhost:8080/orbeon/xforms-php/hello.php
>
> I can now create xforms in php inside orbeon and write these *.xhtml files
> into apps folder.
>
> i.e. not going so far (yet) as to actually embed php in xhtml files.
>
> ...
>
> Another approach is to keep quercus outside orbeon and deploy quercus.war as
> a separate *.war in tomcat.   This avoids the need to edit web.xml and
> import *.jars etc.   But having quercus jars inside orbeon allows files to
> be created and written into different folders.
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/colocating-jsp-and-php-with-xforms-apps-files-tp3070304p3093651.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws