You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by louis majanja <lo...@ironpulse.com> on 2003/03/13 19:03:57 UTC

not displaying messages

i have this in my actionForm:
ActionMessages messages = new ActionMessages();

   messages.add("message",
                  new ActionMessage("message.login.confirmation"));
  saveMessage(request,messages);

in my jsp i have

<html:messages />

it doesn't work, i have tried the following options which don't work
either

<html:messages message="true"/>

<html:messages id="msg" property="messages" message="true">
  <c:out value="${msg}"/>
</html:messages>

i don't get an error nor do i get any output 
im using struts release candidate 1.1

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


Re: not displaying messages

Posted by Ian Hunter <ih...@hunterweb.net>.
I'm stumped.  Are you using something like Sun ONE where you can trace
through your code and examine variables?  I would just suggest following
along through everything, from the Action to the JSP, seeing what happens to
the message resources.  It looks like it should work to me... :(

----- Original Message -----
From: "louis majanja" <lo...@ironpulse.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, March 13, 2003 2:35 PM
Subject: Re: <html:messages/> not displaying messages


> i am forwarding
>
> On Thu, 2003-03-13 at 11:14, Ian Hunter wrote:
> > Are you redirecting or forwarding to your JSP from that Action?
> > ----- Original Message -----
> > From: "louis majanja" <lo...@ironpulse.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Thursday, March 13, 2003 1:44 PM
> > Subject: Re: <html:messages/> not displaying messages
> >
> >
> > > that didn't work
> > >
> > > On Thu, 2003-03-13 at 10:18, Ian Hunter wrote:
> > > > Just to see if this gets you anywhere, do
> > > >
> > > > messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage
> > > > ("message.login.confirmation"));
> > > > saveMessages(request, response);
> > > >
> > > > then use
> > > >
> > > > <html:messages id="message" message="true">
> > > >     <bean:write name="message"/><br>
> > > > </html:messages>
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "louis majanja" <lo...@ironpulse.com>
> > > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > > Sent: Thursday, March 13, 2003 1:03 PM
> > > > Subject: <html:messages/> not displaying messages
> > > >
> > > >
> > > > > i have this in my actionForm:
> > > > > ActionMessages messages = new ActionMessages();
> > > > >
> > > > >    messages.add("message",
> > > > >                   new
ActionMessage("message.login.confirmation"));
> > > > >   saveMessage(request,messages);
> > > > >
> > > > > in my jsp i have
> > > > >
> > > > > <html:messages />
> > > > >
> > > > > it doesn't work, i have tried the following options which don't
work
> > > > > either
> > > > >
> > > > > <html:messages message="true"/>
> > > > >
> > > > > <html:messages id="msg" property="messages" message="true">
> > > > >   <c:out value="${msg}"/>
> > > > > </html:messages>
> > > > >
> > > > > i don't get an error nor do i get any output
> > > > > im using struts release candidate 1.1
> > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
struts-user-help@jakarta.apache.org
> > > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: not displaying messages

Posted by Rick Reumann <r...@reumann.net>.
 

This sounds silly, but I can't tell you how many times I forgotten to
include the taglib on the page and wondered why things wouldn't
print:).., Have you checked that you have the bean tag lib defined
on your page?

<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean"%> 
(Your location maybe different)
 
-- 
Rick Reumann

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


Re: not displaying messages

Posted by louis majanja <lo...@ironpulse.com>.
i am forwarding

On Thu, 2003-03-13 at 11:14, Ian Hunter wrote:
> Are you redirecting or forwarding to your JSP from that Action?
> ----- Original Message ----- 
> From: "louis majanja" <lo...@ironpulse.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, March 13, 2003 1:44 PM
> Subject: Re: <html:messages/> not displaying messages
> 
> 
> > that didn't work
> > 
> > On Thu, 2003-03-13 at 10:18, Ian Hunter wrote:
> > > Just to see if this gets you anywhere, do
> > > 
> > > messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage
> > > ("message.login.confirmation"));
> > > saveMessages(request, response);
> > > 
> > > then use
> > > 
> > > <html:messages id="message" message="true">
> > >     <bean:write name="message"/><br>
> > > </html:messages>
> > > 
> > > 
> > > ----- Original Message -----
> > > From: "louis majanja" <lo...@ironpulse.com>
> > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > Sent: Thursday, March 13, 2003 1:03 PM
> > > Subject: <html:messages/> not displaying messages
> > > 
> > > 
> > > > i have this in my actionForm:
> > > > ActionMessages messages = new ActionMessages();
> > > >
> > > >    messages.add("message",
> > > >                   new ActionMessage("message.login.confirmation"));
> > > >   saveMessage(request,messages);
> > > >
> > > > in my jsp i have
> > > >
> > > > <html:messages />
> > > >
> > > > it doesn't work, i have tried the following options which don't work
> > > > either
> > > >
> > > > <html:messages message="true"/>
> > > >
> > > > <html:messages id="msg" property="messages" message="true">
> > > >   <c:out value="${msg}"/>
> > > > </html:messages>
> > > >
> > > > i don't get an error nor do i get any output
> > > > im using struts release candidate 1.1
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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


Re: [XEN] Simple question: forward and redirect

Posted by Fabio Mancinelli <ma...@di.univaq.it>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 14 Mar 2003, Simon Kelly wrote:

> When you forward, you pass control to another class within your current
> application root context.
> 
> When you redirect, you can pass in or out of the context.
> 
What do you mean? Aren't we talking at the HTTP protocol level?
When you say "another class" do you mean another "WEB" object?
I mean, it should be possible to forward/redirect also to a PHP page,
shouldn't it?
The forward/redirect semantics is tied to the Java Framework that we are 
using or is it more general?

And what are the effect of enabling the redirect property of a 
struts action? 

A presto,
Fabio

- -- 
- -----------------------------------------------------------------------------
 Fabio Mancinelli, PhD student     EMail : mancinel@di.univaq.it
 Dipartimento di Informatica         WWW : http://www.di.univaq.it/~mancinel
 Universita' dell'Aquila    
- -----------------------------------------------------------------------------

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6

iD8DBQE+cbSO6dsQbk2R3cMRAmFZAKCjwio1kbnIRqz5oW4bw0g+q0d0pACgmO9m
H+VuLhfCBUUgNi9l0m5D3WA=
=U+8j
-----END PGP SIGNATURE-----



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


Re: [XEN] Simple question: forward and redirect

Posted by Simon Kelly <ke...@ipe.fzk.de>.
When you forward, you pass control to another class within your current
application root context.

When you redirect, you can pass in or out of the context.

Simon - "If I have this wrong, my site is well sha***d!!"


----- Original Message -----
From: "Fabio Mancinelli" <ma...@di.univaq.it>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, March 14, 2003 11:28 AM
Subject: [XEN] Simple question: forward and redirect


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 13 Mar 2003, Ian Hunter wrote:
>
> > Are you redirecting or forwarding to your JSP from that Action?
>
> What is the exact difference between forwarding and redirecting? What are
> their implications?
>
> I searched the Servlet and JSP specs but I haven't found nothing about
> that.
>
> A presto,
> Fabio
>
> - --
> - ------------------------------------------------------------------------
-----
>  Fabio Mancinelli, PhD student     EMail : mancinel@di.univaq.it
>  Dipartimento di Informatica         WWW :
http://www.di.univaq.it/~mancinel
>  Universita' dell'Aquila
> - ------------------------------------------------------------------------
-----
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: Made with pgp4pine 1.75-6
>
> iD8DBQE+ca7A6dsQbk2R3cMRAruyAKDTfVtCqtF13uyg+oDHw8NpfSIWrgCfa8RB
> FKSGdLso4sReqYrbCO2fkcE=
> =aSQr
> -----END PGP SIGNATURE-----
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Re: [XEN] Simple question: forward and redirect

Posted by Phil Steitz <ph...@steitz.com>.
Fabio Mancinelli wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Thu, 13 Mar 2003, Ian Hunter wrote:
> 
> 
>>Are you redirecting or forwarding to your JSP from that Action?
> 
> 
> What is the exact difference between forwarding and redirecting? What are 
> their implications?
> 
> I searched the Servlet and JSP specs but I haven't found nothing about 
> that.

Forward <=> RequestDispatcher.forward()
(http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/RequestDispatcher.html)

Redirect <=> HttpServletResponse.sendRedirect()
(http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServletResponse.html)

Big difference is that redirect sends an HTTP Response back the browser 
with a redirect header, generating a new request from the browser.  This 
  makes it in general slower and less efficient.  Also, the Request 
object (and anything that you have shoved into it) is not preserved.  On 
the other hand, redirect gives you control over the destination URL. 
Search the archives for full discussion.

hth,

Phil



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


[XEN] Simple question: forward and redirect

Posted by Fabio Mancinelli <ma...@di.univaq.it>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 13 Mar 2003, Ian Hunter wrote:

> Are you redirecting or forwarding to your JSP from that Action?

What is the exact difference between forwarding and redirecting? What are 
their implications?

