You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Graham Leggett <mi...@sharp.fm> on 2001/11/10 18:09:35 UTC

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?

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: reading POST data in a Tag - howto?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Sat, 10 Nov 2001, Graham Leggett wrote:

> Date: Sat, 10 Nov 2001 18:09:35 +0100
> From: Graham Leggett <mi...@sharp.fm>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat User <to...@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:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>