• 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

How do i get form value in a local variable in the view JSP??

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have to display the dates of the cycle in the view,,
In my Action class, i set the Form values, in my view i have to display multiple records,, mite be for past 2-3 months, so there will be 6 records which i have to display, Along with the Data i have to display the dates of that cycle (1-15 and 16- end of month) ..
In my form, i am setting the cycleStartDate, i'll get this in my view,
Is there any by which i can get that cycleStartDate's value in a local variable in the JSP and display, cycle dates along with the data..
Any help would be highly appreciated,
Thanks,
~Shridhar..
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can get your form class with

when it is in the request. From session it is similar.
Olli
 
Shridhar. Blr.
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply..
Is there any other way , by which i can get the value of a form variable..
like ex:
String var = <nested:write property="propName"/> ;
I dont want to create an instance of the Form in my JSP/Struts page..
Thanks in Advance..
Shridhar..
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure if I'm following your post correctly, but here's what I think you're wanting to do.
First, do you have a getter method for "cycleStartDate" in the form bean like getCycleStartDate()? If so, then in your JSP try using a bean tag to localize the variable:

Then to write the date value in the appropriate format in the page:

HTH,
--
Josh
reply
    Bookmark Topic Watch Topic
  • New Topic