Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Not getting the value of hidden field in stuts.......... Please Help.....!!

843840Feb 22 2008 — edited Feb 22 2008
I am sorry for posting this question again to this forum as I didn't get reply till now.
Hope some help I will get this time...!!!
I need to get the value of hidden field in action class, I am using struts..!!!

My JSP file is:
html:form action="/editBillingItem">
			<div align="center">
				<table border="0" width="75%" cellspacing="1">
					<tr>
						<td width="50%" class="evencell" style="color:black"><b><bean:message key="billingItem.name"/>     </b></td>
						<td width="50%" class="evencell" style="color:black"><b><bean:message key="billingItem.description"/></b></td>
					</tr>
					<logic:present name="billingItems">
						<logic:iterate id="billingItemManagerForm" name="billingItems">
						<tr>
							<td width="50%" class="oddcell">
								 <b><bean:write name="billingItemManagerForm" property="name"/></b>
							</td>
							<td width="50%" class="oddcell">
								 <b><bean:write name="billingItemManagerForm" property="businessDesc"/></b>
							</td>
							<td width="25%" class="oddcell">
								<bean:write name="billingItemManagerForm" property="billingItemId"/> <!-- I am able to print this value in jsp so passing the same as hidden field-->
								<html:hidden name="billingItemManagerForm" property="billingItemId"/>   
								<html:submit style="cursor:pointer"><bean:message key="button.edit"/></html:submit>  
							</td>
						</tr>
						</logic:iterate>
					</logic:present>
				</table>
			</div>
		</html:form>
Struts-config.xml
	<action path="/editBillingItem"
			type="com.cdr.billing.action.BillingItemManagerAction"
			parameter="edit"
			name="billingItemManagerForm"
			scope="request"
			input="/BillingItemList.jsp"
			validate="false">
			<forward name="success" path="/BillingItemCreate.jsp" />
	</action>
My Action class

if ("edit".equals(mapping.getParameter()))  { 				
	System.out.println ("-----billingItemId-->"+request.getParameter("billingItemId"));
	// OR
	System.out.println ("-----billingItemId-->"+request.getAttribute("billingItemId"));
	//Not getting this value.....!!!!!!!				
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2008
Added on Feb 22 2008
49 comments
2,596 views