Title: RE: html:text default values? how?

Why don't you use Struts and the MVC design pattern?  You should have an action class that populates your form bean, then forwards to login.jsp.  Struts will get the value from the form bean and display it on your page.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 2:24 PM
To: [EMAIL PROTECTED]
Subject: 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

Reply via email to