marciobarroso 12 de nov. de 2006
Uma dica para vc obter sua resposta mais rápido :
Use o campo assunto do novo post para descrever seu problema:
Ex.: Obter objeto da request usando WebWork e Velocity
[]'s
xenurb 13 de nov. de 2006
De outra forma:
public class GreetingInterceptor implements Interceptor {
public void init () { }
public void destroy () { }
public String intercept ( ActionInvocation invocation ) throws Exception {
Calendar calendar = Calendar . getInstance ();
int hour = calendar . get ( Calendar . HOUR_OF_DAY );
String [ b ] greeting [/ b ] = ( hour < 6 ) ? "Good evening" :
(( hour < 12 ) ? "Good morning" :
(( hour < 18 ) ? "Good afternoon" : "Good evening" ));
invocation . getInvocationContext (). getSession (). put ( "greeting" , greeting );
String result = invocation . invoke ();
return result ;
}
Como pegar o greeting e mostrar no jsp? Já pesquisei e nada! Sei como fazer para os form´s mas quando o valor vem do interceptor ... nao sei! Alguem sabe... ou é mesmo muito dificil? :shock: uuuu