You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JC <jo...@yahoo.com> on 2002/02/07 09:31:36 UTC

Design issue: mixing data and presentation!!!!

Hi,
A great thing with Struts is the error validation
capabilities. However, the use of <html:errors/>, or
lately <html:messages>, poses a problem that I found
not to be a very good design (though it is slightly
better in the messages tag).

What I don't like is, in order to get any presentation
formatting on the header and footer, you need to enter
html in the resources and therefore mixing up data and
presentation.

An example where this apply is that we have an i18n
utility where the administrator for each country can
translate all messages from a default language into
their local language and for the messages headers and
footers they have to see the html as well.

Has anyone thought of this before?

/Johannes



_____________________________________________________
Hitta snörapporter... 
från 500 olika skidorter i Europa
på http://se.snow.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Design issue: mixing data and presentation!!!!

Posted by JC <jo...@yahoo.com>.
Ah, yes. Nice and smooth! I must really go through the
newer tags properly. Did the same solution with my own
tag, but it would be nicer to use this. Thanks!

/Johannes 

 --- Ted Husted <hu...@apache.org> wrote:
> That was true with the html:errors tag, but not with
> the newer
> html:messages tag. With the messages, tag the
> errors.header and .footer
> are optional, so can do things like this:
> 
> <logic:messagesPresent>
> <TABLE width="100%">
> <TR><TD class="message">
>    <UL>
>    <html:messages id="error">
>       <LI><bean:write name="error"/></LI>
>    </html:messages>
>    </UL>
> </TD></TR>
> </TABLE>
> </logic:messagesPresent>
> 
> 
> JC wrote:
> > 
> > Hi,
> > A great thing with Struts is the error validation
> > capabilities. However, the use of <html:errors/>,
> or
> > lately <html:messages>, poses a problem that I
> found
> > not to be a very good design (though it is
> slightly
> > better in the messages tag).
> > 
> > What I don't like is, in order to get any
> presentation
> > formatting on the header and footer, you need to
> enter
> > html in the resources and therefore mixing up data
> and
> > presentation.
> > 
> > An example where this apply is that we have an
> i18n
> > utility where the administrator for each country
> can
> > translate all messages from a default language
> into
> > their local language and for the messages headers
> and
> > footers they have to see the html as well.
> > 
> > Has anyone thought of this before?
> > 
> > /Johannes
> > 
> >
>
_____________________________________________________
> > Hitta snörapporter...
> > från 500 olika skidorter i Europa
> > på http://se.snow.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Java Web Development with Struts.
> -- Tel +1 585 737-3463.
> -- Web http://www.husted.com/struts/
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>  

_____________________________________________________
Hitta snörapporter... 
från 500 olika skidorter i Europa
på http://se.snow.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Design issue: mixing data and presentation!!!!

Posted by Ted Husted <hu...@apache.org>.
That was true with the html:errors tag, but not with the newer
html:messages tag. With the messages, tag the errors.header and .footer
are optional, so can do things like this:

<logic:messagesPresent>
<TABLE width="100%">
<TR><TD class="message">
   <UL>
   <html:messages id="error">
      <LI><bean:write name="error"/></LI>
   </html:messages>
   </UL>
</TD></TR>
</TABLE>
</logic:messagesPresent>


JC wrote:
> 
> Hi,
> A great thing with Struts is the error validation
> capabilities. However, the use of <html:errors/>, or
> lately <html:messages>, poses a problem that I found
> not to be a very good design (though it is slightly
> better in the messages tag).
> 
> What I don't like is, in order to get any presentation
> formatting on the header and footer, you need to enter
> html in the resources and therefore mixing up data and
> presentation.
> 
> An example where this apply is that we have an i18n
> utility where the administrator for each country can
> translate all messages from a default language into
> their local language and for the messages headers and
> footers they have to see the html as well.
> 
> Has anyone thought of this before?
> 
> /Johannes
> 
> _____________________________________________________
> Hitta snörapporter...
> från 500 olika skidorter i Europa
> på http://se.snow.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Design issue: mixing data and presentation!!!!

Posted by JC <jo...@yahoo.com>.
Well, see the example application regarding the use of
<html:errors/> but sse the include directive from the
resource? That wouldn't be too nice either, would it?
See Ted's reply to my question regarding the
<logic:messagesPresent> tag.

