(This is my last comment on this thread)

Like Richard said, if the hidden field is not part of that particular form
you'll see an error/exception.  The syntax I'd recommended was to insert a
hidden field IF the data you want to display (that "regularPlan" field) is
from another stored Form (such as a previously used form saved in Session
scope).

At this point I am voting with Richard that you hard-code your variable
using ordinary html, not the struts html taglibs, to be sure you have the
variable in the correct place AND you learn how to read it (as Richard
clearly outlined) in your receiving Action.

Regards,
David

-----Original Message-----
From: Richard Yee [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 08, 2005 1:28 PM
To: Struts Users Mailing List
Subject: RE: Putting a field into the REQUEST


If the hidden field is not part of the form, then you don't want to use the
html:hidden tag in your JSP page, you want to use the plain <input
type="hidden" name="regularPlan" value="xxx"/> and then use
request.getParameter("regularPlan" in your Action class to get it.

-Richard


At 10:57 PM 1/6/2005, you wrote:
>HI David,
>Moreover when I tried to create a hidden field in this manner
>It showed up an error. /acctmgmt/updatePlanProfileContent.jsp(159):
>required attribute 'property' not specified for tag 'hidden' probably
>occurred due to an error in /acctmgmt/updatePlanProfileContent.jsp line
>159: Regards Krishna Mohan -----Original Message----- From: David G.
>Friedman [mailto:[EMAIL PROTECTED] Sent: Friday, January 07, 2005
>11:20 AM To: Struts Users Mailing List Subject: RE: Putting a field into
>the REQUEST Krishan, The error code you gave and the description of the
>problem do not match. If your code only works when you do this: <%
>request.setAttribute("regularPlan","true"); %>' Then you cannot be using
>this tag: But something more like this: Why? Because skipping the
>"name=..." attribute forces the tag to use the current ActionForm
>specified by the html:form tag you are enclosing everything within. If you
>use the name field, it looks for an object in the various scopes (page,
>request, session, attribute) matching that name and tries to retrieve it's
>value). I've used this before to essentially "import" fields into a form
>for submittal to a new Action. See the manual for the html taglib
>(specifically html:hidden) for more detail:
>http://struts.apache.org/userGuide/struts-html.html#hidden Regards, David
>-----Original Message----- From: Krishna Mohan Radhakrishnan
>[mailto:[EMAIL PROTECTED] Sent: Friday, January 07, 2005 12:13
>AM To: Struts Users Mailing List Subject: RE: Putting a field into the
>REQUEST Hi David, Thanx it is working. But my original problem still
>exists. The request does not contain this field. But if I am using a java
>scriptlet like <% request.setAttribute("regularPlan","true"); %>Then it is
>working I want to do a similar operation in struts. Any idea? Regards,
>Krishna Mohan -----Original Message----- From: David G. Friedman
>[mailto:[EMAIL PROTECTED] Sent: Friday, January 07, 2005 10:37 AM To:
>Struts Users Mailing List Subject: RE: Putting a field into the REQUEST
>Try a closing slash so your line: Becomes:
>................................................^^^ Regards, David
>-----Original Message----- From: Krishna Mohan Radhakrishnan
>[mailto:[EMAIL PROTECTED] Sent: Thursday, January 06, 2005 11:55
>PM To: Struts Users Mailing List Subject: Putting a field into the REQUEST
>Hi all, Could any body tell me why does this error occur?
>/acctmgmt/updatePlanProfileContent.jsp(159): The TLD description for tag
>'hidden' requires that the body be empty. probably occurred due to an
>error in /acctmgmt/updatePlanProfileContent.jsp line 159: I wanted to set
>a hidden field in the updatePlanProfileContent.jsp, so that while
>submitting it is available in the request. I tred with a simple HTML input
>type tag and stil it is not set in the request. Please somebody tell me
>how to put a value into the request object through Struts tags or via
>simple HTML tags. Regards, Krishna Mohan
>--------------------------------------------------------------------- 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]



---------------------------------------------------------------------
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]

Reply via email to