Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts select convert null to 0

 
Sharon whipple
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 ]
 
Ranjit Gopinathan
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic