You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by iv_va_unq <ih...@gmail.com> on 2007/11/22 09:56:58 UTC
Struts+JavaScript i18n
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-tf4855139.html#a13893149
Sent from the Struts - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Struts+JavaScript i18n
Posted by Nuwan Chandrasoma <nu...@yahoo.com>.
As you have included the tag inside a javascript file it will not be parsed as a jsp tag. you need to include the tags inside a .jsp file :)
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" %>
Insert title here
function confirmDelete() {
alert('');
return false;
}
action="/blabla.do?method=doSomething" paramId="id" paramProperty="id"
transaction="true">
Our Link
It worked correctly and showed Show (value of pa.filter.show) but when I use
alloc_common.js contain
function confirmDelete() {
alert(''); return
false;
}
It show
How can it fix ?
--
View this message in context: http://www.nabble.com/Struts%2BJavaScript--i18n-tf4855139.html#a13893149
Sent from the Struts - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
---------------------------------
Never miss a thing. Make Yahoo your homepage.