On a webapp where we often need to condition some server logic based on the page that is going to be returned to the user.
code like this
Does anyone have a better solution?
Code:
[FONT=Calibri][I][FONT=Tahoma][COLOR=#333333]public class PageCodes {
public static final String FOF "FOF";
public static final String FOMS = "FOM";
public static final String BKG = "BKG";
public static final String ITC = "ITC";
public static final String PUR = "PUR";
// etc..
}[/COLOR][/FONT][/I][/FONT]
Code:
[FONT=Calibri][I][FONT=Tahoma][COLOR=#333333]if (PageCode.PUR.equals(destinationPageCode) || PageCodes.ITC.equals(destinationPageCode)) {
// some code with no obvious intent
}[/COLOR][/FONT][/I]
[I][FONT=Tahoma][COLOR=#333333]if (PageCode.FOF.equals(destinationPageCode) || PageCodes.FOM.equals(destinationPageCode)) {
// some other code with no obvious intent either
}[/COLOR][/FONT][/I][/FONT]
Comment