I'd just put a "returnTo" property on my form bean for C, have JSPs A and B pass returnTo as a parameter to C. Then the C action can return to either A or B based on the value of the parameter.
Another way to do this would be to define two different action mappings, (commentsA and commentsB) both of which call the C action class. Each mapping would have a local forward named "cancel". In commentsA, the forward would point to JSP A, and in commentsB, the forward would point to JSP B. That way, when the C action class returns the "cancel" forward, it goes to different JSPs depending on which action mapping invoked the class.