You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "K. Rumman Akhter" <ka...@sputnik7.com> on 2000/03/02 21:00:26 UTC

RE: User input in xsps

Hi,
I am trying to make an XSP user inferface for my browser-based application.
what i want to do is enter some data from a form to a  session so that all
states of user-interface has access to the same data. i am completely stuck
on how to do that. specifically what i want to know is how to enter form
data into a session object. please, and pointers or suggestions will be
highly appreciated.

Rumman


RE: User input in xsps

Posted by "K. Rumman Akhter" <ka...@sputnik7.com>.
PERFECT!!!
thanks,
RUmman

-----Original Message-----
From: Mike Engelhart [mailto:mengelhart@earthtrip.com]
Sent: Thursday, March 02, 2000 4:45 PM
To: cocoon-users@xml.apache.org
Subject: Re: User input in xsps


K. Rumman Akhter wrote:

> i guess my question would be, what is the equavalent syntax of
> request.getParameter("foo"); and request.putValue(); as in XSPs.
> RUmman
The xsp processor includes wrappers for all those objects and predefines the
variables for many of them.  i'm not sure what you mean by syntax??  The XSP
documentation explains all of this in detail...
http://xml.apache.org/cocoon/xsp.html

Here's a simple example though:

<?xml version="1.0"?>

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="yoursheet.xsl" type="text/xsl"?>

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
    <DOCUMENT>
        <xsp:logic>
            session = request.getSession(true);
            String myFormVariable = request.getParameter("MYFORMVARIABLE");
            session.putValue("VAR1", myFormVariable);
        </xsp:logic>
    </DOCUMENT>
</xsp:page>

If you're using tomcat or some other JSDK 2.2 compliant servlet engine, use
session.setAttribute("VAR1", myFormVariable)

session.putValue() is deprecated in 2.2

Mike


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


Re: User input in xsps

Posted by Mike Engelhart <me...@earthtrip.com>.
K. Rumman Akhter wrote:

> i guess my question would be, what is the equavalent syntax of
> request.getParameter("foo"); and request.putValue(); as in XSPs.
> RUmman
The xsp processor includes wrappers for all those objects and predefines the
variables for many of them.  i'm not sure what you mean by syntax??  The XSP
documentation explains all of this in detail...
http://xml.apache.org/cocoon/xsp.html

Here's a simple example though:

<?xml version="1.0"?>

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="yoursheet.xsl" type="text/xsl"?>

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
    <DOCUMENT>
        <xsp:logic>
            session = request.getSession(true);
            String myFormVariable = request.getParameter("MYFORMVARIABLE");
            session.putValue("VAR1", myFormVariable);
        </xsp:logic>
    </DOCUMENT>
</xsp:page>

If you're using tomcat or some other JSDK 2.2 compliant servlet engine, use
session.setAttribute("VAR1", myFormVariable)

session.putValue() is deprecated in 2.2

Mike


RE: User input in xsps

Posted by "K. Rumman Akhter" <ka...@sputnik7.com>.
i guess my question would be, what is the equavalent syntax of
request.getParameter("foo"); and request.putValue(); as in XSPs.
RUmman

-----Original Message-----
From: Mike Engelhart [mailto:mengelhart@earthtrip.com]
Sent: Thursday, March 02, 2000 3:48 PM
To: cocoon-users@xml.apache.org
Subject: Re: User input in xsps


K. Rumman Akhter wrote:

> Hi,
> I am trying to make an XSP user inferface for my browser-based
application.
> what i want to do is enter some data from a form to a  session so that all
> states of user-interface has access to the same data. i am completely
stuck
> on how to do that. specifically what i want to know is how to enter form
> data into a session object. please, and pointers or suggestions will be
> highly appreciated.
>
> Rumman
Take a look at the Servlet API documentation.
http://java.sun.com/products/servlet/2.2/javadoc/index.html

You really need an understanding of servlets to use an XSP to do this.

Once you have servlets understood, all the concepts are the same (except
that you'll be using XML and XSL rather than outputting HTML directly).

Mike


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


Re: User input in xsps

Posted by Mike Engelhart <me...@earthtrip.com>.
K. Rumman Akhter wrote:

> Hi,
> I am trying to make an XSP user inferface for my browser-based application.
> what i want to do is enter some data from a form to a  session so that all
> states of user-interface has access to the same data. i am completely stuck
> on how to do that. specifically what i want to know is how to enter form
> data into a session object. please, and pointers or suggestions will be
> highly appreciated.
> 
> Rumman
Take a look at the Servlet API documentation.
http://java.sun.com/products/servlet/2.2/javadoc/index.html

You really need an understanding of servlets to use an XSP to do this.

Once you have servlets understood, all the concepts are the same (except
that you'll be using XML and XSL rather than outputting HTML directly).

Mike