• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

format in a text field

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nimchi,
Is it possible to access a dynavalidatorform property in jsp Scriplets?
Thanks in advance.
Mathur
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic