aspose file tools*
The moose likes Struts and the fly likes How to nest tags? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to nest tags?" Watch "How to nest tags?" New topic
Author

How to nest tags?

Meyer Florian
Ranch Hand

Joined: Oct 20, 2003
Posts: 62
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

Joined: Oct 20, 2003
Posts: 62
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

Joined: Oct 20, 2003
Posts: 62
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30546
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Emilio Butrage´┐Żo
Greenhorn

Joined: Mar 05, 2004
Posts: 8
I'd avise using JSTL, it will save you lots of time, and looks easier to the eye!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to nest tags?