> -----Original Message----- > From: Krishna Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 06, 2005 11:55 PM > To: Struts Users Mailing List > Subject: RE: Putting a field into the REQUEST > > > Hi David, > > My problem is that there is a JSP called updatePlanProfileContent.jsp > I submit this JSP to a action class named SavePlanProfileAction.java. > There is a hidden field called regularPlan in the JSP which is not > related to any form. > I just want to retrieve the value of this hidden field in the > SavePlanProfileAction.java. > > In the SavePlanProfileAction.java I want to retrieve the value of the > hidden field.
request.getParameter( "hiddenFieldName"); However you are better off making it part of a form, so you don't have to do that. > > Sounds very simple. But since I am newbie I am unable to get > a solution > > 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: > <html:hidden property="regularPlan" value="true" /> > > But something more like this: > <html:hidden name="regularPlan" .... /> > > 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: > <html:hidden property="regularPlan" value="true"> > > Becomes: > <html:hidden property="regularPlan" value="true" /> > ................................................^^^ > > 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: > <html:hidden property="regularPlan" value="true"> > > 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]