Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts select convert null to 0

 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic