The problem is that my image changes depending on the error message - so I need
a way of determining which image to display.

Oh well, I do everything from the design to the Action servlets, and stop
before the EJBs - so I guess it's only really a concern if someone else was
doing the design.

Matt

--- Thomas Quas <[EMAIL PROTECTED]> wrote:
> 
> Matt,
> 
> what I'm currently doing is something like this: In, say, x.jsp I write
> 
> ...
> <tr><td> class="feedback">
>       <bean:message key="login.error.1">
>       <img...>
>       <strong><bean:message key="login.error.2"></strong>
> </tr>
> 
> 
> whereas in AppRes.properties I have
> 
> login.error.1=...
> login.error.2=...
> 
> 
> Yeah, it is rather uncomfortable--and only necessary if you really need
> to have support for i18n--but I can be sure that after a designer
> changed the page design there are no disturbing effects coming from my
> language definitions. The designer can concentrate on the .jsp file and
> does not need to care about language--in the ideal case ;-)
> 
> The same concept should work for your table header definitions.
> 
> 
> tom
> 
> 
> Matt Raible wrote:
> > 
> > Tom - it seems that you are correct, my html does show up correctly.
> > 
> > The reason I have html in my properties file is because I want to display
> > certain images with my messages.
> > 
> > Let's take the following key for example:
> > 
> > error.password.mismatch=<tr><td class="feedback"
> height="20">&nbsp;&nbsp;<img
> > src="/dc/common/images/iconWarning.gif" width="12" height="12"
> > align="absmiddle" alt="Warning">&nbsp;&nbsp;Invalid username and/or
> password,
> > please try again.</td></tr>
> > 
> > I can probably move <tr><td>...</td></tr> into my jsp page, but I'm already
> > using error.header and error.footer with html, so this seemed natural:
> > 
> > errors.header=<table border="0" cellspacing="0" cellpadding="0"
> width="100%">
> > errors.footer=</table>
> > 
> > I could probably also parameterize my <img ... /> so that this could be a
> > different key in my properties file, but then I'd have to add a little more
> > code to my action classes (or validation.xml file).
> > 
> > This brings up another point - I wish I could dynamically set the path to
> my
> > image, using a scriptlet or <bean:write> tag, meaning replace "/dc/common"
> with
> > "<%=pathToImages%>" - but doesn't seem to work.
> > 
> > We get all our static files through the webserver (vs. appserver) - that's
> why
> > I can't get it from the war.
> > 
> > Matt
> > 
> > --- Thomas Quas <[EMAIL PROTECTED]> wrote:
> > >
> > > Matt,
> > >
> > > I'm not sure whether I understood the problem correctly, but I did the
> > > same thing for a while, and it worked for me without "flush" or other
> > > tricks. I simply included the message via <bean:message key="x"/>, not
> > > matter whether there was HTML in it or not.
> > >
> > > Note, however, that it can be problematic to mix layout and content
> > > information. This was the big disadvantage of HTML, and people tried to
> > > address it with XML and stylesheets, making the two independent of each
> > > other. I'd recommend putting layout information, such as <b>, <p>, <br>
> > > etc. in the .jsp, whereas the .properties file should only contain
> > > content. This way your translators don't need to know HTML. Of course,
> > > we might open up another can of worms here if we don't have the same
> > > page layout for all languages.
> > >
> > >
> > > Just my $0.02, tom
> > >
> > >
> > > Matt Raible wrote:
> > > >
> > > > I am using <bean:message key="key.name" /> and I want to have HTML in
> my
> > > > key.name string, such as:
> > > >
> > > > key.name=<b>Hello World</b>
> > > >
> > > > So ideally, I could make my tag resemble <bean:message key="key.name"
> > > > flush="true" />, but there is no filter attribute on this tag?
> > > >
> > > > How can I do this, do I have to use <bean:write>, and if so, how do I
> get
> > > the
> > > > messages bean?
> > > >
> > > > Can it be done using:
> > > >
> > > > <bean:write name="messages" property="key.name" flush="true" />
> > > >
> > > > Thanks,
> > > >
> > > > Matt
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Make international calls for as low as $.04/minute with Yahoo!
> Messenger
> > > > http://phonecard.yahoo.com/
> > >
> > > --
> > > thomas quas        | "Art lies in the consciousness of doing the thing,
> > > [EMAIL PROTECTED]      |  in the attention of the happening[...]"
> > >                    |    -- Allen Ginsberg --
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Make international calls for as low as $.04/minute with Yahoo! Messenger
> > http://phonecard.yahoo.com/
> 
> -- 
> thomas quas        | "Art lies in the consciousness of doing the thing,
> [EMAIL PROTECTED]      |  in the attention of the happening[...]"
>                    |    -- Allen Ginsberg --


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Reply via email to