You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by emre akbas <em...@gmail.com> on 2005/09/27 13:37:10 UTC

ActionMessage and bundle choice

Hi,
We know that ActionMessage class has a field to store the key of the message
but not the bundle name of the key. For (error) messages that are not in the
default message-resources, we can do the trick in the jsp file by giving the
bundle of the key like:

 <html:messages bundle="core" id="msg" >
 <bean:write name="msg"/>
 </html:messages>

So far so good. But, what we shall do if the ActionMessages contain messages
which have to be resolved from different bundles? Should we write several
<html:messages> tags with different bundles?

Re: Help needed urgent

Posted by Hubert Rabago <hr...@gmail.com>.
You skipped over my other questions:


> When I tryed this way it worked:
>
>         href="/ExemploStruts/CadastroClienteDispatchAction.do..."
>
> But it did not populate my form with the values in the bean

Did you include the parameters you wanted to populate?
<a href="/ExemploStruts//CadastroClienteDispatchAction.do?acao=editar&codigo=<bean:write
name='lista' property='codigo'/>">


Also, you said:
> and it seems to invoke an submit imediately after loading.

What did you mean by that statement?

Hubert

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


Re: Help needed urgent

Posted by Francisco - São Paulo - Brazil <av...@yahoo.com.br>.
My guess is the problem lies outside your Action code, since you

specify "acao=editar" in your request, "acao" is the parameter for
your DispatchAction, and you have an "editar" method.  Are you able to
call normal Struts actions okay?

Yes, I am able, for example, to save data from the form, as follow:
public ActionForward salvar(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        ActionErrors erros = new ActionErrors();
        ActionForward forward = null;

        ClienteDAO cadastroDAO = new ClienteDAO(this.getConnection());
        ClienteFormBean clienteForm = (ClienteFormBean) form;

        try {
            cadastroDAO.insert(clienteForm);
            forward = mapping.findForward("sucesso");
            request.setAttribute("resultado",
                    "O Cliente foi salvo com sucesso.");
        } catch (SQLException e) {
            e.printStackTrace();
            erros.add(ActionErrors.GLOBAL_ERROR,
                    new ActionError("errors.persistirCadastro",
                            new String[] { e.getMessage() }));
            forward = mapping.findForward("falha");
        } catch (Exception e) {
            e.printStackTrace();
            erros.add(ActionErrors.GLOBAL_ERROR,
                    new ActionError("errors.persistirCadastro",
                            new String[] { e.getMessage() }));
            forward = mapping.findForward("falha");
        }

        if (!erros.isEmpty()) {
            saveErrors(request, erros);
        }
        request.getSession().invalidate();
        return forward;
    }

<html:hidden property="acao" value="error" />
<html:submit styleClass="caixaPontilhada" onclick="setMetodo('salvar');" 
style="width:150px;">
    <bean:message key="botao.enviar" />
</html:submit>

Could you point me what are the steps to perform this I am trying?? Then 
I will check everything here.

Thanks
Francisco
Hubert Rabago escreveu:

>On 9/27/05, Francisco - São Paulo - Brazil <av...@yahoo.com.br> wrote:
>  
>
>>When I tryed this way:
>>    href="CadastroClienteDispatchAction.do..."
>>
>>HTTP Status 400 - Invalid path /pages/CadastroClienteDispatchAction was
>>requested
>>    
>>
>
>This is because your JSP and your actions are in different paths.
>
>  
>
>>When I tryed this way it worked:
>>
>>        href="/ExemploStruts/CadastroClienteDispatchAction.do..."
>>
>>But it did not populate my form with the values in the bean
>>    
>>
>
>Did you include the parameters you wanted to populate?
><a href="/ExemploStruts//CadastroClienteDispatchAction.do?acao=editar&codigo=<bean:write
>name='lista' property='codigo'/>">
>
>  
>
>>and it seems
>>to invoke an submit imediately after loading.
>>    
>>
>
>Isn't this a link?  So when you click it, it will immediately load the
>resource referenced by the link.  I'm not sure I understand your
>concern.
>
>  
>
>>As it didnt populate the form with data and some fields are
>>validated/required the errors messages are shown.
>>    
>>
>
>This is the expected behavior when there's a validation error.  Once
>the issue about why you're having validation problems are solved, you
>shouldn't see this problem anymore.
>
>  
>
>>Maybe something in here, could you have a look please?
>>    
>>
>
>My guess is the problem lies outside your Action code, since you
>specify "acao=editar" in your request, "acao" is the parameter for
>your DispatchAction, and you have an "editar" method.  Are you able to
>call normal Struts actions okay?
>
>Hubert
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

	

	
		
