Re: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions
I use Jboss, EJB3.0 and google guice and works fine. I didn't modify anything... 2009/12/7 Ignacio de Córdoba icord...@skios.es Which appserver are you using? I use JBoss for struts2 plugin. I hace to modifyit as it didn't support JBoss 5 naming conventions (at least for me) and it only looked for annotations in current class, so if you injected a Session Bean in a super.execute() method in a parent class, it was not looked up. Anyway, I am considering moving to EJB 3.1 and hope I can find a new way of injecting new EJBs... Fernandes Celinio wrote: Hi, I know that it is not possible to inject EJB in Struts 2 actions. The following annotation would not work : @EJB MyBeanLocal mybean; But how come ? Since a Struts action is a servlet and injection works in a servlet, injection should work. Thanks for enlightening me. -- View this message in context: http://old.nabble.com/-Struts-2-%2B-EJB-3--injection-of-EJBs-into-struts-2-actions-tp26641329p26683752.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions
You can use google guice ( http://www.tzavellas.com/techblog/2007/07/03/using-dependency-injection-in-struts2-for-stateless-ejbs-part-1/). I use it and works fine! 2009/12/4 Haroon Rafique haroon.rafi...@utoronto.ca On Today at 11:58am, JC=James Cook james.c...@wecomm.com wrote: JC EJB's can only be injected into other EJB's or Servlets, a struts 2 JC action is essentially a pojo not a servlet. So you would either have to JC do a lookup in the context, or if you are using Spring look at using a JC jndi lookup and inject that reference into your class. JC JC Cookie Celinio, You can also use a Servlet simply for the purpose of invoking EJBs (let's call it EJBInvokerServlet) and then use the @Resource notation to bring any local EJB into your Action. See: http://osdir.com/ml/user-struts.apache.org/2009-07/msg00842.html Hope that helps. JC JC -Original Message- JC From: Fernandes Celinio [mailto:cfernan...@sopragroup.com] JC Sent: 04 December 2009 11:37 JC To: user@struts.apache.org JC Subject: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions JC JC Hi, JC I know that it is not possible to inject EJB in Struts 2 actions. JC The following annotation would not work : JC @EJB JC MyBeanLocal mybean; JC JC But how come ? Since a Struts action is a servlet and injection works in JC a servlet, injection should work. JC JC Thanks for enlightening me. JC JC JC - JC To unsubscribe, e-mail: user-unsubscr...@struts.apache.org JC For additional commands, e-mail: user-h...@struts.apache.org JC JC -- Haroon Rafique haroon.rafi...@utoronto.ca - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: sx:div and executeScript
Thanks Martin, I wil try to do it. However, I'm using Firefox and not Windows. Irene 2009/11/9 Martin Gainty mgai...@hotmail.com Irene- the standard onLoad=javascript:function doesnt seem to work (in IE at least) so use this document.write to replace __ie_onload /*information courtesy of dean edwards*/ http://dean.edwards.name/weblog/2006/06/again/ %@ page contentType=text/html; charset=UTF-8 % %@ taglib prefix=s uri=/struts-tags % %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% html head titleThis is the title/title script LANGUAGE=JavaScript type=text/javascript function init() { // if set to true then mouseover a table cell will alert('inside init()'); //highlight entire column (except sibling headings) document.forms[0].Title.value='newTitle'; document.forms[0].Author.value='newAuthor'; document.forms[0].Ending.value='newEnding'; document.forms[0].Energy.value='newEnergy'; document.forms[0].Flatness.value='newFlatness'; document.forms[0].Validate.value='newValidate'; document.forms[0].Play.value='newPlay'; } /** for Internet Explorer (using conditional comments) **/ /*...@cc_on @*/ /*...@if (@_win32) document.write(script id=__ie_onload defer src=javascript:void(0)\/script); var script = document.getElementById(__ie_onload); script.onreadystatechange = function() { if (this.readyState == complete) { init(); // call the onload handler } }; /*...@end @*/ window.onload = init; //-- /script /head body onLoad='window.onload = init' pThis is a test for Irene /p s:div href=javascript:tablecloth_function /s:div form action=somethingAction name=theForm table tr ths:textfield name=Title label=Title value=DefaultTitle//th ths:textfield name=Author label=Author value=DefaultAuthor //th ths:textfield name=Ending label=Ending value=DefaultEnding //th ths:textfield name=Energy label=Energy value=DefaultEnergy //th ths:textfield name=Flatness label=Flatness value=DefaultFlatness //th ths:textfield name=Validate label=Validate value=DefaultValidate //th ths:textfield name=Play label=Play value=DefaultPlay //th /tr s:iterator value=songs status=rowstatus tr tds:property value=songs[#rowstatus.index].title //td tds:property value=songs[#rowstatus.index].author / /td s:hidden name=songs[#rowstatus.index].id /s:hidden /tr /s:iterator /table s:submit value=SUBMIT / /form /body /html hth Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Sun, 8 Nov 2009 22:43:09 +0100 Subject: Re: sx:div and executeScript From: irenezel...@gmail.com To: user@struts.apache.org Yes, it is basically to give style to the table. this.tablecloth = function(){ // CONFIG // if set to true then mouseover a table cell will highlight entire column (except sibling headings) var highlightCols = false; // if set to true then mouseover a table cell will highlight entire row(except sibling headings) var highlightRows = true; // if set to true then click on a table sell will select row or column based on config var selectable = true; // this function is called when // add your own code if you want to add action // function receives object that has been clicked this.clickAction = function(obj){ //alert(obj.innerHTML); }; // END CONFIG (do not edit below this line) var tableover = false; this.start = function(){ var tables = document.getElementsByTagName(table); for (var i=0;itables.length;i++){ tables[i].onmouseover = function(){tableover = true}; tables[i].onmouseout = function(){tableover = false}; rows(tables[i]); }; }; this.rows = function(table){ var css = ; var tr = table.getElementsByTagName(tr); for (var i=0;itr.length;i
sx:div and executeScript
Hi, I'm using sx:div for loading a content after the page is loaded. But, I have problems because Javascript is not working in the page linked by sx:div ... I read about a solution with Struts2.1.2 (I'm using Struts2.1.8) in this page( http://mail-archives.apache.org/mod_mbox/struts-issues/200808.mbox/%3c2107922214.1217595186486.javamail.j...@brutus%3e, but it did not work for me. I'm using this code: sx:div id=tableScrolllabel=table href=%{#table} separateScripts=false executeScripts=true Carregant'se /sx:div and the returned code is a populated table. I changed the jar struts2-dojo-plugin-2.1.8.jar, how the thread indicates, but nothing changed. I need Javacript in the returned content. Please, I need help. Thanks in advance, Irene
Re: sx:div and executeScript
I'm using sx:head/. Not theme=ajax, I think the last version does not support this theme. The href attribute points a working url, however Javascript is not executed when the ajax url is loaded. 2009/11/8 Martin Gainty mgai...@hotmail.com assuming theme=ajax then the div href would be href false false String The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value. make sure your href attribute points a working url such as what is illustrated here http://struts.apache.org/2.1.8/docs/ajax-div-template.html Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Sat, 7 Nov 2009 17:44:28 +0100 Subject: sx:div and executeScript From: irenezel...@gmail.com To: user@struts.apache.org Hi, I'm using sx:div for loading a content after the page is loaded. But, I have problems because Javascript is not working in the page linked by sx:div ... I read about a solution with Struts2.1.2 (I'm using Struts2.1.8) in this page( http://mail-archives.apache.org/mod_mbox/struts-issues/200808.mbox/%3c2107922214.1217595186486.javamail.j...@brutus%3e , but it did not work for me. I'm using this code: sx:div id=tableScrolllabel=table href=%{#table} separateScripts=false executeScripts=true Carregant'se /sx:div and the returned code is a populated table. I changed the jar struts2-dojo-plugin-2.1.8.jar, how the thread indicates, but nothing changed. I need Javacript in the returned content. Please, I need help. Thanks in advance, Irene _ Find the right PC with Windows 7 and Windows Live. http://www.microsoft.com/Windows/pc-scout/laptop-set-criteria.aspx?cbid=wlfilt=200,2400,10,19,1,3,1,7,50,650,2,12,0,1000cat=1,2,3,4,5,6brands=5,6,7,8,9,10,11,12,13,14,15,16addf=4,5,9ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:112009
Re: sx:div and executeScript
by sx:div ... I read about a solution with Struts2.1.2 (I'm using Struts2.1.8) in this page( http://mail-archives.apache.org/mod_mbox/struts-issues/200808.mbox/%3c2107922214.1217595186486.javamail.j...@brutus%3e , but it did not work for me. I'm using this code: sx:div id=tableScrolllabel=table href=%{#table} separateScripts=false executeScripts=true Carregant'se /sx:div and the returned code is a populated table. I changed the jar struts2-dojo-plugin-2.1.8.jar, how the thread indicates, but nothing changed. I need Javacript in the returned content. Please, I need help. Thanks in advance, Irene _ Find the right PC with Windows 7 and Windows Live. http://www.microsoft.com/Windows/pc-scout/laptop-set-criteria.aspx?cbid=wlfilt=200,2400,10,19,1,3,1,7,50,650,2,12,0,1000cat=1,2,3,4,5,6brands=5,6,7,8,9,10,11,12,13,14,15,16addf=4,5,9ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:112009 _ Hotmail: Trusted email with Microsoft's powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141664/direct/01/ http://clk.atdmt.com/GBL/go/177141664/direct/01/
Re: sx:div and executeScript
bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Sun, 8 Nov 2009 17:37:19 +0100 Subject: Re: sx:div and executeScript From: irenezel...@gmail.com To: user@struts.apache.org I'm using sx:head/. Not theme=ajax, I think the last version does not support this theme. The href attribute points a working url, however Javascript is not executed when the ajax url is loaded. 2009/11/8 Martin Gainty mgai...@hotmail.com assuming theme=ajax then the div href would be href false false String The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value. make sure your href attribute points a working url such as what is illustrated here http://struts.apache.org/2.1.8/docs/ajax-div-template.html Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Sat, 7 Nov 2009 17:44:28 +0100 Subject: sx:div and executeScript From: irenezel...@gmail.com To: user@struts.apache.org Hi, I'm using sx:div for loading a content after the page is loaded. But, I have problems because Javascript is not working in the page linked by sx:div ... I read about a solution with Struts2.1.2 (I'm using Struts2.1.8) in this page( http://mail-archives.apache.org/mod_mbox/struts-issues/200808.mbox/%3c2107922214.1217595186486.javamail.j...@brutus%3e , but it did not work for me. I'm using this code: sx:div id=tableScrolllabel=table href=%{#table} separateScripts=false executeScripts=true Carregant'se /sx:div and the returned code is a populated table. I changed the jar struts2-dojo-plugin-2.1.8.jar, how the thread indicates, but nothing changed. I need Javacript in the returned content. Please, I need help. Thanks in advance, Irene _ Find the right PC with Windows 7 and Windows Live. http://www.microsoft.com/Windows/pc-scout/laptop-set-criteria.aspx?cbid=wlfilt=200,2400,10,19,1,3,1,7,50,650,2,12,0,1000cat=1,2,3,4,5,6brands=5,6,7,8,9,10,11,12,13,14,15,16addf=4,5,9ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:112009 _ Hotmail: Trusted email with Microsoft's powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141664/direct/01/ http://clk.atdmt.com/GBL/go/177141664/direct/01/ _ Hotmail: Trusted email with Microsoft's powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141664/direct/01/ http://clk.atdmt.com/GBL/go/177141664/direct/01/
sx:div and executeScript
Hi, I'm using sx:div for loading a content after the page is loaded. But, I have problems because Javascript is not working in the page linked by sx:div ... I read about a solution with Struts2.1.2 (I'm using Struts2.1.8) in this page( http://mail-archives.apache.org/mod_mbox/struts-issues/200808.mbox/%3c2107922214.1217595186486.javamail.j...@brutus%3e, but it did not work for me. I'm using this code: sx:div id=tableScrolllabel=table href=%{#table} separateScripts=false executeScripts=true Carregant'se /sx:div and the returned code is a populated table. I changed the jar struts2-dojo-plugin-2.1.8.jar, how the thread indicates, but nothing changed. I need Javacript in the returned content. Please, I need help. Thanks in advance, Irene
Re: Please help: Struts tags don't evaluate any expressions
Hi Laurie, It works! i'm not using servlet 2.4 specification. Now it works (but i have to change the taglib declaration to %@ taglib uri=http://java.sun.com/jstl/core_rt; prefix=c %) Thanks a lot, I wanted to avoid the use of scriptlets. Laurie Harper wrote: You probably *don't* want the -el taglibs on Tomcat 5. You will need to make sure your web.xml uses the Servlet 2.4 style namespace declaration, though, to get EL working. For scriptlets, your problem is invalid syntax. An attribute value can be either plain text, or an RT expression. You can't mix the two forms. Try this instead: html:text property=%='num_linea['+i+']% / But I'd strongly suggest getting EL working and avoiding RT expressions and scriptlets altogether. L. Ed Griebel wrote: I've done EL expressions like you want to do. Try using the -el version of the html tag: html-el:text property=num_linea[${i}]/ On 3/16/07, irene [EMAIL PROTECTED] wrote: Hi, I have a problem with Struts tags. I can't use any expression (EL, runtime) in the tag attributes : html:text property=num_linea[${i}] / html:text property=num_linea[%=i%] / The result is an error: Invalid argument looking up property: num_linea[%=i%] I suppose i have something wrong in my webapp configuration... I use tomcat 5, struts 1.2.9 Please help!!! -- View this message in context: http://www.nabble.com/Please-help%3A-Struts-tags-don%27t-evaluate-any-expressions-tf3413607.html#a9511739 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Please-help%3A-Struts-tags-don%27t-evaluate-any-expressions-tf3413607.html#a9571429 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please help: Struts tags don't evaluate any expressions
Hi, I have a problem with Struts tags. I can't use any expression (EL, runtime) in the tag attributes : html:text property=num_linea[${i}] / html:text property=num_linea[%=i%] / The result is an error: Invalid argument looking up property: num_linea[%=i%] I suppose i have something wrong in my webapp configuration... I use tomcat 5, struts 1.2.9 Please help!!! -- View this message in context: http://www.nabble.com/Please-help%3A-Struts-tags-don%27t-evaluate-any-expressions-tf3413607.html#a9511739 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]