The procedure governing applications to adduce bad character is set out in Part 35 of the Criminal Procedure Rules ('CPR') (
http://www.justice.gov.uk/courts/procedure-rules/criminal/docs/2012/crim-proc-rules-2013-part-35). The grounds on which a defendant's bad character can be adduced are listed in s.101(1) of the Criminal Justice Act 2003 ('CJA 2003') (
http://www.legislation.gov.uk/ukpga/2003/44/section/101). Other relevant law and procedure is set out in the surrounding sections.
Generally speaking the prosecution will serve a notice on the defendant in advance of the trial that they wish to adduce his bad character. The defence must then either accept that the evidence is admissible or serve a notice objecting to its introduction.
If the defendant does not object to its introduction there will be no need for a determination by the court at all. If he does object then the court may either hear the application at a hearing (either in public or in private - but always in the absence of the jury) or may deal with the application on the papers only (CPR rule 35.4(6)(a)). However, CPR rule 35.5 and CJA 2003 s.110 require that the court
must give its reasons at a public hearing in any event, so in practice contested bad character applications are always dealt with at a hearing, though the parties may have served skeleton arguments in advance meaning there need be very little oral advocacy. As with most criminal applications the judge or magistrate will simply give their ruling immediately, though they may retire to consider it first.
I'm not entirely certain about precisely what you are asking, but it sounds like you are questioning whether it is usual for a defendant to have had no notice of the prosecution's intention to apply to adduce his bad character. For the reasons set out above this will rarely be so, as the prosecution will have served advance notice, even if this is only very shortly before the hearing.
The main exception to this procedure is when a defendant has brought in his bad character at trial by making an attack on another person's character, or it is adduced in order to correct a false impression given by him (see s.101(1)(g) and (f) CJA 2003). In such circumstances there will have been no opportunity to serve advance notice as the grounds for adducing the bad character will have only just arisen. Instead, usually just after the defendant has finished giving evidence, but potentially at any time during the prosecution or defence case, the prosecution barrister will simply announce their intention to make an application. This will often just be dealt with there and then, though the judge may choose to adjourn the matter to enable the defence to prepare a response.
I hope this clears things up for you, if this wasn't quite what you were asking let me know and I'll try to help.