tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: reading POST data in a Tag - howto?
Date Sat, 10 Nov 2001 19:05:47 GMT


On Sat, 10 Nov 2001, Graham Leggett wrote:

> Date: Sat, 10 Nov 2001 18:09:35 +0100
> From: Graham Leggett <minfrin@sharp.fm>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat User <tomcat-user@jakarta.apache.org>
> Subject: reading POST data in a Tag - howto?
>
> Hi all,
>
> I am trying to get access to FORM POST data from a tag using taglib -
> unfortunately jakarta.apache.org is off the air and I cannot get access
> to the docs.
>
> Does anyone have a code snippet to show how this info (or at least the
> request object) is made available to tags?
>

This is actually a standard feature of JSP, not a Tomcat thing, so the
docs you want are the servlet and JSP API classes that are included with
Tomcat, or available at java.sun.com.

FORM POST data is available (if you submitted directly to a page) as
request parameters.  Therefore, you can access it from within a custom tag
just like you do in a servlet:

  public int doStart() throws JspException {
    ...

    HttpServletRequest hrequest =
      (HttpServletRequest) pageContext.getRequest();
    String name = request.getParameter("name");
    ...
  }

> Regards,
> Graham

Craig


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message