You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by nuwan chandrasoma <my...@gmail.com> on 2007/11/22 10:47:38 UTC

Re: Struts+JavaScript i18n

Hi,

Sorry i replied to the mail you have sent to the dev list which is used
by the struts developers to communicate about struts, sorry dev list guys :)

As you have included the struts tag inside a .js file it will not be
recognize as an jsp tag. therefore you need to include this inside the
.jsp page or try something like this.

<script language="javascript" src="js/alloc_common.js" ></script>
alloc_common.js contain
 function confirmDelete(message) {
  alert(message); return
false;
  }


<html:link onclick="return confirmDelete('<bean:message
bundle="pa/acornpa" key="pa.filter.show"/>');"
action="/blabla.do?method=doSomething" paramId="id" paramProperty="id"
transaction="true">
  Our Link
</html:link>

Thanks,

Nuwan


On Nov 22, 2007 2:28 PM, iv_va_unq <ih...@gmail.com> wrote:
>
>  Hi friends I need your help
>
> <<< Application.properties >>>
> pa.filter.show=Show
>
> <<< *.jsp >>>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> pageEncoding="ISO-8859-1"%> <%@ taglib uri="/WEB-INF/struts-bean.tld"
> prefix="bean"%>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>   <html>
>     <head>
>      <meta http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1">
>      <title>Insert title here</title>
>
>    <script language="javascript">
>     function confirmDelete() {
>       alert('<bean:message bundle="pa/acornpa" key="pa.filter.show"/>');
>       return false;
>     }
>    </script>
> </head>
>
> <body>
>    <html:link onclick="return confirmDelete();"
> action="/blabla.do?method=doSomething" paramId="id" paramProperty="id"
> transaction="true">
>    Our Link
> </html:link>
> </body>
> </html>
>
> It worked correctly and showed Show (value of pa.filter.show) but when I use
> <script language="javascript" src="js/alloc_common.js" ></script>
> alloc_common.js contain
>   function confirmDelete() {
>    alert('<bean:message bundle="pa/acornpa" key="pa.filter.show"/>'); return
> false;
>    }
>
> It show <bean:message bundle="pa/acornpa" key="pa.filter.show"/>
> How can it fix ?
> --
> View this message in context: http://www.nabble.com/Struts%2BJavaScript--i18n-tf4855150.html#a13893174
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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