File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

format in a text field

 
Mathur Neni
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have gone through the message and replies regarding - "How to Use bean:write inside html:text". But I couldn't trace out the solution to my problem from that.
I got a field (and defined the property in DynaValidatorForm) which is of type java.util.Date and this is being populated in the action class. I want to store this in a text field.
I think the following is not possible.
<html:text property="mydt"
value="
<bean:write name="form" property="mydt" format="mm/yyyy" />
" />
If I am trying this, it displays fine with the format
<bean:write name="form" property="mydt" format="mm/yyyy" />
But how to format the date in a text box??
Is it possible to access a dynavalidatorform property in jsp Scriplets?
 
Nimchi Yung
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that you cannot have a start a new tag
as an attribute of another tag.
There are a few solutions to that.
1) Use scriptlet
2) Use struts-el tag
3) Or

--Nimchi
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Struts,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Mathur Neni
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nimchi,
Is it possible to access a dynavalidatorform property in jsp Scriplets?
Thanks in advance.
Mathur
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First you get a reference to a form. You can do something like this in a scriptlet:
myForm = request.getAttribute("formNameFromStrutsConfig")
(Change request to session if it is in session scope.)
And then you can call the methods on the form reference from your jsp scriptlets.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic