You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vinicius Carvalho <ca...@superig.com.br> on 2004/01/16 12:42:14 UTC

html:errors breakline (version 2)

Sorry all! Eudora simply killed my text, sorry, heres the full version

     Hi there! I have a page that renders all my erros, called errors.jsp 
(duh!). What I'm trying to do is if the user's session has expired, I'll 
forward him using a javascript, after an alert: Here's how my code looks like:

<SCRIPT>
function sessionExpired(){
alert("<html:errors property="sessionExpiredString"/>");
top.frames.location="index.jsp";
}
function refreshScreen() {
<html:errors property="sessionExpiredFunction"/>
}
</SCRIPT>

Now, let's suppose the session has expired: the code displays this:

<SCRIPT>
         function sessionExpired(){
                 alert("
Session expired! Please login again!

");
                 top.frames.location="index.jsp";
         }
         function refreshScreen() {

sessionExpired();


         }
</SCRIPT>

As you can see, errors property sessionExpiredFunction writes the function 
to be called. and the
errosExpiredString, the warning string. Problem is, I have a new line, 
before and after it, invalidating my alert() method.
Any way to solve this? Or maybe a better solution for the problem?

Thanks

Vinicius


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org