You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jesse Reynolds <li...@va.com.au> on 2001/02/04 10:18:39 UTC

Re: util:include-uri authentication (+cookies & form data)

>
>>  >you can manipulate cookies for the current connection using cookie
>>  >logicsheet, though i think its design leaves something to be desired.
>>  >however, i don't know any way to attach cookies to the java.net http
>>  >client that's used by the util logicsheet. form data, that is to say
>>  >request parameters, you can tack onto the url:
>>  >
>>  >http://username:password@example.com/protected/resource?foo=bar&bar=bat
>>  >
>>  >via the get method. post method would be trickier, i'm not aware of
>>  >anything in the servlet or JDK API's to generate post requests - but using
>>  >a post here would be wrong anyway.
>>
>>  I need to do POST. Why do you think it would be wrong?
>
>POSTs are supposed to make changes server-side, and i think if that's what
>you're doing, that it should be called explicitly, rather than as just a
>side effect of including a resource. it's really your call though.

I believe I can include cookies and do POST as well as GET with the 
Java.net http client (java.net.HttpUrlConnection contains 
setRequestMethod, which can take 'post').

>
>  > So, for some requests (when performing site editing functions) we'd
>>  like to pipe the incoming request straight through cocoon and onto
>>  our external web app for it to decipher cookies etc, via both the GET
>>  and POST methods.
>>
>>  I hope this makes sense and gives a sensible reason for wanting to use POST.
>>
>>  Next question is for advice: what would be the best way of making
>>  this happen? Ie, by extending the util logicsheet, or by building our
>>  own taglib to do all this? Or something else again?
>
>if you really need to generate your own POST URL calls, you probably need
>to write your own logicsheet. if you're happy with what you come up with,
>you might consider submitting a patch to the util logicsheet.

Okay, how do I write my own logicsheet? Is it simply a matter of 
creating something like "myutils.xsl" and referencing it in 
cocoon.properties etc as a taglib? Or do I have to write a 
corresponding java file and copile it all somehow?

....

If i wanted to try making modifications to the util logicsheet 
(taglib) would I be making changes to both

src/org/apache/cocoon/processor/xsp/library/java/util.xsl

and

src/org/apache/cocoon/processor/xsp/XSPUtil.java

???

If so, I presume I'd have to remake cocoon yes? How do I do that?

Thankyou

-Jesse

-- 

       Jesse Reynolds - Virtual Artists Pty Ltd - http://www.va.com.au
                                                  jesse (at) va.com.au

Re: util:include-uri authentication (+cookies & form data)

Posted by Ulrich Mayring <ul...@denic.de>.
Jesse Reynolds wrote:
> 
> Okay, how do I write my own logicsheet? Is it simply a matter of
> creating something like "myutils.xsl" and referencing it in
> cocoon.properties etc as a taglib? Or do I have to write a
> corresponding java file and copile it all somehow?

Better yet: put this in your xml file:

<?xml-logicsheet href="/path/to/myutils.xsl"?>

and declare the myutils namespace in the xmlns attribute of <xsp:page>

That way you don't have to modify cocoon.properties and restart cocoon
every time you change myutils.xsl

> If i wanted to try making modifications to the util logicsheet
> (taglib) would I be making changes to both
> 
> src/org/apache/cocoon/processor/xsp/library/java/util.xsl

Yes. Please contribute these changes.

> src/org/apache/cocoon/processor/xsp/XSPUtil.java

No, this is just a collection of "un-taglibbed" utility methods. You can
use them inside <xsp:logic> but they're not in any taglib.

> If so, I presume I'd have to remake cocoon yes? How do I do that?

build.sh on UNIX and build.bat on DOS generate a new cocoon.jar in
subdirectory build.

ULrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung