You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Huib Verweij <hu...@mpi.nl> on 2011/03/31 13:04:02 UTC

Calling servlet block from itself?

Hi,

I would like to call a servlet from within a servlet, e.g.:

<map:transform type="servletService">
    <map:parameter name="service"  value="servlet:db:/workspace/getSortOrders.xml"/>
</map:transform>

from within the db-servlet itself. I realize this is somewhat like a recursive call and it could lead to unpleasant behavior. I also realize I have setup my blocks incorrectly and probably need to create more blocks, pushing the code I want to call to the basic 'bottom' block. But it would help for now if this is possible :-).

The above statement fails, so I tried to add:

<servlet:connections>
        <entry key="db" value-ref="nl.mpi.lexus.db.service"/>
        <entry key="display" value-ref="nl.mpi.lexus.display.service"/>
</servlet:connections>

to the servlet context for db:

<servlet:context mount-path="/db" context-path="blockcontext:/db/"/>

but then things fail to startup properly.

So, it's not that I can't imagine why this is tricky, but on the other hand I can see this might be useful. An alternative I see would be to use a <map:resource/> but unfortunately the code I'm trying to call is in a different sitemap.xmap. Any suggestions are appreciated.

Hartelijke groet,

Huib.




--
Drs. Huib Verweij
Senior software developer - The Language Archive
Max Planck Institute for Psycholinguistics
P.O. Box 310
6500 AH Nijmegen
The Netherlands
t +31-24-3521911
e huib.verwey@mpi.nl
w http://www.mpi.nl/



Re: Calling servlet block from itself?

Posted by Hemangi Dua <he...@ictect.com>.
I have following code in sitemap, and what is "ServletService"
<
<
</
Hemangi

 

In a Day, When u dont come across any PROBLEMS, u can be sure that u r traveling 

in a WRONG path....... Swami Vivekananda




----- Original Message ----
From: Thomas Markus <t....@proventis.net>
To: users@cocoon.apache.org
Cc: Huib Verweij <hu...@mpi.nl>
Sent: Thu, March 31, 2011 9:07:28 AM
Subject: Re: Calling servlet block from itself?

Hi,

try an absolute name:

<map:transform type="servletService">
    <map:parameter name="service"  
value="servlet:nl.mpi.lexus.db.service+:/workspace/getSortOrders.xml"/>
</map:transform>


regards
Thomas

Am 31.03.2011 13:04, schrieb Huib Verweij:
> Hi,
>
> I would like to call a servlet from within a servlet, e.g.:
>
> <map:transform type="servletService">
>      <map:parameter name="service"  
>value="servlet:db:/workspace/getSortOrders.xml"/>
> </map:transform>
>
> from within the db-servlet itself. I realize this is somewhat like a recursive 
>call and it could lead to unpleasant behavior. I also realize I have setup my 
>blocks incorrectly and probably need to create more blocks, pushing the code I 
>want to call to the basic 'bottom' block. But it would help for now if this is 
>possible :-).
>
> The above statement fails, so I tried to add:
>
> <servlet:connections>
>          <entry key="db" value-ref="nl.mpi.lexus.db.service"/>
>          <entry key="display" value-ref="nl.mpi.lexus.display.service"/>
> </servlet:connections>
>
> to the servlet context for db:
>
> <servlet:context mount-path="/db" context-path="blockcontext:/db/"/>
>
> but then things fail to startup properly.
>
> So, it's not that I can't imagine why this is tricky, but on the other hand I 
>can see this might be useful. An alternative I see would be to use 
>a<map:resource/>  but unfortunately the code I'm trying to call is in a 
>different sitemap.xmap. Any suggestions are appreciated.
>
> Hartelijke groet,
>
> Huib.
>
>
>
>
> --
> Drs. Huib Verweij
> Senior software developer - The Language Archive
> Max Planck Institute for Psycholinguistics
> P.O. Box 310
> 6500 AH Nijmegen
> The Netherlands
> t +31-24-3521911
> e huib.verwey@mpi.nl
> w http://www.mpi.nl/
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org

map:transformername="sendmail"src="org.apache.cocoon.mail.transformation.SendMailTransformer">smtphost>localhost</smtphost>map:transformer> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Calling servlet block from itself?

Posted by Huib Verweij <Hu...@mpi.nl>.
Thanks Thomas, that works!

Hartelijke groet,

Huib.

--
Drs. Huib Verweij
Senior software developer - The Language Archive
Max Planck Institute for Psycholinguistics
P.O. Box 310
6500 AH Nijmegen
The Netherlands
t +31-24-3521911
e huib.verwey@mpi.nl
w http://www.mpi.nl/


Op 31 mrt 2011, om 16:07 heeft Thomas Markus het volgende geschreven:

> 
> 
> try an absolute name:
> 
> <map:transform type="servletService">
>     <map:parameter name="service"  value="servlet:nl.mpi.lexus.db.service+:/workspace/getSortOrders.xml"/>
> </map:transform>
> 
> 
> regards
> Thomas


Re: Calling servlet block from itself?

Posted by Hemangi Dua <he...@ictect.com>.
I have following code in sitemap, and what is "ServletService"

<
<
</
Thanks
Hemangi

 

In a Day, When u dont come across any PROBLEMS, u can be sure that u r traveling 

in a WRONG path....... Swami Vivekananda




----- Original Message ----
From: Thomas Markus <t....@proventis.net>
To: users@cocoon.apache.org
Cc: Huib Verweij <hu...@mpi.nl>
Sent: Thu, March 31, 2011 9:07:28 AM
Subject: Re: Calling servlet block from itself?

Hi,

try an absolute name:

<map:transform type="servletService">
    <map:parameter name="service"  
value="servlet:nl.mpi.lexus.db.service+:/workspace/getSortOrders.xml"/>
</map:transform>


regards
Thomas

Am 31.03.2011 13:04, schrieb Huib Verweij:
> Hi,
>
> I would like to call a servlet from within a servlet, e.g.:
>
> <map:transform type="servletService">
>      <map:parameter name="service"  
>value="servlet:db:/workspace/getSortOrders.xml"/>
> </map:transform>
>
> from within the db-servlet itself. I realize this is somewhat like a recursive 
>call and it could lead to unpleasant behavior. I also realize I have setup my 
>blocks incorrectly and probably need to create more blocks, pushing the code I 
>want to call to the basic 'bottom' block. But it would help for now if this is 
>possible :-).
>
> The above statement fails, so I tried to add:
>
> <servlet:connections>
>          <entry key="db" value-ref="nl.mpi.lexus.db.service"/>
>          <entry key="display" value-ref="nl.mpi.lexus.display.service"/>
> </servlet:connections>
>
> to the servlet context for db:
>
> <servlet:context mount-path="/db" context-path="blockcontext:/db/"/>
>
> but then things fail to startup properly.
>
> So, it's not that I can't imagine why this is tricky, but on the other hand I 
>can see this might be useful. An alternative I see would be to use 
>a<map:resource/>  but unfortunately the code I'm trying to call is in a 
>different sitemap.xmap. Any suggestions are appreciated.
>
> Hartelijke groet,
>
> Huib.
>
>
>
>
> --
> Drs. Huib Verweij
> Senior software developer - The Language Archive
> Max Planck Institute for Psycholinguistics
> P.O. Box 310
> 6500 AH Nijmegen
> The Netherlands
> t +31-24-3521911
> e huib.verwey@mpi.nl
> w http://www.mpi.nl/
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org

map:transformername="sendmail"src="org.apache.cocoon.mail.transformation.SendMailTransformer">smtphost>localhost</smtphost>map:transformer> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Calling servlet block from itself?

Posted by Thomas Markus <t....@proventis.net>.
Hi,

try an absolute name:

<map:transform type="servletService">
     <map:parameter name="service"  value="servlet:nl.mpi.lexus.db.service+:/workspace/getSortOrders.xml"/>
</map:transform>


regards
Thomas

Am 31.03.2011 13:04, schrieb Huib Verweij:
> Hi,
>
> I would like to call a servlet from within a servlet, e.g.:
>
> <map:transform type="servletService">
>      <map:parameter name="service"  value="servlet:db:/workspace/getSortOrders.xml"/>
> </map:transform>
>
> from within the db-servlet itself. I realize this is somewhat like a recursive call and it could lead to unpleasant behavior. I also realize I have setup my blocks incorrectly and probably need to create more blocks, pushing the code I want to call to the basic 'bottom' block. But it would help for now if this is possible :-).
>
> The above statement fails, so I tried to add:
>
> <servlet:connections>
>          <entry key="db" value-ref="nl.mpi.lexus.db.service"/>
>          <entry key="display" value-ref="nl.mpi.lexus.display.service"/>
> </servlet:connections>
>
> to the servlet context for db:
>
> <servlet:context mount-path="/db" context-path="blockcontext:/db/"/>
>
> but then things fail to startup properly.
>
> So, it's not that I can't imagine why this is tricky, but on the other hand I can see this might be useful. An alternative I see would be to use a<map:resource/>  but unfortunately the code I'm trying to call is in a different sitemap.xmap. Any suggestions are appreciated.
>
> Hartelijke groet,
>
> Huib.
>
>
>
>
> --
> Drs. Huib Verweij
> Senior software developer - The Language Archive
> Max Planck Institute for Psycholinguistics
> P.O. Box 310
> 6500 AH Nijmegen
> The Netherlands
> t +31-24-3521911
> e huib.verwey@mpi.nl
> w http://www.mpi.nl/
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org