Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

color preference test revisit

hi!

This question is continous of the follwoing question.
+++++++++++
I made a “color preference” form that collects the user’s preferred foreground and background colors and send the data to a JSP page that displays come message using those colors. if the user fails to supply either of the colors, use whatever value they gave last time. If there was no previous value, then use a default.
So, if the user goes directly to the JSP page (bypassing the form), the JSP page should still work fine.
+++++++++++
If I redo the color preference example and if the user fails to supply any of the parameters, use whatever color the most recent user gave last time. could this give any bad results?
0
dkim18
Asked:
dkim18
  • 3
1 Solution
 
bloodredsunCommented:
>> could this give any bad results?

unless you define a default value, you could end up with nulls. All you have to do is check for the users preference on colors then the wordt taht could happen would be that your users could be presented with a ugly color to punish them for not selecting a color ;-)

In short, even if you get a null, it will output "null" which is the same as "black", so that's the worst that can happen.

0
 
bloodredsunCommented:
And I've suggested a solution in your other post...
0
 
bloodredsunCommented:
thanks
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now