• 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

Struts select convert null to 0

 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I have Task's combo box on Jsp page (struts framework),
one of the tasks is Dummy task with null ID (don't do anything task).
The problem occur when i select this task - struts put 0 (Long) on the selectedTaskId instead of null.

Is it possible to make the struts-select change this behavior?

list :
taskId taskName
null don't do anything
1 remove all files task
2 remove all .temp files
3 backup all files



[ March 27, 2008: Message edited by: Sharon whipple ]
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont think struts will populate a null value.

null don't do anything



Not an answer to your question . Still why cant you change the logic to

if 0 - don't do anything??

or else , check if value is 0 set null to it .
[ March 27, 2008: Message edited by: Ranjit Gopinathan ]
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess I could check if its 0 and convert it to null,
anyway this behavior is strange,

Thank you
Sharon
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic