Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to nest tags?

 
Meyer Florian
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there!
I want to do somethink like this:
<html:text property="street" size="40" maxlength="40" <logic resent name="street" scope="request">value="<bean:write property="street" scope="request" />"</logic resent> />
In words: A Test field. If there is an attribute called "street" in the request, the value of the annribute should be set as the value to the text field.
I think that this is just a normal thing for a struts user...
Thanks in advance!
Florian
 
Meyer Florian
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, without smileys:
Hey there!
I want to do somethink like this:
<html:text property="street" size="40" maxlength="40" <logic:present name="street" scope="request">value="<bean:write property="street" scope="request" />"</logic:present> />
In words: A Test field. If there is an attribute called "street" in the request, the value of the annribute should be set as the value to the text field.
I think that this is just a normal thing for a struts user...
Thanks in advance!
Florian
 
Meyer Florian
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or maybe I should ask in another way:
I have a jsp page with textfields, their names are: lastname, firstname, street, number, zip, city, country
If the request is empty, the textfields should be shown empty.
If the request contains attributes, their names are exactly the same ones as the names of the text fields.
is there a way to automate filling in the values of textfields if the attributes have the same name as the textfields?
Thanks!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure your html:text tag is within a html:form tag. That maps the form to your bean. Then you do what you did in your example, but you leave out the value attribute. Since the form is associated with your bean, the value will get filled in automatically.
 
Emilio Butrage´┐Żo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd avise using JSTL, it will save you lots of time, and looks easier to the eye!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic