This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem in html:text  /html:text input tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in html:text  /html:text input tag" Watch "Problem in html:text  /html:text input tag" New topic
Author

Problem in html:text /html:text input tag

mohsin sheikh
Greenhorn

Joined: Mar 28, 2007
Posts: 22
Hi all,
i am developing a project in struts.I have created a form that accepts date from user.I want a default value in date field i.e todays date.I am using
Create Date:<html:text property="createdate"> </html:text>
now when i am using "value" attribute in the above tag, then it is giving error.So tell me which attribute in the above tag should be used which will replace value attribute used in <input> tag.I want default value in create date tag as system date
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
What error did you get? It might be that you cannot have both a value and an ending tag. I did not see any mention in the document that I looked at but I would not be surprised if it uses the body of the tag as the value. Rather than set a default value in the JSP, I would rather set a default value in the form. In your example, if you set a default value for the createdate property then that will be shown with the page is displayed.

- Brent
Maya Thomas
Greenhorn

Joined: Mar 10, 2008
Posts: 3
I don't think setting the value attribute should produce an error.But, if you do want to initialize form fields, you could always do it in the Action class by setting the Actionform property for which you want to show the default. On other hand, you would have to use scriptlets if you do it from the JSP.

-Maya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in html:text /html:text input tag
 
Similar Threads
Struts 1 -- Wrong data displaying in my JSP page
&gt;html:text &lt; default value
problem with html:text prpperty value=bean:write
Question on html struts tag
struts