_______________________________________________________ 
Novo Yahoo! Messenger com voz: ligações, Yahoo! Avatars, novos emoticons e muito mais. Instale agora! 
www.yahoo.com.br/messenger/

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


Re: Help needed urgent

Posted by Hubert Rabago <hr...@gmail.com>.
On 9/27/05, Francisco - São Paulo - Brazil <av...@yahoo.com.br> wrote:
> When I tryed this way:
>     href="CadastroClienteDispatchAction.do..."
>
> HTTP Status 400 - Invalid path /pages/CadastroClienteDispatchAction was
> requested

This is because your JSP and your actions are in different paths.

> When I tryed this way it worked:
>
>         href="/ExemploStruts/CadastroClienteDispatchAction.do..."
>
> But it did not populate my form with the values in the bean

Did you include the parameters you wanted to populate?
<a href="/ExemploStruts//CadastroClienteDispatchAction.do?acao=editar&codigo=<bean:write
name='lista' property='codigo'/>">

> and it seems
> to invoke an submit imediately after loading.

Isn't this a link?  So when you click it, it will immediately load the
resource referenced by the link.  I'm not sure I understand your
concern.

> As it didnt populate the form with data and some fields are
> validated/required the errors messages are shown.

This is the expected behavior when there's a validation error.  Once
the issue about why you're having validation problems are solved, you
shouldn't see this problem anymore.

> Maybe something in here, could you have a look please?

My guess is the problem lies outside your Action code, since you
specify "acao=editar" in your request, "acao" is the parameter for
your DispatchAction, and you have an "editar" method.  Are you able to
call normal Struts actions okay?

Hubert

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


Re: Help needed urgent

Posted by Francisco - São Paulo - Brazil <av...@yahoo.com.br>.
When I tryed this way:
    href="CadastroClienteDispatchAction.do..."

HTTP Status 400 - Invalid path /pages/CadastroClienteDispatchAction was 
requested
------------------------------------------------------------------------
*type* Status report
*message* _Invalid path /pages/CadastroClienteDispatchAction was requested_
*description* _The request sent by the client was syntactically 
incorrect (Invalid path /pages/CadastroClienteDispatchAction was 
requested)._

When I tryed this way it worked:

	href="/ExemploStruts/CadastroClienteDispatchAction.do..."

But it did not populate my form with the values in the bean and it seems 
to invoke an submit imediately after loading.
As it didnt populate the form with data and some fields are 
validated/required the errors messages are shown.

Maybe something in here, could you have a look please?

public ActionForward editar(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ActionErrors erros = new ActionErrors();
        ClienteDAO cadastroDAO = new ClienteDAO(this.getConnection());
        ClienteFormBean clienteForm = (ClienteFormBean)form;
        try {
            clienteForm = cadastroDAO.getDadosCliente( 
((ClienteFormBean)form).getCodigo() );
            clienteForm.setAcao("editando");
        } catch (SQLException e) {
            erros.add(ActionErrors.GLOBAL_ERROR,new 
ActionError("errors.recuperarCadastro"));
            mapping.findForward("falha");
        }       
        return mapping.findForward("sucesso");
    }


Hubert Rabago escreveu:

