• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

How to nest tags?

 
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!
 
author & internet detective
Posts: 39435
768
Eclipse IDE VI Editor Java
  • 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.
 
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!
 
See where your hand is? Not there. It's next to this tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!