I searched the Servlet and JSP specs but I haven't found nothing about 
that.

A presto,
Fabio

- -- 
- -----------------------------------------------------------------------------
 Fabio Mancinelli, PhD student     EMail : mancinel@di.univaq.it
 Dipartimento di Informatica         WWW : http://www.di.univaq.it/~mancinel
 Universita' dell'Aquila    
- -----------------------------------------------------------------------------

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6

iD8DBQE+ca7A6dsQbk2R3cMRAruyAKDTfVtCqtF13uyg+oDHw8NpfSIWrgCfa8RB
FKSGdLso4sReqYrbCO2fkcE=
=aSQr
-----END PGP SIGNATURE-----



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


Re: not displaying messages

Posted by Ian Hunter <ih...@hunterweb.net>.
Are you redirecting or forwarding to your JSP from that Action?
----- Original Message ----- 
From: "louis majanja" <lo...@ironpulse.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, March 13, 2003 1:44 PM
Subject: Re: <html:messages/> not displaying messages


> that didn't work
> 
> On Thu, 2003-03-13 at 10:18, Ian Hunter wrote:
> > Just to see if this gets you anywhere, do
> > 
> > messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage
> > ("message.login.confirmation"));
> > saveMessages(request, response);
> > 
> > then use
> > 
> > <html:messages id="message" message="true">
> >     <bean:write name="message"/><br>
> > </html:messages>
> > 
> > 
> > ----- Original Message -----
> > From: "louis majanja" <lo...@ironpulse.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Thursday, March 13, 2003 1:03 PM
> > Subject: <html:messages/> not displaying messages
> > 
> > 
> > > i have this in my actionForm:
> > > ActionMessages messages = new ActionMessages();
> > >
> > >    messages.add("message",
> > >                   new ActionMessage("message.login.confirmation"));
> > >   saveMessage(request,messages);
> > >
> > > in my jsp i have
> > >
> > > <html:messages />
> > >
> > > it doesn't work, i have tried the following options which don't work
> > > either
> > >
> > > <html:messages message="true"/>
> > >
> > > <html:messages id="msg" property="messages" message="true">
> > >   <c:out value="${msg}"/>
> > > </html:messages>
> > >
> > > i don't get an error nor do i get any output
> > > im using struts release candidate 1.1
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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


Re: not displaying messages

Posted by louis majanja <lo...@ironpulse.com>.
that didn't work

On Thu, 2003-03-13 at 10:18, Ian Hunter wrote:
> Just to see if this gets you anywhere, do
> 
> messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage
> ("message.login.confirmation"));
> saveMessages(request, response);
> 
> then use
> 
> <html:messages id="message" message="true">
>     <bean:write name="message"/><br>
> </html:messages>
> 
> 
> ----- Original Message -----
> From: "louis majanja" <lo...@ironpulse.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, March 13, 2003 1:03 PM
> Subject: <html:messages/> not displaying messages
> 
> 
> > i have this in my actionForm:
> > ActionMessages messages = new ActionMessages();
> >
> >    messages.add("message",
> >                   new ActionMessage("message.login.confirmation"));
> >   saveMessage(request,messages);
> >
> > in my jsp i have
> >
> > <html:messages />
> >
> > it doesn't work, i have tried the following options which don't work
> > either
> >
> > <html:messages message="true"/>
> >
> > <html:messages id="msg" property="messages" message="true">
> >   <c:out value="${msg}"/>
> > </html:messages>
> >
> > i don't get an error nor do i get any output
> > im using struts release candidate 1.1
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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


Re: not displaying messages

Posted by Ian Hunter <ih...@hunterweb.net>.
Just to see if this gets you anywhere, do

messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage
("message.login.confirmation"));
saveMessages(request, response);

then use

<html:messages id="message" message="true">
    <bean:write name="message"/><br>
</html:messages>


----- Original Message -----
From: "louis majanja" <lo...@ironpulse.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, March 13, 2003 1:03 PM
Subject: <html:messages/> not displaying messages


> i have this in my actionForm:
> ActionMessages messages = new ActionMessages();
>
>    messages.add("message",
>                   new ActionMessage("message.login.confirmation"));
>   saveMessage(request,messages);
>
> in my jsp i have
>
> <html:messages />
>
> it doesn't work, i have tried the following options which don't work
> either
>
> <html:messages message="true"/>
>
> <html:messages id="msg" property="messages" message="true">
>   <c:out value="${msg}"/>
> </html:messages>
>
> i don't get an error nor do i get any output
> im using struts release candidate 1.1
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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