/Johannes

 --- Julius <ju...@medifast.ca> wrote:
> Why do you have to put the html in the resource file
> for header and footer?
> You can use include directive instead.
> 
> ----- Original Message -----
> From: "JC" <jo...@yahoo.com>
> To: <st...@jakarta.apache.org>
> Sent: Thursday, February 07, 2002 3:31 AM
> Subject: <html:messages> Design issue: mixing data
> and presentation!!!!
> 
> 
> > Hi,
> > A great thing with Struts is the error validation
> > capabilities. However, the use of <html:errors/>,
> or
> > lately <html:messages>, poses a problem that I
> found
> > not to be a very good design (though it is
> slightly
> > better in the messages tag).
> >
> > What I don't like is, in order to get any
> presentation
> > formatting on the header and footer, you need to
> enter
> > html in the resources and therefore mixing up data
> and
> > presentation.
> >
> > An example where this apply is that we have an
> i18n
> > utility where the administrator for each country
> can
> > translate all messages from a default language
> into
> > their local language and for the messages headers
> and
> > footers they have to see the html as well.
> >
> > Has anyone thought of this before?
> >
> > /Johannes
> >
> >
> >
> >
>
_____________________________________________________
> > Hitta snörapporter...
> > från 500 olika skidorter i Europa
> > på http://se.snow.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>  

_____________________________________________________
Hitta snörapporter... 
från 500 olika skidorter i Europa
på http://se.snow.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Design issue: mixing data and presentation!!!!

Posted by David Winterfeldt <dw...@yahoo.com>.
You can do something like this so you don't have
markup in your message resources.

<logic:messagesPresent>
   <bean:message key="errors.header"/>
   <ul>
   <html:messages id="error">
      <li><bean:write name="error"/></li>
   </html:messages>
   </ul><hr>
</logic:messagesPresent>

David

--- Julius <ju...@medifast.ca> wrote:
> Why do you have to put the html in the resource file
> for header and footer?
> You can use include directive instead.
> 
> ----- Original Message -----
> From: "JC" <jo...@yahoo.com>
> To: <st...@jakarta.apache.org>
> Sent: Thursday, February 07, 2002 3:31 AM
> Subject: <html:messages> Design issue: mixing data
> and presentation!!!!
> 
> 
> > Hi,
> > A great thing with Struts is the error validation
> > capabilities. However, the use of <html:errors/>,
> or
> > lately <html:messages>, poses a problem that I
> found
> > not to be a very good design (though it is
> slightly
> > better in the messages tag).
> >
> > What I don't like is, in order to get any
> presentation
> > formatting on the header and footer, you need to
> enter
> > html in the resources and therefore mixing up data
> and
> > presentation.
> >
> > An example where this apply is that we have an
> i18n
> > utility where the administrator for each country
> can
> > translate all messages from a default language
> into
> > their local language and for the messages headers
> and
> > footers they have to see the html as well.
> >
> > Has anyone thought of this before?
> >
> > /Johannes
> >
> >
> >
> >
>
_____________________________________________________
> > Hitta sn�rapporter...
> > fr�n 500 olika skidorter i Europa
> > p� http://se.snow.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Design issue: mixing data and presentation!!!!

Posted by Julius <ju...@medifast.ca>.
Why do you have to put the html in the resource file for header and footer?
You can use include directive instead.

----- Original Message -----
From: "JC" <jo...@yahoo.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, February 07, 2002 3:31 AM
Subject: <html:messages> Design issue: mixing data and presentation!!!!


> Hi,
> A great thing with Struts is the error validation
> capabilities. However, the use of <html:errors/>, or
> lately <html:messages>, poses a problem that I found
> not to be a very good design (though it is slightly
> better in the messages tag).
>
> What I don't like is, in order to get any presentation
> formatting on the header and footer, you need to enter
> html in the resources and therefore mixing up data and
> presentation.
>
> An example where this apply is that we have an i18n
> utility where the administrator for each country can
> translate all messages from a default language into
> their local language and for the messages headers and
> footers they have to see the html as well.
>
> Has anyone thought of this before?
>
> /Johannes
>
>
>
> _____________________________________________________
> Hitta snörapporter...
> från 500 olika skidorter i Europa
> på http://se.snow.yahoo.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>