>Instead of  href="/CadastroClienteDispatchAction.do..."
>
>Try one of the ff:
>
>href="CadastroClienteDispatchAction.do..."
>   (relative)
>
>href="/ExemploStruts/CadastroClienteDispatchAction.do..."
>   (absolute)
>
>Hubert
>
>On 9/27/05, Francisco - São Paulo - Brazil <av...@yahoo.com.br> wrote:
>  
>
>>Hi all,
>>I am trying to list some names (with and ID code) and I want for each
>>name listed create a link, then when the user clicks on the link I want
>>to edit the record (the bean).
>>
>>With this I have my list there with all the names:
>>    http://localhost:8080/ExemploStruts/ListagemClientes.do
>>
>>The problem is when I click on the name/link and it should call an
>>action in my DispatchAction, but it gives me an error on the server:
>>
>>HTTP Status 404 - /CadastroClienteDispatchAction.do
>>------------------------------------------------------------------------
>>*type* Status report
>>*message* _/CadastroClienteDispatchAction.do_
>>*description* _The requested resource
>>(/CadastroClienteDispatchAction.do) is not available._
>>------------------------------------------------------------------------
>>Apache Tomcat/5.5.8
>>
>>
>>For listing the names I am using an this Action, which is
>>org.apache.struts.action.ActionForm type:
>><action path="/ListagemClientes"
>>type="br.com.manager.action.ListagemClientesAction">
>>            <forward path="/pages/dadosCliente.jsp" name="sucesso" />
>>            <forward path="/pages/erros.jsp" name="falha" />
>></action>
>>
>>For my CRUD operations I am using an action of type
>>org.apache.struts.actions.DispatchAction:
>><action input="/pages/cadastroCliente.jsp" name="ClienteForm"
>>            parameter="acao" path="/CadastroClienteDispatchAction"
>>            scope="session"
>>type="br.com.manager.action.ClienteDispatchAction">
>>            <forward name="retorno" path="/pages/cadastroCliente.jsp" />
>>            <forward name="sucesso" path="/pages/dadosCliente.jsp" />
>>            <forward name="falha" path="/pages/erros.jsp" />
>></action>
>>
>>This is my .JSP where I create the links:
>><logic:notEmpty name="listagem">
>>                <logic:iterate name="listagem" id="lista">
>>                    <tr>
>>                        <td bgcolor="#E6E8FA"><a
>>
>>href="/CadastroClienteDispatchAction.do?acao=editar&codigo=<bean:write
>>name='lista' property='codigo'/>">
>>                        <bean:write name="lista" property="nome" /></a></td>
>>                        <td bgcolor="#E6E8FA" width="4%" align="center"><a
>>
>>href="/CadastroClienteDispatchAction.do?acao=excluir&codigo=<bean:write
>>name='lista' property='codigo'/>">
>>                        <img src="imagens/lixo.gif" border=0></a></td>
>>                    </tr>
>>                </logic:iterate>
>></logic:notEmpty>
>>
>>These are my 2 action in the DispatchAction (excluir=delete, editar=edit) :
>>public ActionForward excluir(ActionMapping mapping, ActionForm form,
>>            HttpServletRequest request, HttpServletResponse response)
>>            throws Exception {
>>
>>        ActionErrors erros = new ActionErrors();
>>        ActionForward forward = null;
>>        ClienteDAO cadastroDAO = new ClienteDAO(this.getConnection());
>>        ClienteFormBean clienteForm = (ClienteFormBean) form;
>>
>>        try {
>>            cadastroDAO.delete(clienteForm);
>>            forward = mapping.findForward("sucesso");
>>        } catch (SQLException e) {
>>            erros.add(ActionErrors.GLOBAL_ERROR, new
>>ActionError("errors.persistirCadastro", new String[] { e.getMessage() }));
>>            forward = mapping.findForward("falha");
>>        } catch (Exception e) {
>>            erros.add(ActionErrors.GLOBAL_ERROR,  new
>>ActionError("errors.persistirCadastro", new String[] { e.getMessage() }));
>>            forward = mapping.findForward("falha");
>>        }
>>
>>        if (!erros.isEmpty()) {
>>            saveErrors(request, erros);
>>        }
>>        return forward;
>>    }
>>
>>public ActionForward editar(ActionMapping mapping, ActionForm form,
>>            HttpServletRequest request, HttpServletResponse response)
>>            throws Exception {
>>        ActionErrors erros = new ActionErrors();
>>        ClienteDAO cadastroDAO = new ClienteDAO(this.getConnection());
>>        ClienteFormBean clienteForm = (ClienteFormBean)form;
>>        try {
>>            clienteForm = cadastroDAO.getDadosCliente(
>>((ClienteFormBean)form).getCodigo() );
>>            clienteForm.setAcao("editando");
>>        } catch (SQLException e) {
>>            erros.add(ActionErrors.GLOBAL_ERROR,new
>>ActionError("errors.recuperarCadastro"));
>>            mapping.findForward("falha");
>>        }
>>        return mapping.findForward("sucesso");
>>    }
>>
>>Please, could someone tell me what is wrong OR tell me another way to
>>implement such thing.
>>
>>I am using Struts 1.1
>>
>>Thanks a lot
>>
>>PS. My Bean and my DAO are working ok.
>>
>>
>>
>>
>>
>>_______________________________________________________
>>Novo Yahoo! Messenger com voz: ligações, Yahoo! Avatars, novos emoticons e muito mais. Instale agora!
>>www.yahoo.com.br/messenger/
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

	

	
		
_______________________________________________________ 
Novo Yahoo! Messenger com voz: ligações, Yahoo! Avatars, novos emoticons e muito mais. Instale agora! 
www.yahoo.com.br/messenger/

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


Re: Help needed urgent

Posted by Hubert Rabago <hr...@gmail.com>.
Instead of  href="/CadastroClienteDispatchAction.do..."

Try one of the ff:

href="CadastroClienteDispatchAction.do..."
   (relative)

href="/ExemploStruts/CadastroClienteDispatchAction.do..."
   (absolute)

Hubert

On 9/27/05, Francisco - São Paulo - Brazil <av...@yahoo.com.br> wrote:
> Hi all,
> I am trying to list some names (with and ID code) and I want for each
> name listed create a link, then when the user clicks on the link I want
> to edit the record (the bean).
>
> With this I have my list there with all the names:
>     http://localhost:8080/ExemploStruts/ListagemClientes.do
>
> The problem is when I click on the name/link and it should call an
> action in my DispatchAction, but it gives me an error on the server:
>
> HTTP Status 404 - /CadastroClienteDispatchAction.do
> ------------------------------------------------------------------------
> *type* Status report
> *message* _/CadastroClienteDispatchAction.do_
> *description* _The requested resource
> (/CadastroClienteDispatchAction.do) is not available._
> ------------------------------------------------------------------------
> Apache Tomcat/5.5.8
>
>
> For listing the names I am using an this Action, which is
> org.apache.struts.action.ActionForm type:
> <action path="/ListagemClientes"
> type="br.com.manager.action.ListagemClientesAction">
>             <forward path="/pages/dadosCliente.jsp" name="sucesso" />
>             <forward path="/pages/erros.jsp" name="falha" />
> </action>
>
> For my CRUD operations I am using an action of type
> org.apache.struts.actions.DispatchAction:
> <action input="/pages/cadastroCliente.jsp" name="ClienteForm"
>             parameter="acao" path="/CadastroClienteDispatchAction"
>             scope="session"
> type="br.com.manager.action.ClienteDispatchAction">
>             <forward name="retorno" path="/pages/cadastroCliente.jsp" />
>             <forward name="sucesso" path="/pages/dadosCliente.jsp" />
>             <forward name="falha" path="/pages/erros.jsp" />
> </action>
>
> This is my .JSP where I create the links:
> <logic:notEmpty name="listagem">
>                 <logic:iterate name="listagem" id="lista">
>                     <tr>
>                         <td bgcolor="#E6E8FA"><a
>
> href="/CadastroClienteDispatchAction.do?acao=editar&codigo=<bean:write
> name='lista' property='codigo'/>">
>                         <bean:write name="lista" property="nome" /></a></td>
>                         <td bgcolor="#E6E8FA" width="4%" align="center"><a
>
> href="/CadastroClienteDispatchAction.do?acao=excluir&codigo=<bean:write
> name='lista' property='codigo'/>">
>                         <img src="imagens/lixo.gif" border=0></a></td>
>                     </tr>
>                 </logic:iterate>
> </logic:notEmpty>
>
> These are my 2 action in the DispatchAction (excluir=delete, editar=edit) :
> public ActionForward excluir(ActionMapping mapping, ActionForm form,
>             HttpServletRequest request, HttpServletResponse response)
>             throws Exception {
>
>         ActionErrors erros = new ActionErrors();
>         ActionForward forward = null;
>         ClienteDAO cadastroDAO = new ClienteDAO(this.getConnection());
>         ClienteFormBean clienteForm = (ClienteFormBean) form;
>
>         try {
>             cadastroDAO.delete(clienteForm);
>             forward = mapping.findForward("sucesso");
>         } catch (SQLException e) {
>             erros.add(ActionErrors.GLOBAL_ERROR, new
> ActionError("errors.persistirCadastro", new String[] { e.getMessage() }));
>             forward = mapping.findForward("falha");
>         } catch (Exception e) {
>             erros.add(ActionErrors.GLOBAL_ERROR,  new
> ActionError("errors.persistirCadastro", new String[] { e.getMessage() }));
>             forward = mapping.findForward("falha");
>         }
>
>         if (!erros.isEmpty()) {
>             saveErrors(request, erros);
>         }
>         return forward;
>     }
>
> public ActionForward editar(ActionMapping mapping, ActionForm form,
>             HttpServletRequest request, HttpServletResponse response)
>             throws Exception {
>         ActionErrors erros = new ActionErrors();
>         ClienteDAO cadastroDAO = new ClienteDAO(this.getConnection());
>         ClienteFormBean clienteForm = (ClienteFormBean)form;
>         try {
>             clienteForm = cadastroDAO.getDadosCliente(
> ((ClienteFormBean)form).getCodigo() );
>             clienteForm.setAcao("editando");
>         } catch (SQLException e) {
>             erros.add(ActionErrors.GLOBAL_ERROR,new
> ActionError("errors.recuperarCadastro"));
>             mapping.findForward("falha");
>         }
>         return mapping.findForward("sucesso");
>     }
>
> Please, could someone tell me what is wrong OR tell me another way to
> implement such thing.
>
> I am using Struts 1.1
>
> Thanks a lot
>
> PS. My Bean and my DAO are working ok.
>
>
>
>
>
> _______________________________________________________
> Novo Yahoo! Messenger com voz: ligações, Yahoo! Avatars, novos emoticons e muito mais. Instale agora!
> www.yahoo.com.br/messenger/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Help needed urgent

Posted by Francisco - São Paulo - Brazil <av...@yahoo.com.br>.
Hi all,
I am trying to list some names (with and ID code) and I want for each 
name listed create a link, then when the user clicks on the link I want 
to edit the record (the bean).

With this I have my list there with all the names:
    http://localhost:8080/ExemploStruts/ListagemClientes.do

The problem is when I click on the name/link and it should call an 
action in my DispatchAction, but it gives me an error on the server:

HTTP Status 404 - /CadastroClienteDispatchAction.do
------------------------------------------------------------------------
*type* Status report
*message* _/CadastroClienteDispatchAction.do_
*description* _The requested resource 
(/CadastroClienteDispatchAction.do) is not available._
------------------------------------------------------------------------
Apache Tomcat/5.5.8


For listing the names I am using an this Action, which is 
org.apache.struts.action.ActionForm type:
<action path="/ListagemClientes" 
type="br.com.manager.action.ListagemClientesAction">
            <forward path="/pages/dadosCliente.jsp" name="sucesso" />
            <forward path="/pages/erros.jsp" name="falha" />
</action>

For my CRUD operations I am using an action of type 
org.apache.struts.actions.DispatchAction:
<action input="/pages/cadastroCliente.jsp" name="ClienteForm"
            parameter="acao" path="/CadastroClienteDispatchAction"
            scope="session" 
type="br.com.manager.action.ClienteDispatchAction">
            <forward name="retorno" path="/pages/cadastroCliente.jsp" />
            <forward name="sucesso" path="/pages/dadosCliente.jsp" />
            <forward name="falha" path="/pages/erros.jsp" />
</action>

This is my .JSP where I create the links:
<logic:notEmpty name="listagem">
                <logic:iterate name="listagem" id="lista">
                    <tr>
                        <td bgcolor="#E6E8FA"><a
                            
href="/CadastroClienteDispatchAction.do?acao=editar&codigo=<bean:write 
name='lista' property='codigo'/>">
                        <bean:write name="lista" property="nome" /></a></td>
                        <td bgcolor="#E6E8FA" width="4%" align="center"><a
                            
