cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kieran Kirwan" <KKir...@dto.ie>
Subject RE: Accepting an input parameter
Date Wed, 13 Aug 2003 16:46:54 GMT
It's always a good idea to check that your parameter is being picked up by the XSP page before
applying the final XSL


I suggest you check the XML from yours XSP using the following sitemap entry:

<map:match pattern="login">
  <map:generate type="serverpages" src="xsp/login.xsp" label="debug1">
    <map:parameter name="parameters" value="true" />
  </map:generate>
  <map:serialize type="xml"/>
</map:match>


Make sure the parameter is called in your XSP
For example the following login.XSP in my sitemap
--------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?> 

<xsp:page language="java"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>

<page>
<USERID><xsp-request:get-parameter name="userid" default=" " as="string"/></USERID>
</page>

</xsp:page>
-------------------------------------------------------------------------------------------------------------

produces........

-------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?> 
- <page xmlns:xsp="http://apache.org/xsp" xmlns:xsp-request="http://apache.org/xsp/request/2.0">
  <USERID>11</USERID> 
  </page>
-------------------------------------------------------------------------------------------------------------

from		http://10.0.0.27:8080/cocoon/DTOapps/login1?userid=11




_____________________________________________
Kieran Kirwan
Executive Transportation Planner
Transportation Modelling Department
 
Dublin Transportation Office
Hainault House,
69/71 St. Stephen's Green,
Dublin 2,
Ireland.
Tel: +353 (0)1 4778113
Fax: +353 (0) 1 478 5935
website: www.dto.ie <http://www.dto.ie/>  
 



-----Original Message-----
From: Tim Bachta [mailto:tbachta@kopent.com]
Sent: 13 August 2003 15:32
To: users@cocoon.apache.org
Subject: RE: Accepting an input parameter


Cedric,

This is what my sitemap looks like now:
<map:match pattern="login">
  <map:generate type="serverpages" src="xsp/login.xsp" label="debug1">
    <map:parameter name="parameters" value="true" />
  </map:generate>
  <map:transform type="xslt" src="style/dialog.xsl" label="debug2">
    <map:parameter name="css-stylesheet" value="global.css"/>
    <map:parameter name="parameters" value="true" />
  </map:transform>
  <map:serialize type="html"/>
</map:match>


and my xsp is using

String userid =<xsp-request:get-parameter name="userid"
default="defaultinput" as="string"/>;

And my url is
http://localhost:8080/cocoon/test/login?userid=11

And I am still not getting the userid.  Am I doing something wrong
(obviously I am) Thanks for the help it is greatly appreciated.

Tim 

 

-----Original Message-----
From: Cedric Picard [mailto:C.Picard@kainos.com] 
Sent: Wednesday, August 13, 2003 9:06 AM
To: users@cocoon.apache.org
Subject: RE: Accepting an input parameter

Tim,

You need to pass the parameters to your xsp from the pipeline:

Example given:
     <map:pipeline>
       <map:match pattern="login">
           <!--=========================================================
           // use the value of param xspFile as the filename for the xsp
           //========================================================-->
           <map:generate type="serverpages" src="documents/{xspFile}">
 
<!--=========================================================
             // pass the parameter so xspFile is defined
 
//========================================================-->
             <map:parameter name="parameters" value="true" />
           </map:generate>
           <!--=========================================================
           // use the value of param xslFile as the filename for the xsl
           //========================================================-->
           <map:transform src="stylesheets/{xslFile}">
             <map:parameter name="parameters" value="true" />
           </map:transform>
           <map:serialize type="html" />
         </map:act>
       </map:match>
     </map:pipeline>

Hope that helps,
Cedric

-----Original Message-----
From: Tim Bachta [mailto:tbachta@kopent.com] 
Sent: 13 August 2003 14:58
To: users@cocoon.apache.org
Subject: Accepting an input parameter


I am calling a Cocoon page from another application using a <a href>
tag.  The url that I am calling is
http://localhost:8080/cocoon/test/login?userid=11
<http://localhost:8080/cocoon/test/login?userid=11> .  The problem I am
having is getting my xsp page to grab the value of the userid from the
input url.  How do I do this, I have tried using the
<xsp-request:get-parameter name="userid" default = "defaultinput"
as="string"/> but that does not work.  Do I need to add something to my
sitemap to pass that value through?  Can someone please help me, it
would be greatly appreciated.

 

Thanks

Tim 

 

 


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



--

This e-mail is confidential and is intended for the named recipient
only. If
you receive it in error please destroy the message and all copies.
Kainos
Software Ltd. does not accept liability for damage sustained as a result
of
malicious software (e.g. viruses). Kainos does not accept liability for,
or
permit, the creation of contracts on its behalf by e-mail, the
publication of
any defamatory statement by its employees by e-mail, or changes
subsequently
made to the original message. The Company's registered office is located
at
4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland, Tel +44 28 9057
1100.

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


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

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
Mail Marshal for the presence of computer viruses.

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


Mime
View raw message