You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nesto <ne...@libero.it> on 2003/02/04 11:00:33 UTC

Parameters to a JSP page

Hi to everyone!
I'm a newbie of Cocoon and I have a problem with parameters of a Jsp.
I don't know how I can pass a set of parameters to a jsp from a html-form.
I'll explain my problem better:
I have a form in a html page generated through Cocoon (xml->xsl->html). This is a login page, 
and there are two parameters: username and password.
I have to pass them to a jsp page that queries a database and generate dynamic data for the specific user.

I read the documentation, and I think I have to use actions, but my attemps of doing it failed.

Does someone can explain me how I can do it? 
If you know how do it, please, give me some hints, or pieces of sitemap that helps me to resolve my problem.


I use Cocoon 2.0.4 on Tomcat 4.1.18.
I have to use the JSPs because is a part of an existing system.

Thanks to everyone and sorry for my english!
Regards,

Nesto

AW: Parameters to a JSP page

Posted by Marco Rolappe <m_...@web.de>.
hi nesto,

I assume that the JSP knows how to handle the parameters.

you don't really have to process the parameters (via actions, matchers,
whatever), since you said you are generating an html form.

so, in the generated form there should be something like this:

...
<form method="get" action="db-query.jsp">
    ...
    <input name="username"/>
    <input name="password"/>
    ...
</form>

so, when the user submits the form, the db-query.jsp (or whatever the actual
URL is) gets invoked with the request parameters username and password.

  -----Ursprüngliche Nachricht-----
  Von: cocoon-users-return-46088-m_rolappe=web.de@xml.apache.org
[mailto:cocoon-users-return-46088-m_rolappe=web.de@xml.apache.org]Im Auftrag
von Nesto
  Gesendet: Dienstag, 4. Februar 2003 11:01
  An: cocoon-users@xml.apache.org
  Betreff: Parameters to a JSP page


  Hi to everyone!
  I'm a newbie of Cocoon and I have a problem with parameters of a Jsp.
  I don't know how I can pass a set of parameters to a jsp from a html-form.
  I'll explain my problem better:
  I have a form in a html page generated through Cocoon (xml->xsl->html).
This is a login page,
  and there are two parameters: username and password.
  I have to pass them to a jsp page that queries a database and generate
dynamic data for the specific user.

  I read the documentation, and I think I have to use actions, but my
attemps of doing it failed.

  Does someone can explain me how I can do it?
  If you know how do it, please, give me some hints, or pieces of sitemap
that helps me to resolve my problem.


  I use Cocoon 2.0.4 on Tomcat 4.1.18.
  I have to use the JSPs because is a part of an existing system.

  Thanks to everyone and sorry for my english!
  Regards,

  Nesto