Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

attribute has no value

attribute has no value

attribute has no value

I’m having a problem retrieving a value from an application resource using a bean tag. I don’t have a problem referencing the tag when creating the input field. I’m getting an error, ‘JspTranslate: Attribute textarea.maxchar has no value’, when I use the tag to create a textarea. The code from the JSP follows:

<TR><TD> <input name=busPurposeLen type=text value="<bean:message key="textarea.maxchar" />" size=3 maxlength=3 readonly> characters available</TD></TR>

<TR><TD><html:textarea property="businessPurpose" cols="82" rows="4"
onchange="trim(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)"
                             onkeydown="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)"
                             onkeyup="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)" /><BR><BR></TD></TR>

I’m not sure why I’m getting the error using the html:textarea element.


RE: attribute has no value

It looks like you're nesting some double quotation marks which makes the textarea.maxchar look like it's outside the quotes.  That would make it look as if it's an attribute instead of the value of an attribute.

try either escaping your internal quotes with a backslash or using apostrophes around the outside and double quotes on the inside.


RE: attribute has no value

Thanks for your response. I've tried using apostrophes for the outside attributes and keeping the internal double quotes. I'm now getting a syntax error when the web page is loaded. The following is the new code from the JSP:

<TD><html:textarea property="businessPurpose" cols="82" rows="4"
                             onkeydown='textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar"/>)'
                             onkeyup='textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar"/>)' /><BR><BR></TD>

The line from the HTML source that is causing the syntax error is:
<TD><textarea name="businessPurpose" cols="82" rows="4" onkeydown="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar"/>)"
onkeyup="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar"/>)"></textarea><BR><BR></TD>

I understand the syntax error. The bean tag is being generated in the HTML instead of the value. Is there a way I can pass the value instead. I've also tried escaping the internal quotes but this causes another error.


RE: attribute has no value

It seems it doesn't recognize the bean tag... Have you included it in this JSP before using @taglib tag? I've been working for long with Struts and nowadays I still forget it some times... :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close