cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lionel Crine <cr...@4dconcept.fr>
Subject RE: XSP : get and modify URL
Date Mon, 05 May 2003 07:20:06 GMT
Use   <xsp-request:get-uri/>.beta <xsp-request:get-parameter name="foo"/>

At 13:05 30/04/2003 +0200, you wrote:
>I just want to create a link with the same address, but with a ".beta"
>after the address and before the parameter.
>I tried to use
>
>   <xsp-request:get-uri/>.beta
>
>But I get new_page.beta without the parameter...
>
>
>-----Original Message-----
>From: Lionel Crine [mailto:crine@4dconcept.fr]
>Sent: Wednesday, April 30, 2003 12:26 PM
>To: cocoon-users@xml.apache.org
>Subject: Re: XSP : get and modify URL
>
>
>The URL parameter is coming from an XML file ?
>
>for example : <url>new_page?myID=5</url>
>or <url>new_page</url> and he parameter is appending after.
>
>
>Here is how I get the url parameters to create a new URL with an XSP :
>
><xsp:page xmlns:xsp="http://apache.org/xsp"
>            xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>            xmlns:xsp-session="http://apache.org/xsp/session/2.0"
>            create-session="true">
>
><xsp:structure>
>    <xsp:include>java.util.Enumeration</xsp:include>
>    <xsp:include>java.util.Vector</xsp:include>
>    <xsp:include>java.lang.*</xsp:include>
>    <xsp:include>java.lang.String.*</xsp:include>
>    <xsp:include>java.lang.Byte.*</xsp:include>
></xsp:structure>
>
><page>
>
><xsp:logic>
>Enumeration enum = request.getParameterNames();
>Vector tempVector = new Vector();
>          while (enum.hasMoreElements()) {
>                  tempVector.add(enum.nextElement());
>          }
>Vector values = new Vector(tempVector.size());
>
>for (int i = 0; i  &lt; tempVector.size(); i++) {
>
>
>   values.addElement(request.getParameter((String)
>tempVector.elementAt(i)));
>}
></xsp:logic>
>
>    <content>
>          <link>search?<xsp:logic>for(int i=0;i &lt;
>values.size();i++){</xsp:logic><xsp:expr>(String)tempVector.elementAt(i)
></xsp:expr>=<xsp:expr>(String)values.elementAt(i)</xsp:expr><xsp:logic>i
>f(i
>&lt; values.size()-1){</xsp:logic>&amp;<xsp:logic>}}</xsp:logic>
>          </link>
>    </content>
>   </page>
></xsp:page>
>
>
>But this XSP create an new URL. the thing is that you want to get the
>url
>dynamically like in an xsl.
>
>
>You may also create an xsl stylesheet and put some xsp tag in it.
>
>Anyway, I hope my example can give you some hints.
>
>Lionel
>
>
>
>
>
>At 11:45 30/04/2003 +0200, you wrote:
> >Hi,
> >On a page I have a URL like : new_page?myID=5
> >and I want to have an href with -> new_page.beta?myID=5
> >
> >How can I do this???
> >
> >Thanks a lot
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> >For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


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


Mime
View raw message