aspose file tools*
The moose likes Struts and the fly likes Struts select convert null to 0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts select convert null to 0" Watch "Struts select convert null to 0" New topic
Author

Struts select convert null to 0

Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
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

Joined: Jul 03, 2007
Posts: 46
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

Joined: Jul 31, 2003
Posts: 294
I guess I could check if its 0 and convert it to null,
anyway this behavior is strange,

Thank you
Sharon
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts select convert null to 0
 
Similar Threads
Uninitialize a property when unselecting data from html:optionsCollection
html:select problem-------
Struts help, logic:notEqual and ArrayList size()
How to pass attribute to a custom tag only if it evaluates to a non null value
dynamic value to be submitted to form beans