Re: OT- Versioning in Struts
2010/1/4 Paul Benedict pbened...@apache.org: 1 = Struts 1 IOW, the old famous and, sigh, obsolete framework for web application. 2 = Struts 2 IOW, the framework that has been imported from the OpenSymphony's WebWork framework codebase. As you can see, they are not two versions of the same framework, but two different products, connected only by their name. Antonio - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Beginner Query on Struts tiles
Hi , Iam new to struts,currently iam migrating existing app to struts2 Iam having 2 web application running in server I need to call 2nd web app in 1st currently iam using Iframes frame sets , is there any other way do this? Is it possible to use Struts Tiles for this ? Kindly reply Thanks in advance, -- View this message in context: http://old.nabble.com/Beginner--Query-on-Struts-tiles-tp27026099p27026099.html Sent from the Struts - User mailing list archive at Nabble.com.
Re: Beginner Query on Struts tiles
2010/1/5 steff_uk aravin...@hotmail.com: I need to call 2nd web app in 1st currently iam using Iframes frame sets , is there any other way do this? Yes, you could extract the 2nd webapp response's body and insert it into the 1st. For this, take a look at Sitemesh: http://www.opensymphony.com/sitemesh/ Is it possible to use Struts Tiles for this ? You can use Tiles and Frames together, you should use the normal HTML tags for frames and insert attributes using Tiles JSP tags. Notice that Tiles may work only under a single webapp, currently it cannot extract content from an external resource. For questions about Tiles, please ask the Tiles Users mailing list: http://tiles.apache.org/mail.html Antonio - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts 1.3.9 validation oddity - If non-default bundle specified for 'msg', 'arg' must also define bundle attribute
Hi I am using Struts 1.3.9 and validator_1_3_0.dtd. I have defined some message resources in my struts-moduleX.xml as follows: I then define a field validation for e.g. propertyX in my validation-moduleX.xml as follows: In this case, I place both 'label.propertyX' and 'errors.mask.propertyX' in ApplicationResources, both are found ok, and the message displays the text of both keys correctly. If I place both in ModuleXResources, and define the validation without specifying a bundle as follows: the message also displays correctly. If I place the arg key 'label.propertyX' in ApplicationResources and the msg key 'errors.mask.propertyX' in ModuleXResources, and define the validation as follows: the message also displays correctly. HOWEVER, if I place the arg key 'label.propertyX' in ModuleXResources and the msg key 'errors.mask.propertyX' in ApplicationResources, and define the validation as follows: then I get '??label.propertyX??' in my message - i.e. label.propertyX is not located. Basically, it seems that if I specify a bundle attribute for the msg key, then I must specify a bundle attribute for the arg key (even if it is a different bundle) - it cannot find the arg key if it is left in the default bundle. As I would like the flexibility of choosing where to put my keys, I would appreciate some explanation as to why this is so, or whether it is a bug. thanks, Baljeet. -- View this message in context: http://old.nabble.com/Struts-1.3.9-validation-oddity---If-non-default-bundle-specified-for-%27msg%27%2C-%27arg%27-must-also-define-bundle-attribute-tp27026593p27026593.html Sent from the Struts - User mailing list archive at Nabble.com.
S2: Problem Infinite recursion detected
Hi, We have an action which causes an Infinite recursion detection. I don't have any idea why this is happening. When we call the action the first time everything is ok. But when we call this the second time we get this exception: 05.01.2010 13:45:00 org.apache.catalina.core.StandardWrapperValve invoke SCHWERWIEGEND: Servlet.service() for servlet default threw exception Infinite recursion detected: [/rmr/calcSumsAndSavePersonData!calcSums, /rmr/iwa.error, /rmr/iwa.error] - [unknown location] at com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:207) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) at com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:229) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.seb.iwa.view.sec.UserResourcesFilter.doFilter(UserResourcesFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.seb.iwa.view.user.UserInfoFilter.doFilter(UserInfoFilter.java:67) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.seb.iwa.view.login.LoginFilter.doFilter(LoginFilter.java:124) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.seb.portal.signature.IIWSignatureFilter.doFilter(IIWSignatureFilter.java:144) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) The ftl which causes the error when the action is triggered the second time: div id=jahrFormFields class=fieldset h1Gueltigkeit/h1 div class=addcontent label class=medium resultJahr/label @s.textfield name=privatBilanz.jahr cssClass=small numeric result tabindex=10/ span class=spacernbsp;/span br / /div /div br / div id=aktivaFormFields class=fieldset h1Aktiva/h1 div class=content label class=mediumImmobilien/label @s.textfield key=privatBilanz.summeImmobilien value=%{getText('format.amount',{privatBilanz.summeImmobilien})} cssClass=small numeric tabindex=10/ span class=euro spacereuro;/span br/ /div !-- content -- /div !-- fieldset -- br/ !-- --- -- !-- Bind SaveButton with onclick !-- --- -- @s.url id=privatBilanzUrl action=calcSumsAndSavePersonData includeParams=none @s.param name=targetprivatBilanz/@s.param /@s.url script language=JavaScript type=text/javascript var saveButton = $('#saveButton'); saveButton.unbind(click); saveButton.click(function() { alert('${privatBilanzUrl}'); showMask('privatBilanzWF', '${privatBilanzUrl}') }); /script The Javascript: function showMask(workflowItemName, url) { var params = $(form).serialize(); updateDiv('sitecontent', url, params); } function updateDiv(div, actionUrl, params) { $('#'+div).load(actionUrl, params); } Struts.xml action name=calcSumsAndSavePersonData method=calcSums class=de.seb.rmr.view.action.EditPerson result
S2: Problem Infinite recursion detected
Hi, We have an action which causes an Infinite recursion detection. I don't have any idea why this is happening. When we call the action the first time everything is ok. But when we call this the second time we get this exception: 05.01.2010 13:45:00 org.apache.catalina.core.StandardWrapperValve invoke SCHWERWIEGEND: Servlet.service() for servlet default threw exception Infinite recursion detected: [/rmr/calcSumsAndSavePersonData!calcSums, /rmr/iwa.error, /rmr/iwa.error] - [unknown location] at com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:207) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) at com.opensymphony.xwork2.ActionChainResult.execute(ActionChainResult.java:229) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:422) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.seb.iwa.view.sec.UserResourcesFilter.doFilter(UserResourcesFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.seb.iwa.view.user.UserInfoFilter.doFilter(UserInfoFilter.java:67) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.seb.iwa.view.login.LoginFilter.doFilter(LoginFilter.java:124) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at de.seb.portal.signature.IIWSignatureFilter.doFilter(IIWSignatureFilter.java:144) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) The ftl which causes the error when the action is triggered the second time: div id=jahrFormFields class=fieldset h1Gueltigkeit/h1 div class=addcontent label class=medium resultJahr/label @s.textfield name=privatBilanz.jahr cssClass=small numeric result tabindex=10/ span class=spacernbsp;/span br / /div /div br / div id=aktivaFormFields class=fieldset h1Aktiva/h1 div class=content label class=mediumImmobilien/label @s.textfield key=privatBilanz.summeImmobilien value=%{getText('format.amount',{privatBilanz.summeImmobilien})} cssClass=small numeric tabindex=10/ span class=euro spacereuro;/span br/ /div !-- content -- /div !-- fieldset -- br/ !-- --- -- !-- Bind SaveButton with onclick !-- --- -- @s.url id=privatBilanzUrl action=calcSumsAndSavePersonData includeParams=none @s.param name=targetprivatBilanz/@s.param /@s.url script language=JavaScript type=text/javascript var saveButton = $('#saveButton'); saveButton.unbind(click); saveButton.click(function() { alert('${privatBilanzUrl}'); showMask('privatBilanzWF', '${privatBilanzUrl}') }); /script - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Displaying an image in JSP in struts+tiles project
Being a fan of the KISS policy... I played around with this but didn't have the time to figure it out, so I made the URL spat out by struts2 points to a servlet instead of struts2. (Note that my web.xml has struts2 configured to listen for *.action rather then slash-star) Good luck please let me know what your solution is. Thanks! -dave -Original Message- From: Aruna Ponaka [mailto:aruna@gmail.com] Sent: Monday, January 04, 2010 5:09 PM To: user@struts.apache.org Subject: Displaying an image in JSP in struts+tiles project Hi, Am building an application in struts2 and tiles. My requirement is to retrieve an image blob from mysql database and display the image in a jsp using img tag as below.. img src=s:url action=myAction/ Part of my struts.xml is as below: package name=default extends=struts-default result-types result-type name=tiles class=org.apache.struts2.views.tiles.TilesResult / result-type name=myBytesResult class=com.icensa.action.MyBytesResult /result-typebr /result-types action name=myAction class=com.icensa.action.MyAction result name=myImageResult type=myBytesResult / /action /package My MyBytesResult class is: public class MyBytesResult implements Result { private static final long serialVersionUID = 1L; public void execute(ActionInvocation invocation) throws Exception { MyAction action = (MyAction) invocation.getAction(); HttpServletResponse response = ServletActionContext.getResponse(); response.setContentType(image/jpeg); //response.setContentLength(action.getMyContentLength()); response.getOutputStream().write(action.getMyImageInBytes()); response.getOutputStream().flush(); } } And MyAction class is: public class MyAction extends ActionSupport { private static final long serialVersionUID = 1L; Blob image = null; Connection con = null; Statement stmt = null; ResultSet rs = null; byte[] imgData = null; OutputStream o = null; HttpServletResponse response = ServletActionContext.getResponse(); public String doDefault() { System.out.println(doDefault()); try { Class.forName(com.mysql.jdbc.Driver); con = DriverManager.getConnection(jdbc:mysql://localhost:3306/proje ct,root,pass); stmt = con.createStatement(); rs = stmt.executeQuery(select * from books_tb where category='General' order by publish_date desc); while (rs.next()) { image = rs.getBlob(11); imgData = image.getBytes(1,(int)image.length()); } } catch (Exception e) { System.out.println(e.getMessage()); } return myImageResult; } public byte[] getMyImageInBytes() { System.out.println(getMyImageInBytes()); try{ } catch (Exception e) { System.out.println(e.getMessage()); } return imgData; } // public String getMyContentType() { } // public String getMyContentDisposition() {} // public int getMyContentLength() { } // public int getMyBufferSize() { } } when i run the code the image is not displayed and I get an error saying No result defined for action com.action.MyAction and result success In struts.xml is I provide reslut name=success and the jsp, it does not throw an error but not displaying the image. However in any case it is not going to MyAction.java. What could i do to rectify this? Could provide you with required code if necessary.. Thanks, Aruna -- View this message in context: http://old.nabble.com/Displaying-an-image-in-JSP-in-struts%2Bt iles-project-tp27020146p27020146.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 Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you
problems with struts2 and session
Hi people, i'm a newbie to struts2. I'm having too many problems modifing session parameters. I use %= session.getAttribute( variable ) % to gain access to variable and that works when i modify variable into a jsp page, but not inside a struts action. struts.xml: ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts constant name=struts.enable.DynamicMethodInvocation value=false / constant name=struts.devMode value=true / package name=tads namespace=/ extends=struts-default action name=HolaMundo class=tads.HolaMundo result/holaMundo.jsp/result /action action name=Catalogo class=tads.Catalogo result name=error/ErrorCatalogo.jsp/result result/Catalogo.jsp/result /action action name=Actualiza class=tads.Actualiza result/Actualiza.jsp/result /action /package /struts extract from a jsp page, result from an ajax action working: s:form id=form s:textfield name=politico label=politico/br s:hidden name=prueba value=escondido / /s:form s:url id=actualiza value=/Actualiza.action / sx:submit type=button label=dale href=%{actualiza} formId=form align=center targets=secondaryContent/ i see politico and prueba into Actualiza.action so the action Actualiza works. Actualiza.java: package tads; import java.util.*; import javax.servlet.http.HttpSession; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.interceptor.SessionAware; import com.opensymphony.xwork2.ActionContext; @SuppressWarnings(serial) public class Actualiza extends ActionSupport implements SessionAware { private String politico; private String prueba; private Map session; public String execute() throws Exception { this.getSession().put(variable,pruebamil); return SUCCESS; } public String getPolitico() { return politico; } public void setPolitico(String politico) { this.politico = politico; } public String getPrueba() { return prueba; } public void setPrueba(String prueba) { this.prueba = prueba; } public void setSession(Map session) { this.session = session; } public Map getSession() { return session; } } in that situation. Actualiza.jsp doesn't show variable atribute from session, using %= session.getAttribute( variable ) %. It shows null. can anybody help me? I'm doing exactly what struts2 FAQ say (How do we get access to the session). thanks in advance. -- Sergio - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: problems with struts2 and session
Sergio escribió: Hi people, i'm a newbie to struts2. I'm having too many problems modifing session parameters. I use %= session.getAttribute( variable ) % to gain access to variable and that works when i modify variable into a jsp page, but not inside a struts action. struts.xml: ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts constant name=struts.enable.DynamicMethodInvocation value=false / constant name=struts.devMode value=true / package name=tads namespace=/ extends=struts-default action name=HolaMundo class=tads.HolaMundo result/holaMundo.jsp/result /action action name=Catalogo class=tads.Catalogo result name=error/ErrorCatalogo.jsp/result result/Catalogo.jsp/result /action action name=Actualiza class=tads.Actualiza result/Actualiza.jsp/result /action /package /struts extract from a jsp page, result from an ajax action working: s:form id=form s:textfield name=politico label=politico/br s:hidden name=prueba value=escondido / /s:form s:url id=actualiza value=/Actualiza.action / sx:submit type=button label=dale href=%{actualiza} formId=form align=center targets=secondaryContent/ i see politico and prueba into Actualiza.action so the action Actualiza works. Actualiza.java: package tads; import java.util.*; import javax.servlet.http.HttpSession; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.interceptor.SessionAware; import com.opensymphony.xwork2.ActionContext; @SuppressWarnings(serial) public class Actualiza extends ActionSupport implements SessionAware { private String politico; private String prueba; private Map session; public String execute() throws Exception { this.getSession().put(variable,pruebamil); return SUCCESS; } public String getPolitico() { return politico; } public void setPolitico(String politico) { this.politico = politico; } public String getPrueba() { return prueba; } public void setPrueba(String prueba) { this.prueba = prueba; } public void setSession(Map session) { this.session = session; } public Map getSession() { return session; } } in that situation. Actualiza.jsp doesn't show variable atribute from session, using %= session.getAttribute( variable ) %. It shows null. can anybody help me? I'm doing exactly what struts2 FAQ say (How do we get access to the session). thanks in advance. i've tried with %= session.getAttribute( variable ) % and s:property value=#session.variable/s:property and surprise, both works. After closing and opening eclipse 3.4.0 works. I think this is a bad memory managing of eclipse. Does anybody knows something about this? -- Sergio - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Dispatcher with precompiled JSP
Hello, I have an action result type dispatcher with param name location equal to the path to the JSP, but I have precompiled the JSPs and it now seems the dispatcher cannot locate the JSP class. I tried changing the location to the fully qualified class name of the compiled JSP with the same result: There is no Action mapped for action name MyAction (unknown location) Is there a way to reference the precompiled JSP in the dispatcher? Any help would be appreciated. Thanks, Lee - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: How is the max file size controlled for file uploads in Struts 1.3.8?
I guess the main problem is that the request params are gone. So not only if the file not submitted, but none of the params are submitted. The rest of the params need to be made available, imo... Frank Russo Developer ▪ Financial Services Division SAS® … THE POWER TO KNOW® -Original Message- From: paulus.benedic...@gmail.com [mailto:paulus.benedic...@gmail.com] On Behalf Of Paul Benedict Sent: Saturday, October 03, 2009 9:20 PM To: Struts Users Mailing List Subject: Re: How is the max file size controlled for file uploads in Struts 1.3.8? Frank, Do you prefer an exception? What would you do with it? Paul On Thu, Jul 9, 2009 at 8:17 AM, Frank Russo frank.ru...@sas.com wrote: org.apache.struts.util.RequestUtils has the following at lines 408-415: Boolean maxLengthExceeded = (Boolean) request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED); if ((maxLengthExceeded != null) (maxLengthExceeded.booleanValue())) { ((ActionForm) bean).setMultipartRequestHandler(multipartHandler); return; } Why would it just return? Shouldn't it throw some kind of exception? When my action is called, I have no way to know that the max file size was exceeded, and my request params are empty, so the correct DispatchAction method isn't being called. Has anyone else seen this behavior? Frank Russo Developer ▪ Financial Services Division SAS® … THE POWER TO KNOW® - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
[SOLVED] RE: Dispatcher with precompiled JSP
My mistake, there needs to be a slash after the context, otherwise the page was not loading completely (still not exactly sure way, probably due to mod_jk - part of the page loaded, but not the s:action tag/dispatcher) -Original Message- From: j...@leeclemens.net [mailto:j...@leeclemens.net] Sent: Tuesday, January 05, 2010 4:57 PM To: user@struts.apache.org Subject: Dispatcher with precompiled JSP Hello, I have an action result type dispatcher with param name location equal to the path to the JSP, but I have precompiled the JSPs and it now seems the dispatcher cannot locate the JSP class. I tried changing the location to the fully qualified class name of the compiled JSP with the same result: There is no Action mapped for action name MyAction (unknown location) Is there a way to reference the precompiled JSP in the dispatcher? Any help would be appreciated. Thanks, Lee - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org