href="/CadastroClienteDispatchAction.do?acao=excluir&codigo=<bean:write 
name='lista' property='codigo'/>">
                        <img src="imagens/lixo.gif" border=0></a></td>
                    </tr>
                </logic:iterate>
</logic:notEmpty>

These are my 2 action in the DispatchAction (excluir=delete, editar=edit) :
public ActionForward excluir(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        ActionErrors erros = new ActionErrors();
        ActionForward forward = null;
        ClienteDAO cadastroDAO = new ClienteDAO(this.getConnection());
        ClienteFormBean clienteForm = (ClienteFormBean) form;

        try {
            cadastroDAO.delete(clienteForm);
            forward = mapping.findForward("sucesso");
        } catch (SQLException e) {
            erros.add(ActionErrors.GLOBAL_ERROR, new 
ActionError("errors.persistirCadastro", new String[] { e.getMessage() }));
            forward = mapping.findForward("falha");
        } catch (Exception e) {
            erros.add(ActionErrors.GLOBAL_ERROR,  new 
ActionError("errors.persistirCadastro", new String[] { e.getMessage() }));
            forward = mapping.findForward("falha");
        }

        if (!erros.isEmpty()) {
            saveErrors(request, erros);
        }
        return forward;
    }

public ActionForward editar(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ActionErrors erros = new ActionErrors();
        ClienteDAO cadastroDAO = new ClienteDAO(this.getConnection());
        ClienteFormBean clienteForm = (ClienteFormBean)form;
        try {
            clienteForm = cadastroDAO.getDadosCliente( 
((ClienteFormBean)form).getCodigo() );
            clienteForm.setAcao("editando");
        } catch (SQLException e) {
            erros.add(ActionErrors.GLOBAL_ERROR,new 
ActionError("errors.recuperarCadastro"));
            mapping.findForward("falha");
        }       
        return mapping.findForward("sucesso");
    }

Please, could someone tell me what is wrong OR tell me another way to 
implement such thing.

I am using Struts 1.1

Thanks a lot

PS. My Bean and my DAO are working ok.

	

	
		
_______________________________________________________ 
Novo Yahoo! Messenger com voz: ligações, Yahoo! Avatars, novos emoticons e muito mais. Instale agora! 
www.yahoo.com.br/messenger/

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


Re: ActionMessage and bundle choice

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
From: "Laurie Harper" <la...@holoweb.net>
Sent: Tuesday, September 27, 2005 10:34 PM
> emre akbas wrote:
> > Hi,
> > We know that ActionMessage class has a field to store the key of the
message
> > but not the bundle name of the key. For (error) messages that are not in
the
> > default message-resources, we can do the trick in the jsp file by giving
the
> > bundle of the key like:
> >
> >  <html:messages bundle="core" id="msg" >
> >  <bean:write name="msg"/>
> >  </html:messages>
> >
> > So far so good. But, what we shall do if the ActionMessages contain
messages
> > which have to be resolved from different bundles? Should we write
several
> > <html:messages> tags with different bundles?
>
> That would appear to be the only option; ActionMessages doesn't have a
> way to specify the bundle. That might be a useful enhancement, though.
>
> L.

There appears to be a couple of enhancement request for this:

http://issues.apache.org/bugzilla/show_bug.cgi?id=7892
http://issues.apache.org/bugzilla/show_bug.cgi?id=30401

Niall



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


Re: ActionMessage and bundle choice

Posted by Laurie Harper <la...@holoweb.net>.
emre akbas wrote:
> Hi,
> We know that ActionMessage class has a field to store the key of the message
> but not the bundle name of the key. For (error) messages that are not in the
> default message-resources, we can do the trick in the jsp file by giving the
> bundle of the key like:
> 
>  <html:messages bundle="core" id="msg" >
>  <bean:write name="msg"/>
>  </html:messages>
> 
> So far so good. But, what we shall do if the ActionMessages contain messages
> which have to be resolved from different bundles? Should we write several
> <html:messages> tags with different bundles?

That would appear to be the only option; ActionMessages doesn't have a 
way to specify the bundle. That might be a useful enhancement, though.

L.


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