You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@jline.com on 2001/05/08 23:24:13 UTC

html:text default values? how?

i would like to assign a default value to an <html:text> element, such
as when the form is initially displayed. a very simple example is such
as with a login.jsp page. i would like to populate the username field
with a default value passed in as a request parameter.

the request would look like http://blah/www/login.jsp?username=testme
and the username field would get the default value. 

however, none of the following work for login.jsp:

<html:form ...>
  Username: <html:text property="username" value="<%= request.getParameter("username") %>"/>
</html:form>

I get a JspTagException for some strange reason.

or

<html:form ...>
  Username: <html:text property="username"><%= request.getParameter("username") %></html:text>
</html:form>

actually, looking at the tag code, i don't see any support at all for
handling bodycontent.

anyway, i'm wondering if i'm missing something. it seems like such a
simple thing to support, and i'm doubtful that it's just an
oversight.

thanks for any info.

jae