You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pablo Vázquez Blázquez <pv...@denodo.com> on 2007/11/28 17:24:34 UTC
getText issue from javascript
Hello,
Any idea about how the first command (getText) works but the second one
does not?
1.-
<s:a theme="ajax" loadingText=" " targets="workspaceAjaxContent"
executeScripts="true"
onclick="var a = confirm('%{getText('Delete.Confirm')}');
if (a) {dojo.event.topic.publish('/borrarProject');}">
<fmt:message key="Remove"/>
</s:a>
2.-
<s:a href="#" onclick="newEmailIndex = 0;
var div = document.getElementById('emailCollection');
...
var deleteEmail = document.createElement('a');
deleteEmail.innerHTML = '%{getText('Remove')}';
...
">
<fmt:message key="EditHandler.AddEmail"/>
</s:a>
The log:
The function getText must be used with a prefix when a default namespace
is not specified
at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:62)
at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:357)
at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:185)
at
org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1574)
at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:148)
at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:219)
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
[S2.1] problem with sx:head tag
Posted by Desbois Arnaud <Ar...@thomson.net>.
I try to upgrade an application 2.0.11 to 2.1.0 (with Struts tiles
plugin)
But when I put a dojo tag such as <sx:datetimepicker> into my JSP I have
this error (see below).
The <sx:head/> is put into a tiles definition file (a JSP file in fact).
But when I put the <sx:head/> directly into ma JSP page (before
<tiles:insertDefinition>), it's Ok.
Why the first case doesn't work?
Can I put this tag outside the html head tag?
Regards
Arnaud
[28/11/07 17:44:34:077 CET] 00000022 SystemOut O 2007-11-28
17:44:34,046 ERROR (org.apache.tiles.jsp.taglib.RenderTagSupport:152) -
Error during rendering
java.lang.NullPointerException
at
org.apache.struts2.dojo.components.DateTimePicker.evaluateParams(DateTim
ePicker.java:256)
at org.apache.struts2.components.UIBean.end(UIBean.java:493)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSu
pport.java:41)
at
com.ibm._jsp._edit._jspx_meth_sx_datetimepicker_0(_edit.java:265)
at com.ibm._jsp._edit._jspx_meth_s_form_0(_edit.java:342)
at
com.ibm._jsp._edit._jspx_meth_tiles_putAttribute_2(_edit.java:385)
at
com.ibm._jsp._edit._jspx_meth_tiles_insertDefinition_0(_edit.java:567)
at com.ibm._jsp._edit._jspService(_edit.java:85)
at
com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.ja
va:995)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.ja
va:930)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterCh
ain.java:118)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterC
hain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
Manager.java:761)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter
Manager.java:673)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrap
per.java:498)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWr
apper.java:464)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(G
enericServletWrapper.java:122)
at
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handle
Request(AbstractJSPExtensionServletWrapper.java:196)
at
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleReque
st(AbstractJSPExtensionProcessor.java:275)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppReq
uestDispatcher.java:308)
at
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletD
ispatcherResult.java:139)
at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSu
pport.java:185)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: getText issue from javascript
Posted by Dave Newton <ne...@yahoo.com>.
First I'd try moving your JavaScript in to actual
JavaScript methods and calling them from onclick to
avoid any potentially weird escaping/quoting/etc.
issues. That eliminates any parsing-oriented issues.
d.
--- Pablo Vázquez Blázquez <pv...@denodo.com>
wrote:
> Hello,
>
> Any idea about how the first command (getText) works
> but the second one
> does not?
>
> 1.-
> <s:a theme="ajax" loadingText=" "
> targets="workspaceAjaxContent"
> executeScripts="true"
> onclick="var a =
> confirm('%{getText('Delete.Confirm')}');
> if (a)
> {dojo.event.topic.publish('/borrarProject');}">
> <fmt:message key="Remove"/>
> </s:a>
>
>
> 2.-
> <s:a href="#" onclick="newEmailIndex = 0;
> var div =
> document.getElementById('emailCollection');
> ...
> var deleteEmail =
> document.createElement('a');
> deleteEmail.innerHTML =
> '%{getText('Remove')}';
> ...
> ">
> <fmt:message key="EditHandler.AddEmail"/>
> </s:a>
>
> The log:
> The function getText must be used with a prefix when
> a default namespace
> is not specified
> at
>
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:62)
> at
>
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:357)
> at
>
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:185)
> at
>
org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1574)
> at
>
org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:148)
> at
>
org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:219)
>
>
> Thanks.
>
>
>
---------------------------------------------------------------------
> 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