Hello All,
I am using JSTL and html-el tags . I am new to the struts
and the tags. May be I am doing something unacceptable in struts.
Please help me.
My ActionForm has something like this :
public class TaskForm extends ActionForm {
/** @modelguid {C47413FB-A87F-4FE8-99DC-BF91B7DB531D} */
public AttachmentInfo[] attachmentList;
/**
* Returns the attachmentList.
* @return AttachmentInfo[]
*/
public AttachmentInfo[] getAttachmentList() {
return attachmentList;
}
/**
* Returns the attachment.
* @return AttachmentInfo
*/
public AttachmentInfo getAttachment(int index) {
return attachmentList[index];
}
/**
* Sets the attachment.
* @param attachment The action to set
*/
public void setAttachment(AttachmentInfo
attachment, int index) {
this.attachmentList[index] = attachment;
}
/**
* Sets the attachmentList.
* @param attachmentList The attachmentList to set
*/
public void setAttachmentList(AttachmentInfo[] attachmentList) {
this.attachmentList = attachmentList;
}
The array of attachmentList contains "AttachmentInfo" beans with "attID"
and "attName"
properties and the appropriate getters/setters.
public class AttachmentInfo {
public String attID;
public String attName;
/**
* Returns the attID.
* @return String
*/
public String getAttID() {
return attID;
}
/**
* Returns the attName.
* @return String
*/
public String getAttName() {
return attName;
}
/**
* Sets the attID.
* @param attID The attID to set
*/
public void setAttID(String attID) {
this.attID = attID;
}
/**
* Sets the attName.
* @param attName The attName to set
*/
public void setAttName(String attName) {
this.attName = attName;
}
}
On my JSP which has my TaskForm has the form for this JSP defined in
struts-config.xml, I have written the following code to loop through the
attachmentList and display a link to each attachment. When a user clicks
on a attachment the control is passed to attachment.do, and I want to
pass on a request parameter for this.
Something like this : ><a
href="/WFIGUI/attachment.do?attachmentID=123">. For this I have used
html:link tag's paramId and paramProperty.
<c:forEach items="${TaskForm.attachmentList}" var="attachmentList">
<tr>
<td><html-el:link page="/attachment.do" paramId="attachmentID"
paramProperty="${attachmentList.attID}"><c:out
value="${attachmentList.attName}"/></html-el:link></td>
</tr>
</c:forEach>
But when I run the JSP and on the browser , if I right click and do a
view source I get the following code.
<tr>
<td ><a href="/WFIGUI/attachment.do">Comments</a></td>
</tr>
I don't see the request parameters attached to the URL. Can someone
tell me what am I doing wrong. Thanks a lot for your help and time.
sincerely,
Sandhya
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]