You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Frank Serkland <fh...@gmail.com> on 2011/02/25 23:17:25 UTC

Problem with s:hidden

I have the following form in my JSP.  The hidden field in this form,
which I have verified with the documentation as having correct syntax
as far as Struts 2 goes, is being marked by Eclipse with this error
message: "Invalid attribute (value)."  Can anybody help me with this?
Thanks.

<c:forEach var="bulletins" items="${bulletins}">
	<c:if test="${bulletins.approved == false}">
		<s:form action="ApproveBulletin" method="post">
			<table>
				<tr>
					<td colspan="2"><b>From:</b> <c:out value="${bulletins.name}" /></td>
				</tr>
				<tr>
					<td colspan="2"><b>Subject:</b> <c:out value="${bulletins.subject}" /></td>
				</tr>
				<tr>
					<td colspan="2"><b>Date:</b> <c:out value="${bulletins.date}" /> <br>
					</td>
				</tr>
				<tr>
					<td colspan="2"><c:out value="${bulletins.note}" />
<!-- Error here -->			<s:hidden name="id" value="${bulletins.id}" /></td>
				</tr>
				<tr>
					<td><s:submit type="button" value="approve" label="Approve"
						action="ApproveBuletin" /></td>
					<td><s:submit type="button" value="deny" label="Deny"
						action="DenyBulletin" /></td>
				</tr>
			</table>
			<br />
		</s:form>
	</c:if>
</c:forEach>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem with s:hidden

Posted by Kushan Jayathilake <ku...@gmail.com>.
just put a HTML hidden field, <input type="hidden" value="" />

or try <s:hidden name="id" id="#bulletins.id" />

On Sat, Feb 26, 2011 at 3:47 AM, Frank Serkland <fh...@gmail.com>wrote:

> I have the following form in my JSP.  The hidden field in this form,
> which I have verified with the documentation as having correct syntax
> as far as Struts 2 goes, is being marked by Eclipse with this error
> message: "Invalid attribute (value)."  Can anybody help me with this?
> Thanks.
>
> <c:forEach var="bulletins" items="${bulletins}">
>        <c:if test="${bulletins.approved == false}">
>                <s:form action="ApproveBulletin" method="post">
>                        <table>
>                                <tr>
>                                        <td colspan="2"><b>From:</b> <c:out
> value="${bulletins.name}" /></td>
>                                </tr>
>                                <tr>
>                                        <td colspan="2"><b>Subject:</b>
> <c:out value="${bulletins.subject}" /></td>
>                                </tr>
>                                <tr>
>                                        <td colspan="2"><b>Date:</b> <c:out
> value="${bulletins.date}" /> <br>
>                                        </td>
>                                </tr>
>                                <tr>
>                                        <td colspan="2"><c:out
> value="${bulletins.note}" />
> <!-- Error here -->                     <s:hidden name="id" value="${
> bulletins.id}" /></td>
>                                </tr>
>                                <tr>
>                                        <td><s:submit type="button"
> value="approve" label="Approve"
>                                                action="ApproveBuletin"
> /></td>
>                                        <td><s:submit type="button"
> value="deny" label="Deny"
>                                                action="DenyBulletin"
> /></td>
>                                </tr>
>                        </table>
>                        <br />
>                </s:form>
>        </c:if>
> </c:forEach>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Regards
Kushan Jayathilake

Re: Problem with s:hidden

Posted by st...@gmail.com.
The eclipse jsp validator is a worthless bag of bolts.
On Feb 25, 2011 4:17 PM, "Frank Serkland" <fh...@gmail.com> wrote:
>
> I have the following form in my JSP.  The hidden field in this form,
> which I have verified with the documentation as having correct syntax
> as far as Struts 2 goes, is being marked by Eclipse with this error
> message: "Invalid attribute (value)."  Can anybody help me with this?
> Thanks.
>
> <c:forEach var="bulletins" items="${bulletins}">
>        <c:if test="${bulletins.approved == false}">
>                <s:form action="ApproveBulletin" method="post">
>                        <table>
>                                <tr>
>                                        <td colspan="2"><b>From:</b> <c:out
value="${bulletins.name}" /></td>
>                                </tr>
>                                <tr>
>                                        <td colspan="2"><b>Subject:</b>
<c:out value="${bulletins.subject}" /></td>
>                                </tr>
>                                <tr>
>                                        <td colspan="2"><b>Date:</b> <c:out
value="${bulletins.date}" /> <br>
>                                        </td>
>                                </tr>
>                                <tr>
>                                        <td colspan="2"><c:out
value="${bulletins.note}" />
> <!-- Error here -->                     <s:hidden name="id" value="${
bulletins.id}" /></td>
>                                </tr>
>                                <tr>
>                                        <td><s:submit type="button"
value="approve" label="Approve"
>                                                action="ApproveBuletin"
/></td>
>                                        <td><s:submit type="button"
value="deny" label="Deny"
>                                                action="DenyBulletin"
/></td>
>                                </tr>
>                        </table>
>                        <br />
>                </s:form>
>        </c:if>
> </c:forEach>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

Re: Problem with s:hidden

Posted by Maurizio Cucchiara <ma...@gmail.com>.
As far as I can remember every struts tag support dynamic attributes, hence,
even if you write foo="bar" there is any tag library violation.
With that said, it should be work.

Maurizio Cucchiara

Il giorno 25/feb/2011 23.17, "Frank Serkland" <fh...@gmail.com> ha
scritto:
I have the following form in my JSP.  The hidden field in this form,
which I have verified with the documentation as having correct syntax
as far as Struts 2 goes, is being marked by Eclipse with this error
message: "Invalid attribute (value)."  Can anybody help me with this?
Thanks.

<c:forEach var="bulletins" items="${bulletins}">
       <c:if test="${bulletins.approved == false}">
               <s:form action="ApproveBulletin" method="post">
                       <table>
                               <tr>
                                       <td colspan="2"><b>From:</b> <c:out
value="${bulletins.name}" /></td>
                               </tr>
                               <tr>
                                       <td colspan="2"><b>Subject:</b>
<c:out value="${bulletins.subject}" /></td>
                               </tr>
                               <tr>
                                       <td colspan="2"><b>Date:</b> <c:out
value="${bulletins.date}" /> <br>
                                       </td>
                               </tr>
                               <tr>
                                       <td colspan="2"><c:out
value="${bulletins.note}" />
<!-- Error here -->                     <s:hidden name="id" value="${
bulletins.id}" /></td>
                               </tr>
                               <tr>
                                       <td><s:submit type="button"
value="approve" label="Approve"
                                               action="ApproveBuletin"
/></td>
                                       <td><s:submit type="button"
value="deny" label="Deny"
                                               action="DenyBulletin" /></td>
                               </tr>
                       </table>
                       <br />
               </s:form>
       </c:if>
</c:forEach>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org