Sreedhar:

Have you heard that you suppose to send only plain text emails on this
list?

About your question... Seems that logicsheet you build does not work
with dynamic parameters.

> still have a problem. What really needs to happen is that this
> value should get evaluated _before_ the java file is generated,

How can you *imaging* this?


> so the java file simply has something like in case
> 1 - SingerHelper() instead of the call to XSPRequestHelper.

You have to adapt your logicsheet to work with dynamic parameters
instead of passing static strings.

Vadim

-----Original Message-----
From: Sreedhar Chintalapaty [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 08, 2002 6:03 PM
To: Cocoon Users
Subject: RE: Tags: Passing dynamically generated values for parameters

Vadim, Chiths,
�
Thanks a lot for your advice. I apologize for the delayed reply - I was
off sick.
�
I tried your suggestions this morning and now, I am�able to use both
<gvsdb:list-people class="Singer"/> and
<gvsdb:list-people><class>Singer</class></gvsdb:list-people>.
�
However, I still have problems setting the value of "class" based on the
identically named request parameter. To illustrate:
�
1. When I 'statically' set "class":
�������XML:
���������� <gvsdb:list-people class="Singer"/> 
����������� OR 
����������� <gvsdb:list-people><class>Singer</class></gvsdb:list-people>
�
�������Relevant line in file "people_xml.java" generated by Cocoon
(_exactly_ as it appears in the file):
���������� InputSource __is =
������������� new InputSource(new StringReader(String.valueOf(
��������������������������������������������
((XMLGenerator.toXML(SingerHelper.getAll())).asXML()))));
�
2. When I dynamically set "class":
�������XML:
���������� <gvsdb:list-people><class><xsp-request.get-parameter
name="class"/></class></gvsdb:list-people>
�
�������Relevant line in file "people_xml.java" generated by Cocoon
(_exactly_ as it appears in the file):
����������� InputSource __is =
������������� new InputSource(new StringReader(String.valueOf(
�������������������������������������������� ((XMLGenerator.toXML(
(XSPRequestHelper.getParameter(
����������������������������������������������������������������������
objectModel, "class", null, null, null))
����������������������������������������������������������������������
Helper.getAll())).asXML()))));
�
�
I think the <xsp-request> tag is causing the linebreak between the
XSPRequestHelper.getParameter() and Helper and causing compilation
errors, because the compiler expects a closing parenthesis or comma
there. Even if there is a way to prevent the linebreak from appearing, I
think the compiler would still have a problem. What really needs to
happen is that this value should get evaluated _before_ the java file is
generated, so the java file simply has something like in case 1 -
SingerHelper() instead of the call to XSPRequestHelper.
�
Can this be done? 
�
However, I am pretty sure this will not cause problems in passing
parameters to methods using the <xsp-request> tag since the commas are
going to be there and we are ot expecting it to generate a class name
like in this example. 
�
Best Regards, 

Sreedhar
_______________________________________________________________________
A computer is like an Old Testament god, with a lot of rules and no
mercy 
�


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to