RE: HELP! get request parameter from a custom tag

2003-02-14 Thread Johan Kumps
This code snippet should do the job.

String value = pageContext.getRequest().getParameter(paramname);

Kind regards

-Oorspronkelijk bericht-
Van: Kevin Williams [mailto:[EMAIL PROTECTED]]
Verzonden: zaterdag 15 februari 2003 0:23
Aan: [EMAIL PROTECTED]
Onderwerp: HELP! get request parameter from a custom tag


 Hi,

I apologize if this already was posted...I posted this earlier today, but
did not get see it posted...

If anyone can help me with this, it's stopping me from finishing key
portions of my applicaiton!

 I'm new to struts, and I am trying to retrieve a parameter that is in
 the request scope from a tag library.  Currently, I can print out the
 parameter on my jsp page using request.getParameter(name), but in my
 pageContext object in my tag library, I don't have the same list or
 request paramters, all I have are the Struts Form object, Bean object,
 and Error object.

 Somewhere Struts has overriden the default request object, and
 implemented it's own before my custom tag is called.  Would someone
 please tell me how I can retrieve the JSP page's request attributes in my
custom tag?

 Thanks in advance,

 Kevin Williams




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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003

---
This mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




RE: HELP! get request parameter from a custom tag

2003-02-14 Thread Damm, Gary
There's a tag for this in the struts bean taglib.  Bean:parameter Check
it out:

http://jakarta.apache.org/struts/userGuide/struts-bean.html#parameter

Gary

-Original Message-
From: Kevin Williams [mailto:[EMAIL PROTECTED]] 
Sent: Friday, February 14, 2003 3:23 PM
To: [EMAIL PROTECTED]
Subject: HELP! get request parameter from a custom tag

 Hi,

I apologize if this already was posted...I posted this earlier today,
but
did not get see it posted...

If anyone can help me with this, it's stopping me from finishing key
portions of my applicaiton!

 I'm new to struts, and I am trying to retrieve a parameter that is in
 the request scope from a tag library.  Currently, I can print out the
 parameter on my jsp page using request.getParameter(name), but in my
 pageContext object in my tag library, I don't have the same list or
 request paramters, all I have are the Struts Form object, Bean object,
 and Error object.

 Somewhere Struts has overriden the default request object, and
 implemented it's own before my custom tag is called.  Would someone
 please tell me how I can retrieve the JSP page's request attributes in
my
custom tag?

 Thanks in advance,

 Kevin Williams




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


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




RE: HELP! get request parameter from a custom tag

2003-02-14 Thread Kevin Williams
Doh!  It's amazing how hard it is to retrieve when you call getAttribute
instead of getParameter!

THANK YOU!

 This code snippet should do the job.

 String value = pageContext.getRequest().getParameter(paramname);

 Kind regards

 -Oorspronkelijk bericht-
 Van: Kevin Williams [mailto:[EMAIL PROTECTED]]
 Verzonden: zaterdag 15 februari 2003 0:23
 Aan: [EMAIL PROTECTED]
 Onderwerp: HELP! get request parameter from a custom tag


  Hi,

 I apologize if this already was posted...I posted this earlier today,
 but did not get see it posted...

 If anyone can help me with this, it's stopping me from finishing key
 portions of my applicaiton!

  I'm new to struts, and I am trying to retrieve a parameter that is in
 the request scope from a tag library.  Currently, I can print out the
 parameter on my jsp page using request.getParameter(name), but in my
 pageContext object in my tag library, I don't have the same list or
 request paramters, all I have are the Struts Form object, Bean object,
 and Error object.

  Somewhere Struts has overriden the default request object, and
  implemented it's own before my custom tag is called.  Would someone
 please tell me how I can retrieve the JSP page's request attributes in
 my
 custom tag?

  Thanks in advance,

  Kevin Williams




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


 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003

 ---
 This mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.454 / Virus Database: 253 - Release Date: 10/02/2003


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




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




Re: HELP! get request parameter from a custom tag

2003-02-14 Thread Craig R. McClanahan


On Fri, 14 Feb 2003, Kevin Williams wrote:

 Date: Fri, 14 Feb 2003 15:22:47 -0800 (PST)
 From: Kevin Williams [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: HELP! get request parameter from a custom tag

  Hi,

 I apologize if this already was posted...I posted this earlier today, but
 did not get see it posted...

 If anyone can help me with this, it's stopping me from finishing key
 portions of my applicaiton!

  I'm new to struts, and I am trying to retrieve a parameter that is in
  the request scope from a tag library.  Currently, I can print out the
  parameter on my jsp page using request.getParameter(name), but in my
  pageContext object in my tag library, I don't have the same list or
  request paramters, all I have are the Struts Form object, Bean object,
  and Error object.

  Somewhere Struts has overriden the default request object, and
  implemented it's own before my custom tag is called.  Would someone
  please tell me how I can retrieve the JSP page's request attributes in my
 custom tag?


Struts does not (and indeed *can* not in a Servlet 2.2 / JSP 1.1
environment) override the request object.  I suspect you might be getting
confused between request *parameters* (things that came in on the original
request) and request *attributes* (things an Action might have put there).

From within a tag implementation, you can get to request parameters like
this:

  String foo = pageContext.getRequest().getParameter(foo);

While request attributes can be retrieved like this:

  String foo = pageContext.getAttribute(foo, PageContext.REQUEST_SCOPE);

Because you mentioned request scope, I'm betting that the latter is what
you really want to use.

  Thanks in advance,

  Kevin Williams

Craig

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