Struts - optiontransferselect - Triple
Is it possible to customize / Build optiontransferselect for three dropdown boxes With Triple List (3 List boxes with Left and Right buttons)? s:optiontransferselect tooltip=Select Your Favourite Cartoon Characters label=Favourite Cartoons Characters name=leftSideCartoonCharacters leftTitle=Left Title rightTitle=Right Title list={'Popeye', 'He-Man', 'Spiderman'} multiple=true headerKey=headerKey headerValue=--- Please Select --- emptyOption=true doubleList={'Superman', 'Mickey Mouse', 'Donald Duck'} doubleName=rightSideCartoonCharacters doubleHeaderKey=doubleHeaderKey doubleHeaderValue=--- Please Select --- doubleEmptyOption=true doubleMultiple=true / DISCLAIMER: This email may contain confidential information and is intended only for the use of the specific individual(s) to which it is addressed. If you are not the intended recipient of this email, you are hereby notified that any unauthorized use, dissemination or copying of this email or the information contained in it or attached to it is strictly prohibited. If you received this message in error, please immediately notify the sender at Infotech or mail.ad...@infotech-enterprises.com and delete the original message.
Struts1 Plugin to Struts2
I have scenarios of few activities during application startup and shutdown in struts1 application which need to be used in struts2 application. Example: Below struts2 plug-in needs to be used in struts2. plug-in className=com.test.util.TestListener set-property property=devlFile value=/TestConfig/test.properties/ /plug-in Any best thoughts of implementing this. Regards, Raghu
RE: Struts1 Plugin to Struts2
Yes Dave, I want to implement Struts2 specific. Application context listener will be called before application and struts.xml configurations. I want to do it from struts.xml rather then from web.xml. How would it be if I create custom interceptor and use init and destroy for this. I will not be using this interceptor stack anywhere in my action mappings. The reason for interceptor stack is, it will be initialized during application startup from struts.xml _ From: Dave Newton [mailto:davelnew...@gmail.com] Sent: Friday, October 01, 2010 6:17 PM To: Struts Users Mailing List; raghuve...@infotechsw.com Subject: Re: Struts1 Plugin to Struts2 An application context listener--that way it's not S2-specific. Dave On Fri, Oct 1, 2010 at 5:03 AM, Raghuveer V raghuve...@infotechsw.com wrote: I have scenarios of few activities during application startup and shutdown in struts1 application which need to be used in struts2 application. Example: Below struts2 plug-in needs to be used in struts2. plug-in className=com.test.util.TestListener set-property property=devlFile value=/TestConfig/test.properties/ /plug-in Any best thoughts of implementing this. Regards, Raghu
RE: Struts 2, Log4J and turning off WARNING messages
1. Place log4j.properties in WEB-INF\classes 2. Set log4j.logger.org.apache.struts2=warn, struts in log4j.properties. Raghuveer -Original Message- From: carl ballantyne [mailto:carl.ballant...@cast-info.es] Sent: Wednesday, March 03, 2010 6:25 PM To: Struts Users Mailing List Subject: Struts 2, Log4J and turning off WARNING messages Hi All, I cannot seem to turn off the warning messages Struts 2 is putting in my log files. This makes it impossible to follow debugging in some parts of the applications. I keep getting messages like following: [#|2010-03-03T13:45:10.345+0100|WARNING|sun-appserver2.1|org.apache.struts2. util.TextProviderHelper|_ThreadID=23;_ThreadName=httpSSLWorkerThread-8080-2; _RequestID=5867914b-d1a7-4fd5-a848-a419944b1ad6;|The default value expression 'Guardar' was evaluated and did not match a property. The literal value 'Guardar' will be used.|#] I have googled around and looked at the archives and cannot find a solution that works. Below is my log4j.properties which is in the WEB-INF/classes folder. # Set root logger level to WARN and append to stdout log4j.rootLogger=ERROR, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n # Print only messages of level ERROR or above in the package noModule. log4j.logger.noModule=FATAL Any ideas? Anyone else having the same problem? Cheers, Carl. *Advertencia legal: en virtud de lo establecido en la Ley Organica 15/1999 de Proteccion de Datos de Caracter Personal, le informamos de que los datos personales que pueda facilitarnos se incorporaran a un fichero automatizado titularidad de CAST INFO, S.A. con la finalidad de gestionar la relacion negocial que nos vincula. Podra revocar su consentimiento al tratamiento de los datos, asi como ejercer sus derechos de acceso, rectificacion, cancelacion u oposicion dirigiendose por escrito a CAST INFO domiciliada en C/ Tuset 23, 1 -- 08006 Barcelona, o a la direccion de correo electronico l...@cast-info.es. Este mensaje y los ficheros anexos que pueda contener son confidenciales, pueden contener informacion sometida a secreto profesional y se dirige exclusivamente a su destinatario. Si ha recibido este mensaje por error o tiene conocimiento del mismo por cualquier motivo, le rogamos que nos lo comunique inmediatamente por este mismo medio y se abstenga de utilizarlo, reproducirlo, alterarlo, archivarlo o comunicarlo a terceros. El emisor no se responsabiliza de posibles perjuicios derivados de la captura, incorporaciones de virus o cualesquiera otras manipulaciones efectuadas por terceros. Antes de imprimir este e-mail piense bien si es necesario hacerlo. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
FW: Struts 2, Log4J and turning off WARNING messages
1. Place log4j.properties in WEB-INF\classes 2. Set log4j.logger.org.apache.struts2=warn, struts in log4j.properties. Raghuveer -Original Message- From: carl ballantyne [mailto:carl.ballant...@cast-info.es] Sent: Wednesday, March 03, 2010 6:25 PM To: Struts Users Mailing List Subject: Struts 2, Log4J and turning off WARNING messages Hi All, I cannot seem to turn off the warning messages Struts 2 is putting in my log files. This makes it impossible to follow debugging in some parts of the applications. I keep getting messages like following: [#|2010-03-03T13:45:10.345+0100|WARNING|sun-appserver2.1|org.apache.struts2. util.TextProviderHelper|_ThreadID=23;_ThreadName=httpSSLWorkerThread-8080-2; _RequestID=5867914b-d1a7-4fd5-a848-a419944b1ad6;|The default value expression 'Guardar' was evaluated and did not match a property. The literal value 'Guardar' will be used.|#] I have googled around and looked at the archives and cannot find a solution that works. Below is my log4j.properties which is in the WEB-INF/classes folder. # Set root logger level to WARN and append to stdout log4j.rootLogger=ERROR, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n # Print only messages of level ERROR or above in the package noModule. log4j.logger.noModule=FATAL Any ideas? Anyone else having the same problem? Cheers, Carl. *Advertencia legal: en virtud de lo establecido en la Ley Organica 15/1999 de Proteccion de Datos de Caracter Personal, le informamos de que los datos personales que pueda facilitarnos se incorporaran a un fichero automatizado titularidad de CAST INFO, S.A. con la finalidad de gestionar la relacion negocial que nos vincula. Podra revocar su consentimiento al tratamiento de los datos, asi como ejercer sus derechos de acceso, rectificacion, cancelacion u oposicion dirigiendose por escrito a CAST INFO domiciliada en C/ Tuset 23, 1 -- 08006 Barcelona, o a la direccion de correo electronico l...@cast-info.es. Este mensaje y los ficheros anexos que pueda contener son confidenciales, pueden contener informacion sometida a secreto profesional y se dirige exclusivamente a su destinatario. Si ha recibido este mensaje por error o tiene conocimiento del mismo por cualquier motivo, le rogamos que nos lo comunique inmediatamente por este mismo medio y se abstenga de utilizarlo, reproducirlo, alterarlo, archivarlo o comunicarlo a terceros. El emisor no se responsabiliza de posibles perjuicios derivados de la captura, incorporaciones de virus o cualesquiera otras manipulaciones efectuadas por terceros. Antes de imprimir este e-mail piense bien si es necesario hacerlo. - 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
RE: How to convert request parameters into Collection type - Set
Try as below. s:iterator value=addresses status=row s:textfield name=addresses[%{#row.index}].city name=%{city} / s:textfield name=addresses[%{#row.index}].state name=%{state} / /s:iterator Regards, Raghuveer Vellanki -Original Message- From: Mittal, Nitin (US - Mumbai) [mailto:nimit...@deloitte.com] Sent: Wednesday, January 20, 2010 10:54 PM To: Struts Users Mailing List Subject: RE: How to convert request parameters into Collection type - Set Ok, so I want to understand how that would work if Set contains elements of a complex type,like Address as follows: setAddresses(SetAddress adresses) Inthis case, Jsp should define text fields as follows: addresses.city addresses.state adresses.city addresses.state How would struts arrange the fields above into a set of Address objects, associating right combination of city and state for each Address Nitin Mittal, Deloitte Consulting India Pvt. Ltd Tel: + 91 9819213942(mobile) nimit...@deloitte.com - Original Message - From: Steven Yang kenshin...@gmail.com Sent: 20 January 2010 6:49 PM To: Struts Users Mailing List user@struts.apache.org Subject: Re: How to convert request parameters into Collection type - Set simply loose the [n] just have all fields with name middleNames On Wed, Jan 20, 2010 at 8:34 PM, Mittal, Nitin (US - Mumbai) nimit...@deloitte.com wrote: Hi, I need help in mapping JSP text fields to a setter in action class which have parameter as SetString I know Struts 2 supports automatically converting sets of request parameters into properties of various Collection type Lists This can be done by having a setter in the action class as - setMiddleNames(ArrayListString middleNames) JSP code should contain text fields as follows:- s:textfield name=middleNames[0] label=middleNames/ s:textfield name=middleNames[1] label=middleNames/ s:textfield name=middleNames[2] label=middleNames/ Question :- How to map JSP text Fields or Hidden fields to setters in Action class which have parameter as SetString For example, how should I define text fields in JSP so that they can be mapped to the following setter in Action Class:- setMiddleNames(SetString) Thanks, Nitin Mittal Deloitte Consulting India Private Limited cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999 nimit...@deloitte.com . Please consider the environment before printing. This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1] - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: [Struts 2] OGNL debug console not working
That would work only when you enable it in configuration Either in struts.properties or struts.xml Example: in struts.properties set devmode to true.. struts.devMode=true -Original Message- From: Celinio Fernandes [mailto:cel...@yahoo.com] Sent: Wednesday, January 20, 2010 7:41 PM To: Struts Users Mailing List Subject: [Struts 2] OGNL debug console not working Hi, I am trying to run the debug console that is available in a popup when you append the URL with ?debug=console It is described here : http://struts.apache.org/2.0.14/docs/debugging.html Here is the URL i used : http://localhost:8085/myWebApp/doLogin.action?debug.console It complains that it cannot create a session after the response was sent. As a consequence, i believe, the console is read only, I cannot type anything. What did i do wrong or what am i missing ? Thanks for helping. Here is the stack trace i get : Struts Problem Report Struts has detected an unhandled exception: # Messages: Impossible de cr�er une sessionapr�s que la r�ponse ait �t� envoy�e File: org/apache/catalina/connector/Request.java Line number: 2 338 Stacktraces java.lang.IllegalStateException: Impossible de creer une session apres que la reponse ait ete envoyee org.apache.catalina.connector.Request.doGetSession(Request.java:2338) org.apache.catalina.connector.Request.getSession(Request.java:2094) org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:83 3) javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr apper.java:216) org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:179) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(Debu ggingInterceptor.java:272) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingIn terceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareIn terceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method FilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nIntercepto r.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletCon figInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasIntercep tor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(Ex ceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOper ations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilt er(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:206) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja va:96) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:235) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci ationValve.java:183) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java: 95) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(Secu rityContextEstablishmentValve.java:126) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(Secur ityContextEstablishmentValve.java:70) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127 ) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102 ) org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnecti onValve.java:158) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :109)
RE: validation in struts2
Your XML file needs to be renamed as,LoginAction-validation.xml -Original Message- From: Gabriel Belingueres [mailto:belingue...@gmail.com] Sent: Wednesday, January 20, 2010 8:43 PM To: Struts Users Mailing List Subject: Re: validation in struts2 the form tag is wrong? try: s:form action=doLogin namespace=/tricky 2010/1/19 Shasha sarada.i...@yahoo.com: Hi All, I am not able to get the validation errors from Login-validation.xml when i am using Modeldriven . Login-validation.xml 1. !DOCTYPE validators PUBLIC 2. -//OpenSymphony Group//XWork Validator 1.0.2//EN 3. http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd; 4. 5. validators 6. field name=username 7. field-validator type=requiredstring 8. message key=requiredstring/ 9. /field-validator 10. /field 11. field name=password 12. field-validator type=requiredstring 13. message key=requiredstring/ 14. /field-validator 15. /field 16. /validators LoginAction.java 1. public class LoginAction extends ActionSupport implements ModelDriven,SessionAware{ 2. 3. private User user = new User(); 4. private Map session; 5. private UserDAO userDAO = new UserDAOImpl(); 6. 7. public String execute() throws Exception { 8. 9. boolean success=userDAO.verifyUser(user); 10. if (success) 11. return SUCCESS; 12. else 13. return ERROR; 14. } 15. 16. public Object getModel() { 17. return user; 18. } 19. 20. public void setSession(Map session) { 21. this.session=session; 22. } 23. 24. public Map getSession() { 25. return session; 26. } 27. 28. } login.jsp 1. %@ taglib prefix=s uri=/struts-tags % 2. html 3. head 4. titleStruts 2 Login Application!/title 5. 6. link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ 7. 8. /head 9. body 10. s:form action=doLogin.action method=POST 11. tr 12. td colspan=2Login/td 13. /tr 14. tr 15. td colspan=2 16. s:actionerror / 17. s:fielderror / 18. /td 19. /tr 20. 21. s:textfield name=username label=Login name/ 22. s:password name=password label=Password/ 23. s:submit value=Login align=center/ 24. 25. /s:form 26. 27. /body 28. 29. /html http://old.nabble.com/file/p27236040/error.jpg -- View this message in context: http://old.nabble.com/validation-in-struts2-tp27236040p27236040.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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Hiding URL in struts1.2
Could you elaborate your requirement? URL will be changed when you use action name= loginv class=com.test.actions.LoginAction !-- Home -- result name=app_home_action type=redirectAction showHome /result /action action name= showHome class=com.utc.pw.spanas.actions.CHome /action -Original Message- From: Brian Thompson [mailto:elephant...@gmail.com] Sent: Wednesday, January 20, 2010 9:13 PM To: Struts Users Mailing List Subject: Re: Hiding URL in struts1.2 I would look into using URLRewrite [1]. It would be easy to go from showing this in the browser: http://localhost:8180/webproject/showHome to the application processing this: http://localhost:8180/webproject/loginv.do?dispmethd=showHome [1] - http://tuckey.org/urlrewrite/ On Wed, Jan 20, 2010 at 5:23 AM, chen thomas thomasche...@gmail.com wrote: Maybe you could use post method of Form to do this - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Migration from Struts1 to Struts2.1.6 - Plugin in Application Starup
I need to migrate an application from struts1 to struts2.1.6. I had a plug-in configurations existing in Strut1 application related to SAP connection pool creation(CCreateSAPConnectionPlugin.java as shown below implementing org.apache.struts.action.PlugIn).This will create a SAP connection pool with connections. How this can be implemented through struts2.1.6. Is there a facility to implement custom plugin and to make it called dusting application startup. !-- == Declare Log Plugin =-- plug-in className=com.utc.test.loadonstatup..util.LogPlugin set-property property=devlLogConfigFile value=/log4j.properties/ /plug-in !-- == Declare SAP Plugin =-- plug-in className=com.utc.test.loadonstatup..util.CCreateSAPConnectionPlugin set-property property=devlSapConfigFile value=/config/config.properties/ /plug-in Regards, Raghu
Struts 1.2.9 +Ajax Error -- java.lang.IllegalStateException
Hello, I am using Ajax in my struts application. From JavaScript in JSP page I call employee.do?method=employee I get following error java.lang.IllegalStateException: Cannot forward after response has been committed For Ajax calls I am using struts execute method. But Action Forward may not be used. Any suggestion for this to resolve. I assume I get this error because of return mapping.findForward(strResult); Actual my response is already done for Ajax requests through response.getWriter, So struts actionforward may not be used in this scenarios. public ActionForward employee(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) { try { sb.append(employee); sb.append(id100/id); sb.append(namejohn/name); sb.append(email[EMAIL PROTECTED]/email); sb.append(phone123123/phone); sb.append(/employee ); response.setHeader(Cache-Control, no-cache); out = response.getWriter(); out.println(sb); out.flush(); out.close(); } catch (IOException e) { logger.error(IOException - +e); handleException(e, CLASS_NAME, request); strResult=CActionPageForwards.GLOBAL_FORWARD_ACTIONERROR; }finally{ //if (out != null) { //out.close(); //out = null; //} } strResult=CActionPageForwards.FORWARD_EMPLOYEE_REQUEST; logger.info(Result - +strResult); return mapping.findForward(strResult); }//end execute
InternetExplorer View... Encoding
I have designed a web multiannual web application in UTF-8. JSP Code: %@ page contentType=text/html;charset=utf-8 % % request.setCharacterEncoding(utf-8); // this can be added in Servlet Filter or in Action Form % When JSP page is rendered it is found in IE View... Encoding Unicode (UTF-8) Is it possible to restrict the user to change encoding option in browser? Example: IE View... Encoding Central European Is there a way to identify in JSP or in Action File if the encoding has been modified at client side by user and show a message that This application has been design to work in UTF-8 Encoding
RE: InternetExplorer View... Encoding
Even though if client browser has languages /different q values. In my application Language / Locale is not identified by request.getHeader(Accept-Charset) . SO this will be null. I am build local object for multiple languages based on click of button. Setting the locale object insession for Globals.LOCALE_KEY. In JSP pages I am testing the respective locales by request.getSession().getAttribute(Globals.LOCALE_KEY) -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2008 5:35 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: InternetExplorer View... Encoding 2008/6/26 Raghuveer [EMAIL PROTECTED]: Is there a way to identify in JSP or in Action File if the encoding has been modified at client side by user and show a message that This application has been design to work in UTF-8 Encoding Yes, check the Accept-Charset header field: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2 Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Character encoding for http request - Configuration for complete application
I am working on I18N application. To handle Http request and response in utf8 I have added following code in my Actionform. Is there way in struts to configure this for my complete application in struts? If it is normal servlet we can do this in init() method. public void reset(ActionMapping mapping, HttpServletRequest request) { super.reset(mapping, request); //To reset all input fields try { request.setCharacterEncoding(UTF-8); } catch (UnsupportedEncodingException ex) { } }// end of reset()
retriving polish characters from URL Query string
Polish characters from other web application. I had requirement of retrieving the login details like user_id,name from parent web application. At present I am retrieving by . request.getParameter(user_id) request.getParameter(name) Some times names can be in Polish language from parent web application. What changes i need to make in my JSP Struts web application in order to retrieve the polish characters From URL by http request with out corruption in characters. Could you please advice if the following code is correct Example: if(request.getParameter(name)!=null){ strTemp = request.getParameter(name); if(strTemp!=null !.equalsIgnoreCase(strTemp)){ strTemp=processText(strTemp); } } /** * This method is used to process the text coming from HttpRequest. * ISO-8859-1 to UTF-8 * @param strText * @return strResult */ private String processText(String strText){ String strConvertedMessage =null; String strResult=null; if(strText!=null !.equalsIgnoreCase(strText)){ try { strConvertedMessage = new String(strText.getBytes(ISO-8859-1), UTF-8); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } strResult=strConvertedMessage; }else{ strResult=strText; } return strResult; }
RE: Reading Application Resource saved as UTF8 file and showing polish characters in browser
Hi, Native2ascii has generated Unicode characters on polish windows system. But could not generate Unicode characters on Windows English Operating System. Thanks a lot to Lukasz and Laurie -Original Message- From: Laurie Harper [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2008 2:24 AM To: user@struts.apache.org Subject: Re: Reading Application Resource saved as UTF8 file and showing polish characters in browser Lukasz Lenart wrote: Hi, 2008/6/9 Raghuveer [EMAIL PROTECTED]: Is it possible in struts to configure the controller to read the application resource file which is saved as UTF8 format? You can use filter from Spring That wouldn't help, since it has nothing to do with resource file loading. It is possible to save the notepad file in UTF8 instead of ANSII. If such notepad support UTF-8, you can use Notepad++ or JDK tool native2ascii which will convert ANSII file to UTF-8, there is also ant task available or many IDEs support such convertion in fly Unfortunately, it is not possible to *read* a resource file saved in this way. Application resource files are implemented under the covers using Java's PropertyResourceBundle which specifies [2] the file format as Latin-1 (ISO-8859-1) encoding with Unicode escapes. What you *can* do, however, is author the files in UTF-8 and then post-process them into the correct encoding during the build process, using any of the tools/techniques Lukasz suggests. L. [1] http://java.sun.com/j2se/1.5.0/docs/api/java/util/PropertyResourceBundle.htm l [2] http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reading Application Resource saved as UTF8 file and showing polish characters in browser
Is it possible in struts to configure the controller to read the application resource file which is saved as UTF8 format? It is possible to save the notepad file in UTF8 instead of ANSII. I am able to save a similar file and read by input stream reader in UTF8 and show the Polish characters in browser. How about same in struts.
i18n Struts Jco Code in Windows English and Polish System
I am working on Struts ,SAP-JCO . This is i18n application running on Tomcat. I have designed my application in UTF8 charset. When Saving the polish characters from application they are saved into SAP Database properly. Before Saving i am doing following String modifications. The same code doesn't work on Tomcat Server on Windows English System.Here the Polish characters( aeclónszz ) are saved as #. What would be cause for this. What changes i need to do in my code to work on both English And Polish Windows (Tomcat Server) strConvertedMessage = new String(strText.getBytes(UTF8), UTF8); inputTable.setValue(strConvertedMessage,TABLENAME);
Action servlet becomes null in UNIX environment
Hi, I have a problem with my application where actionServlet becomes null in UNIX environment and works fine in windows XP system. While saving data on test environment (UNIX) I am getting action servlet as null in My Action class. The jsp is built dynamically in as below *JSP code:* if (newGuide) { sb.append(tr\n); sb.append(td align=right colspan=2\n); sb.append(select name=\actionSelection\); sb.append( option value=saveOnly- Save Assessment/option); sb.append( option value=delete- Delete Assessment/option); sb.append( option value=saveSchedule- Save Schedule/option); sb.append( option value=saveRefer- Save Refer/option); sb.append(/select); sb.append( input type=\submit\ name=\save\ value=\Complete\ class=Button ); sb.append(/td\n); sb.append(/tr\n); } * Action Class // Action class used for security * public void setServlet(ActionServlet actionServlet) { super.setServlet(actionServlet); // Here I get actionServlet as null ServletContext servletContext = actionServlet.getServletContext(); WebApplicationContext wac = WebApplicationContextUtils .getRequiredWebApplicationContext(servletContext); setIcrProcessor((CareRequestProcessor)wac.getBean(myCareRequestProcesso r)); } Because of this I get null pointer exception in class Main Action Class used for saving the data. *Action class code :* public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String method = saveHAGuide; Exception ex = null; ActionForward forward = null; AppUser appUser = getAppUser(request); appUser.methodStart(this, saveHAGuide); HttpSession session = request.getSession(false); String action = request.getParameter(actionSelection); // Here I get action as null Action becomes null and it throws null pointer exception. As UNIX is case sensitive I checked the request parameter which is actionSelection in this class and I do not see any problem with it. I don't know why action servlet becomes null at this point. Please suggest if you have any idea about this. Note: This happens only in test environment (UNIX). Works fine in my local system (Windows XP) . Thanks and regards,
Re: Action servlet becomes null in UNIX environment
Thanks for the prompt reply. Its a late 90's huge application in which now i cannot start using Strus 2 as iam the only developer working on this. We are using html in java code because the JSP changes at run time according to the user inputs . Yeah , i agree that coz of diff environment we face lot of problems but i cannot do anything as its not my decision. We run Apache as a front end for Tomcat. Apache serves up the html pages and uses mod_jk mounts to forward the java application requests to Tomcat. I'll try to find out what else i can do as i am unable to see anything in apache logs as well. On Wed, May 7, 2008 at 1:48 PM, Allen, Daniel [EMAIL PROTECTED] wrote: A couple of things strike me as really odd about this. First: why are you creating HTML using strings in Java code? The whole point of JSPs was to avoid doing exactly that. You should either make use of .jsp files and the logic tags in Struts [1] or just use regular servlets if you really want to manually compose HTML. Second, why is your test environment different from your production environment? That sort of defeats the purpose of testing, since you can no longer rely on the fact that something you tested works. That said, chances are pretty good that you're getting null from that line because the HTTP request represented by the request object didn't have a parameter called actionSelection. I suggest you stick in a breakpoint and have a look at the contents of the object. Hope that helps. ~DVA [1] http://struts.apache.org/1.3.8/struts-taglib/index.html Looks as though you're using Struts 1, but you didn't specify a version, so here's the last release's tag documents. If this is a new app, may I humbly suggest you use Struts2 instead? No sense in starting a project using a deprecated framework. -Original Message- From: Raghuveer Rawat [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 1:18 PM To: Struts Users Mailing List Subject: Action servlet becomes null in UNIX environment Hi, I have a problem with my application where actionServlet becomes null in UNIX environment and works fine in windows XP system. While saving data on test environment (UNIX) I am getting action servlet as null in My Action class. The jsp is built dynamically in as below *JSP code:* if (newGuide) { sb.append(tr\n); sb.append(td align=right colspan=2\n); sb.append(select name=\actionSelection\); sb.append( option value=saveOnly- Save Assessment/option); sb.append( option value=delete- Delete Assessment/option); sb.append( option value=saveSchedule- Save Schedule/option); sb.append( option value=saveRefer- Save Refer/option); sb.append(/select); sb.append( input type=\submit\ name=\save\ value=\Complete\ class=Button ); sb.append(/td\n); sb.append(/tr\n); } * Action Class // Action class used for security * public void setServlet(ActionServlet actionServlet) { super.setServlet(actionServlet); // Here I get actionServlet as null ServletContext servletContext = actionServlet.getServletContext(); WebApplicationContext wac = WebApplicationContextUtils .getRequiredWebApplicationContext(servletContext); setIcrProcessor((CareRequestProcessor)wac.getBean(myCareRequestProcesso r)); } Because of this I get null pointer exception in class Main Action Class used for saving the data. *Action class code :* public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String method = saveHAGuide; Exception ex = null; ActionForward forward = null; AppUser appUser = getAppUser(request); appUser.methodStart(this, saveHAGuide); HttpSession session = request.getSession(false); String action = request.getParameter(actionSelection); // Here I get action as null Action becomes null and it throws null pointer exception. As UNIX is case sensitive I checked the request parameter which is actionSelection in this class and I do not see any problem with it. I don't know why action servlet becomes null at this point. Please suggest if you have any idea about this. Note: This happens only in test environment (UNIX). Works fine in my local system (Windows XP) . Thanks and regards, -- This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as KBC FP). This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values
Request scoped data in Struts2
This doc seems to suggest that even request scoped data needs to explicitly set using s:set to be used by tag libraries like jsp taglib or displaytag http://struts.apache.org/2.x/docs/exposing-framework-objects-to-jstl-with-a-jstl-and-displaytag-example.html But for request scoped data you do not need to explicitly set it as a request attribute,just getters on the action will do ,so a tag library like displaytag will work out of the box display:table name=someName ... .. /display:table where there is a getSomeName( ) method in the Struts2 Action class Am I missing something or does the doc need to be updated? --Raghu A Goal .. Is a Dream with a Deadline - You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
Re: Request scoped data in Struts2
My point is just having getters for an Action property should suffice for it to be accessed in the view by any tag library. Chris Pratt [EMAIL PROTECTED] wrote: You are correct. In that case, is equivalent to calling request.put(someName,action.getSomeName()); in an Action that implements RequestAware. So when Display Tag processes The someName attribute is available when the JSP Tag Library (DisplayTag in this instance) calls pageContext.findAttribute(someName); But you have to use the (or put the value in the request from the action) for DisplayTag to see it. (*Chris*) On Tue, Apr 8, 2008 at 3:12 PM, Raghuveer Kumarakrishnan wrote: This doc seems to suggest that even request scoped data needs to explicitly set using to be used by tag libraries like jsp taglib or displaytag http://struts.apache.org/2.x/docs/exposing-framework-objects-to-jstl-with-a-jstl-and-displaytag-example.html But for request scoped data you do not need to explicitly set it as a request attribute,just getters on the action will do ,so a tag library like displaytag will work out of the box ... .. where there is a getSomeName( ) method in the Struts2 Action class Am I missing something or does the doc need to be updated? --Raghu A Goal .. Is a Dream with a Deadline - You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] A Goal .. Is a Dream with a Deadline - You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
application folder name in webapps folder in tomcat.
I have HelloServlet ,HelloServletContextListener in 3 different applications in tomcat tomcat_homewebapps\AppHello1 tomcat_homewebapps\AppHello2 tomcat_homewebapps\AppHello3 How to identify in my listner class what is the folder/context name in my server. public void contextInitialized(ServletContextEvent ce) { contextName = ce.getServletContext().getServletContextName(); } This code is working only if i have display-nameAppHello1/display-name in web.xml. If there is no display-name in web.xml then above code in listner class is returning null. Is there facility to know application folder name in webapps folder in tomcat.
application folder name in webapps folder in tomcat through struts plugin
I have done this this requirement in org.apache.struts.action.PlugIn. Here also I am getting public void init(ActionServlet actionServlet, ModuleConfig config) throws ServletException { Properties _ini_config = new Properties(); try { String strContext=actionServlet.getServletContext().getServletContextName(); System.out.println(strContext=+strContext); } catch (Exception ex) { System.out.println(Error !+ex); } } I have HelloServlet ,HelloServletContextListener in 3 different applications in tomcat tomcat_homewebapps\AppHello1 tomcat_homewebapps\AppHello2 tomcat_homewebapps\AppHello3 How to identify in my listner class what is the folder/context name in my server. public void contextInitialized(ServletContextEvent ce) { contextName = ce.getServletContext().getServletContextName(); } This code is working only if i have display-nameAppHello1/display-name in web.xml. If there is no display-name in web.xml then above code in listner class is returning null. Is there facility to know application folder name in webapps folder in tomcat.
FW: get the Locale from Action[S2]
From browser settings request.getLocale() request.getAttribute(org.apache.struts.action.LOCALE) request.getSession().getAttribute(Globals.LOCALE_KEY) -Original Message- From: slideharmony [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2008 2:45 PM To: user@struts.apache.org Subject: get the Locale from Action[S2] Hello, anybody knows how can I get the client machine's Locale from my action struts 2? any help would be apprecciated. Riccardo -- View this message in context: http://www.nabble.com/get-the-Locale-from-Action-S2--tp15799905p15799905.htm l Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
encoding - web.xml,struts-config.xml
I am working on i18n application that needs to be worked in English and Polish language. This application is working on Tomcat Servers on windows system In India, But getting Question Marks Polish language in Poland Windows System. Is there anything that needs to be handled in web.xml and struts-config.xml with encoding attribute? ?xml version=1.0 encoding=ISO-8859-1? I don't find any difference when modified to ISO-8859-2 ?xml version=1.0 encoding= ISO-8859-2? Any advice or suggestion ?
Struts App - Tomcat on Windows in India and Poland
I have deployed a struts web application on Windows 2003 Server in Poland and India. Application needs to display Polish language coming from SAP. This is working in India on Windows 2003 Servers. But Messages are coming Question marks from Similar Configuration Server(language is polish) in Poland . Any advice on this?
Re: i18N jsp application on linux and windows
I need an help related to i18n (internationalization),… http://www.mail-archive.com/user@struts.apache.org/msg72581.html I am developing an application an struts application to be used in poland for English,polish language on tomcat. There is scenario to extract SAP messages and show to the user in browser in JSP page. I have written following method to read SAP message and Convert to IS0-559-2 charset( for Poland). This is working for me on XP and Windows 2000 in Hyderabad. I have used IS0-559-2 as encoding attribute in web.xml And in JSP pages %@ page contentType=text/html;charset=iso-8859-2 % But messages are corrupted some times and getting Question marks when deployed and tested application in Poland on Linux. Linux- Nr potwierdzenia 8018340248 nie zostaÅ‚ znaleziony (proszÄ™ sprawdzić wpis) Windows Nr potwierdzenia 22 nie zosta³ znaleziony (proszê sprawdziæ wpis) - private String convertTo_IS08559_2(HttpServletResponse response, String strMessage) throws UnsupportedEncodingException{ final String METHOD_NAME = convertTo_IS08559_2() : ; // holds method name for logger messages String charset = response.getCharacterEncoding(); String strFormatedMessage=null; // holds formatted message Log.info(CLASS_NAME + - +METHOD_NAME+ - response - +response); Log.info(CLASS_NAME + - +METHOD_NAME+ - charset - +charset); Log.info(CLASS_NAME + - +METHOD_NAME+ - strMessage - +strMessage); if(strMessage!=null strMessage.length()0){ try { strFormatedMessage = new String(strMessage.getBytes(charset), ISO-8859-2); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block //e.printStackTrace(); Log.error(CLASS_NAME + - +METHOD_NAME+ - UnsupportedEncodingException - +e); throw e; } } Log.info(CLASS_NAME + - +METHOD_NAME+ - str - +strFormatedMessage); return strFormatedMessage; }
RE: i18N jsp application on linux and windows
Hello Lauri, This is with reference.. http://www.mail-archive.com/user@struts.apache.org/msg72782.html Your reply on list is helping me a lot to dig into the problem.Please continue your help . response.getCharacterEncoding()is returning ISO-8859-1. I have set it to charset - ISO-8859-2 in JSP pages but it is returning “charset - ISO-8859-1”. Same thing is happening in windows and Linux. It is working in windows with this conversion(convertTo_IS08559_2) but failing in Linux.. Regards, Raghu _ From: Laurie Harper [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 19, 2008 4:24 AM To: [EMAIL PROTECTED] Subject: Re: i18N jsp application on linux and windows Uh, yeah, I got that; that's why I've replied to you twice, on the list; see also: http://www.mail-archive.com/user@struts.apache.org/msg72782.html Please follow up on-list if you need further help, to keep the discussion where everyone can see it. L. On 18-Feb-08, at 8:50 AM, Raghuveer wrote: I need an help related to i18n (internationalization),… http://www.mail-archive.com/user@struts.apache.org/msg72581.html http://www.mail-archive.com/user@struts.apache.org/msg72581.html I am developing an application an struts application to be used in poland for English,polish language on tomcat. There is scenario to extract SAP messages and show to the user in browser in JSP page. I have written following method to read SAP message and Convert to charsetThis is working for me on XP and Windows 2000 in Hyderabad. IS0-559-2And in JSP pages %@ page contentType=text/html;charset=iso-8859-2 % But messages are corrupted some times and getting Question marks when deployed and tested application in Poland on Linux. Linux- Nr potwierdzenia 8018340248 nie zostaÅ‚ znaleziony (proszÄ™ sprawdzić wpis) Windows Nr potwierdzenia 22 nie zosta³ znaleziony (proszê sprawdziæ wpis) - String convertTo_IS08559_2(HttpServletResponse response, StringstrMessage) throws UnsupportedEncodingException{ String charset = response.getCharacterEncoding(); Log.info(CLASS_NAME + - +METHOD_NAME+ - charset - +charset); try { } catch (UnsupportedEncodingException e) { //e.printStackTrace(); throw e; } return strFormatedMessage;
i18N jsp application on linux and windows
This is regarding the damage of polish messages from struts application deployed on Tomcat on Linux and Windows XP . I get polish messages from SAP that to be displayed in JSP page. I have set ISO8859_2 in JSP page for charset. %@ page contentType=text/html;charset=ISO8859_2 % I have set encoding attribute in web.xml as below ?xml version=1.0 encoding=ISO-8859-2? This is working on Windows XP. But I get Question marks and differents characters for polish messages from application deployed on Linux prosz? sprawdzi? Wpis. Please help if I need to do anything in framework..
Re: validation for s:select tag
Thanks Jeromy, Sorry, I did not provide enough detail. Only Header Key value is numeric '-1' so first option can be ruled out for me. For rest of the values Key is ISO Code e.g. USA and Value is Country Name e.g. 'United States' Below expression is not working for me. param name=expression![CDATA[user.country == '-1']]/param This condition is returning true whether I select a value in list box or not.. What can be other ways to check drop down values? Thanks On Feb 10, 2008 10:50 PM, Jeromy Evans [EMAIL PROTECTED] wrote: If your keys are just numbers, perhaps you could use the Int Validator field-validator type=int param name=min0/param message key=required.country/message /field-validator http://struts.apache.org/2.x/docs/int-validator.html Otherwise I'd try some variations of the expression. It's operating on the getUser().getCountry() property of your action so the expression (user.country == '-1') must be valid for its type. Raghuveer Rawat wrote: Hi, I need help for mandatory field validation for s:select. I am trying to do client side xml validation. jsp code for country list: s:select name=user.country headerKey=-1 headerValue=Select Country list=countryList listKey=code listValue=name required=true / I tried with below validation code but it is not working.. Not sure what will be other approach.. field name=user.country field-validator type=fieldexpression param name=expression![CDATA[user.country == '-1']]/param message key=required.country/message /field-validator /field Thanks a lot... No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.21/1267 - Release Date: 8/02/2008 8:12 PM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation for s:select tag
Hi, I need help for mandatory field validation for s:select. I am trying to do client side xml validation. jsp code for country list: s:select name=user.country headerKey=-1 headerValue=Select Country list=countryList listKey=code listValue=name required=true / I tried with below validation code but it is not working.. Not sure what will be other approach.. field name=user.country field-validator type=fieldexpression param name=expression![CDATA[user.country == '-1']]/param message key=required.country/message /field-validator /field Thanks a lot...
How to Default a value in dynamic list (s:select)
Hi, How to make a value as default value in a dynamic list s:select? Below code display a List of Countries sorted by Country Name so country name with letter a comes first but I want USA as default country. How to do that? s:select name=user.country headerKey=-1 headerValue=Select Country list=countryList listKey=code listValue=name required=true / Thanks...
struts polish application
I have an application that needs to show messages coming from SAP in polish language. What would be the changes in need to do for my web.xml,struts config.xml and jsp pages.. Certain polish fonts were corrupted and shown question marks.. Please advice
s:property for s:textarea value
Hi, I want to user to preview s:textarea value before sending to db. but when I am displaying s:textarea value using s:property it is not formatting it correctly and wrapping it. Is there anyone who faced this problem? Is this correct way to display Text Area value? s:textarea name=articleDesc cols=58 rows=10 / s:property value=article.articleDesc/ Thanks in advance..
Re: s:property for s:textarea value
Thanks Dave, i am sorry, I didn't explain it properly. Yes, you understood it correctly. I am submitting form and then displaying form values in new page. pre is working for me. Thanks once again. On Feb 5, 2008 10:08 PM, Dave Newton [EMAIL PROTECTED] wrote: --- Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, I want to user to preview s:textarea value before sending to db. but when I am displaying s:textarea value using s:property it is not formatting it correctly and wrapping it. s:textarea name=articleDesc cols=58 rows=10 / s:property value=article.articleDesc/ I'm not sure what you mean by the s:property.../ tag isn't formatting the value correctly etc. You won't be able to use s:property.../ to display a value before you've filled its property in the action. Above you're using two different properties, one in the s:textarea.../ and one in the s:property.../. Do you mean you want to submit the form, then show the information on a new page, and submit the information to the DB from the second page? If so, you need to understand that s:property.../ is just going to display the text as HTML. In other words if there are carriage returns, lots of spaces, tabs, etc. the browser will not display them in the same way an HTML textarea... would. If you want to preserve the formatting from a textarea... tag you'll need to wrap it in an HTML pre tag or something similar. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts2] Ajax anchor tag problem
Thanks Wong, yeah, I will try to implement your suggestion.. On Jan 22, 2008 12:07 AM, WongTseng [EMAIL PROTECTED] wrote: since the request is sent via ajax, so the browser side redirect can not work. i suggest you don't redirect you user directly, instead you send back a piece of js, let the js redirect the browser. script window.location='xxx'; /script 2008/1/21, Raghuveer Rawat [EMAIL PROTECTED]: Thanks Robi, I think you are right but how to come out of this ajax call if something goes wrong.sometimes I am getting some technical error and error page is also opening under target div. Is there anyone who faced this issue early? On Jan 21, 2008 3:29 PM, Roberto Nunnari [EMAIL PROTECTED] wrote: oopss.. sorry.. I read your post to fast and didn't notice you already tried redirect-action.. I believe the problem is that it's not the browser who is getting the redirect message from the server, but the ajax async call system, and so it puts the login form in the div, as it was instructed.. but as I'm not an ajax guru, I could be wrong. Best regards. -- Robi Roberto Nunnari wrote: try this: result name=login type=redirect-actionlogin/result Best regards. -- Robi Raghuveer Rawat wrote: Hi, I have a requirement where only logged in users are allowed to put their comment. I have implemented that form with struts2 ajax theme...anchor has theme=ajax If logged in user puts his comment then everything works fine perfectly..I am able to see text message returned from action in target div But when a user who is not logged in and try to put this comment..I want to redirect user to login page..*but there what is happening here is that login page is also streaming back and it is opening in target div..* Any idea how to redirect user to login page.. Below is my action class method.. public String addComment() { try{ UserTO userTo = null; Object user = this.getSession().get(user); if(user == null){ return Action.LOGIN; }else{ userTo = (UserTO) user; } this.getCommentTo().setUserId(userTo.getUserId()); this.getCommentTo().setArticleId(this.getArticleId()); this.getCommentService().addComment(this.getCommentTo ()); HttpServletResponse response = ServletActionContext.getResponse (); //inputStream = new StringBufferInputStream(Comment Posted Successfully.); String successMsg = Thanks for posting comment. Your comment has been added successfully.; byte[] contents = successMsg.getBytes(); response.getOutputStream().write(contents); }catch(Exception ex){ LOG.error(Exception in myArticles():+ ex); return Action.ERROR; } return null; } This is my comment form... div id='commentResponse' /div s:form action=comments_addComment method=post table width=583 border=0 cellspacing=2 cellpadding=2 tr td width=99 align=leftstrongYour Comments/strong /td td width=470 align=left s:textarea name=commentTo.comments rows=5 cols=40/s:textarea s:hidden name=articleId value=${ article.articleId }//td /tr tr td align=leftnbsp;/td td width=470 align=left s:a theme=ajax targets=commentResponseAdd Comment/s:a /td /tr /table /s:form Below is struts.xml entry..I am using tiles and default results are tile definitionsI also tried using redirect-action and redirect but that also give same problem.. action name=comments_* method={1} class= com.rawatsoft.write4smile.webapp.action.CommentAction result name=loginlogin/result /action - 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] -- Best Regards Wong Tseng - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
[Struts2] Ajax anchor tag problem
Hi, I have a requirement where only logged in users are allowed to put their comment. I have implemented that form with struts2 ajax theme...anchor has theme=ajax If logged in user puts his comment then everything works fine perfectly..I am able to see text message returned from action in target div But when a user who is not logged in and try to put this comment..I want to redirect user to login page..*but there what is happening here is that login page is also streaming back and it is opening in target div..* Any idea how to redirect user to login page.. Below is my action class method.. public String addComment() { try{ UserTO userTo = null; Object user = this.getSession().get(user); if(user == null){ return Action.LOGIN; }else{ userTo = (UserTO) user; } this.getCommentTo().setUserId(userTo.getUserId()); this.getCommentTo().setArticleId(this.getArticleId()); this.getCommentService().addComment(this.getCommentTo()); HttpServletResponse response = ServletActionContext.getResponse (); //inputStream = new StringBufferInputStream(Comment Posted Successfully.); String successMsg = Thanks for posting comment. Your comment has been added successfully.; byte[] contents = successMsg.getBytes(); response.getOutputStream().write(contents); }catch(Exception ex){ LOG.error(Exception in myArticles():+ ex); return Action.ERROR; } return null; } This is my comment form... div id='commentResponse' /div s:form action=comments_addComment method=post table width=583 border=0 cellspacing=2 cellpadding=2 tr td width=99 align=leftstrongYour Comments/strong /td td width=470 align=left s:textarea name=commentTo.comments rows=5 cols=40/s:textarea s:hidden name=articleId value=${article.articleId }//td /tr tr td align=leftnbsp;/td td width=470 align=left s:a theme=ajax targets=commentResponseAdd Comment/s:a /td /tr /table /s:form Below is struts.xml entry..I am using tiles and default results are tile definitionsI also tried using redirect-action and redirect but that also give same problem.. action name=comments_* method={1} class= com.rawatsoft.write4smile.webapp.action.CommentAction result name=loginlogin/result /action
Re: [Struts2] Ajax anchor tag problem
Thanks Robi, I think you are right but how to come out of this ajax call if something goes wrong.sometimes I am getting some technical error and error page is also opening under target div. Is there anyone who faced this issue early? On Jan 21, 2008 3:29 PM, Roberto Nunnari [EMAIL PROTECTED] wrote: oopss.. sorry.. I read your post to fast and didn't notice you already tried redirect-action.. I believe the problem is that it's not the browser who is getting the redirect message from the server, but the ajax async call system, and so it puts the login form in the div, as it was instructed.. but as I'm not an ajax guru, I could be wrong. Best regards. -- Robi Roberto Nunnari wrote: try this: result name=login type=redirect-actionlogin/result Best regards. -- Robi Raghuveer Rawat wrote: Hi, I have a requirement where only logged in users are allowed to put their comment. I have implemented that form with struts2 ajax theme...anchor has theme=ajax If logged in user puts his comment then everything works fine perfectly..I am able to see text message returned from action in target div But when a user who is not logged in and try to put this comment..I want to redirect user to login page..*but there what is happening here is that login page is also streaming back and it is opening in target div..* Any idea how to redirect user to login page.. Below is my action class method.. public String addComment() { try{ UserTO userTo = null; Object user = this.getSession().get(user); if(user == null){ return Action.LOGIN; }else{ userTo = (UserTO) user; } this.getCommentTo().setUserId(userTo.getUserId()); this.getCommentTo().setArticleId(this.getArticleId()); this.getCommentService().addComment(this.getCommentTo()); HttpServletResponse response = ServletActionContext.getResponse (); //inputStream = new StringBufferInputStream(Comment Posted Successfully.); String successMsg = Thanks for posting comment. Your comment has been added successfully.; byte[] contents = successMsg.getBytes(); response.getOutputStream().write(contents); }catch(Exception ex){ LOG.error(Exception in myArticles():+ ex); return Action.ERROR; } return null; } This is my comment form... div id='commentResponse' /div s:form action=comments_addComment method=post table width=583 border=0 cellspacing=2 cellpadding=2 tr td width=99 align=leftstrongYour Comments/strong /td td width=470 align=left s:textarea name=commentTo.comments rows=5 cols=40/s:textarea s:hidden name=articleId value=${ article.articleId }//td /tr tr td align=leftnbsp;/td td width=470 align=left s:a theme=ajax targets=commentResponseAdd Comment/s:a /td /tr /table /s:form Below is struts.xml entry..I am using tiles and default results are tile definitionsI also tried using redirect-action and redirect but that also give same problem.. action name=comments_* method={1} class= com.rawatsoft.write4smile.webapp.action.CommentAction result name=loginlogin/result /action - 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]
RE: setting locale manually
Hello, Since I have only to languages ,I have provided a button in screen and passing url parameter english and polish. In Action file taking this language and forming locale object and setting to ACTION method setLocale Wprowadź - Enter Above polish word is not coming exactly as label in JSP page when page is rendered. Could any one suggest any solution to resolve the i18N for messages. -- if(strLanguage!=null strLanguage.equalsIgnoreCase(english)){ strLanguage=en; strCountry=US; }else if(strLanguage!=null strLanguage.equalsIgnoreCase(polish)){ strLanguage=pl; strCountry=PL; }else{ strLanguage=pl; strCountry=PL; } Locale locale=new Locale(strLanguage,strCountry); setLocale(request,locale); -Original Message- From: Raghuveer [mailto:[EMAIL PROTECTED] Sent: Friday, January 04, 2008 8:21 PM To: 'Martin Gainty' Cc: user@struts.apache.org Subject: RE: setting locale manually So you mean if I addrequest_locale=en_US in all forward this will work OR if I add in first forward it is sufficient? _ From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Friday, January 04, 2008 8:10 PM To: [EMAIL PROTECTED] Subject: RE: setting locale manually Czes Raghu http://struts.apache.org/2.0.11/docs/i18n-interceptor.html you can pass the locale on the request and path accordingly dziekuje! Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: setting locale manually Date: Fri, 4 Jan 2008 18:30:39 +0530 How to set locale for my struts application. My application will have 2 languages. There will be 2 buttons in jsp page. One button is polish and other is English. on clicking of Polish button all the labels and button names and messages are to be changed into polis language. Any suggestions of implementing this _ Watch Cause Effect, a show about real people making a real difference. Learn http://im.live.com/Messenger/IM/MTV/?source=text_watchcause more - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Message resources - Application Resource - Polish
Hello, Since I have only to languages ,I have provided a button in screen and passing url parameter english and polish. In Action file taking this language and forming locale object and setting to ACTION method setLocale Wprowadź - Enter Above polish word is not coming exactly as label in JSP page when page is rendered. Actual polish word is modified - Could any one suggest any solution to resolve the i18N for messages. -- if(strLanguage!=null strLanguage.equalsIgnoreCase(english)){ strLanguage=en; strCountry=US; }else if(strLanguage!=null strLanguage.equalsIgnoreCase(polish)){ strLanguage=pl; strCountry=PL; }else{ strLanguage=pl; strCountry=PL; }
Commons logging in struts
Could any one provide information of using commons logging for logging my application related logs in my JSP-STRUTS application
RE: Commons logging in struts
Hi, I understand for struts project there needs be commons-logging.jar needs to be placed in web-inf\lib folder. Incase if I want to use Log4j for logging logs related to my own application only ,is it required to configure log4j again and place 1og4j.jar in web-inf\lib. At present i have written some plugin class to initialize log4j separately for my struts application.. Please let me know Instead of configuring log4j for my java files ..is it not possible to use commons logging? -Original Message- From: Chris Pratt [mailto:[EMAIL PROTECTED] Sent: Thursday, January 10, 2008 10:39 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Commons logging in struts On Jan 10, 2008 1:25 AM, Raghuveer [EMAIL PROTECTED] wrote: Could any one provide information of using commons logging for logging my application related logs in my JSP-STRUTS application Commons logging is just a logging facade, it is not a logging system itself. It is used by libraries and frameworks so that the authors can write logs that will eventually get logged to whatever logging system the end user decides to embrace. With that in mind, what you probably really need to decide is which logging system you want to use. The two most popular are definitely, the one built into Java (java.util.logging.*) and Log4j (http://logging.apache.org). One other thing you might want to look into is a more advanced facade SLF4j (http://www.slf4j.org). (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ApplicationResources polish
On saving the polish word quantity in polish language in Application resource files ApplicationResources_pl is changed. Actual word is changed on saving the property file. Special characters were lost on saving the file. Modified Word - Ilosc Actual Word - Ilość Is there any suggestion to avoid modifying of the word on saving the file in file system? What would be cause the polish language property file modified ?
RE: ApplicationResources polish
Hi Hoang Thang, What is this “native2ascii.exe”. Does there will be some other exe file for polish ? Where do we get this ? My application should work in english and polish(Poland). _ From: Th?ng Hoàng [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 08, 2008 3:00 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: ApplicationResources polish Hello Raghuveer, Ilość is in unicode format. the ApplicationResources_pl file is not save with unicode format file, so when you save it will lost the right code. we use native2ascii.exe (in C:\Program Files\Java\jdk1.6.0_02\bin folder) to convert an unicode file to native file and use this file with struts (for japanese character) best regards Hoang Thang 2008/1/8, Raghuveer [EMAIL PROTECTED]: On saving the polish word quantity in polish language in Application resource files ApplicationResources_pl is changed. Actual word is changed on saving the property file. Special characters were lost on saving the file. Modified Word - Ilosc Actual Word - Ilość Is there any suggestion to avoid modifying of the word on saving the file in file system? What would be cause the polish language property file modified ?
Re: TabbedPanel question
Pablo, You can refer to Martin's reply in this mail thread. See if that helps you.. On Jan 8, 2008 11:58 AM, Pablo Vázquez Blázquez [EMAIL PROTECTED] wrote: Yes, I had already seen this link and I am able to customize my CSS, but what I want is to paint *each* tab in a *different* color. So far, I only could paint all tabs with the same color (a different one from the original tabbedpanel). Thanks. Raghuveer Rawat escribió: You need to customize CSS for tabbbed panel... Have a look on below link.. http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/templates/TabContainer.css?view=markup There is tabbed panel attribute for loading this css Template...I don't remember exact name. Apache site is giving error on page tabbed panel so not able to see there as well You can go through various discussion on tabbed panel CSS customization in mail archive...That will help you.. Thanks Raghu On Dec 31, 2007 2:54 AM, Pablo Vázquez Blázquez [EMAIL PROTECTED] wrote: Does somebody know if it is possible? I have a tabbedpanel and I would like to paint a tab in a different color if there is any validation error inside it. Thanks. Pablo Vázquez Blázquez escribió: Is it possible to paint each tab in the tabbedpanel in a diferent color? I´m using Struts 2.0.9 Thanks. - 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] - 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]
Load a particular resource bundle
How to set locale for my struts application. My application will have 2 languages. There will be 2 buttons in jsp page. One button is polish and other is English. on clicking of Polish button all the labels and button names and messages are to be changed into polis language. Any suggestions of implementing this
RE: setting locale manually
So you mean if I addrequest_locale=en_US in all forward this will work OR if I add in first forward it is sufficient? _ From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Friday, January 04, 2008 8:10 PM To: [EMAIL PROTECTED] Subject: RE: setting locale manually Czes Raghu http://struts.apache.org/2.0.11/docs/i18n-interceptor.html you can pass the locale on the request and path accordingly dziekuje! Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: setting locale manually Date: Fri, 4 Jan 2008 18:30:39 +0530 How to set locale for my struts application. My application will have 2 languages. There will be 2 buttons in jsp page. One button is polish and other is English. on clicking of Polish button all the labels and button names and messages are to be changed into polis language. Any suggestions of implementing this _ Watch Cause Effect, a show about real people making a real difference. Learn http://im.live.com/Messenger/IM/MTV/?source=text_watchcause more
setting locale manually
How to set locale for my struts application. My application will have 2 languages. There will be 2 buttons in jsp page. One button is polish and other is English. on clicking of Polish button all the labels and button names and messages are to be changed into polis language. Any suggestions of implementing this
Re: TabbedPanel question
You need to customize CSS for tabbbed panel... Have a look on below link.. http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/org/apache/struts2/static/dojo/src/widget/templates/TabContainer.css?view=markup There is tabbed panel attribute for loading this css Template...I don't remember exact name. Apache site is giving error on page tabbed panel so not able to see there as well You can go through various discussion on tabbed panel CSS customization in mail archive...That will help you.. Thanks Raghu On Dec 31, 2007 2:54 AM, Pablo Vázquez Blázquez [EMAIL PROTECTED] wrote: Does somebody know if it is possible? I have a tabbedpanel and I would like to paint a tab in a different color if there is any validation error inside it. Thanks. Pablo Vázquez Blázquez escribió: Is it possible to paint each tab in the tabbedpanel in a diferent color? I´m using Struts 2.0.9 Thanks. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Display tag and target div
Hi, Wish everyone a very happy and prosperous New Year 2008. I am struggling with this problem from last 3-4 days...displaytag output is opening in new windowdon't know if anyone tried loading jsp containing displaytag through s:div Even if you have some thoughts, I can try implementing that... Thanks for help... On Dec 29, 2007 7:01 PM, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, Looks like this issue can be resolve with s:div tags listenTopics like below.. s:div href=%{recMessages} theme=ajax label=Received Messages id=1 listenTopics=/recMessagesNext /s:div But how should I publish this topic for my DisplayTag Table... Any thought..If someone has resolve this issue then please let me know..how? Thanks Raghu On 12/27/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hello quinquin2209, Is this issue resolved for you? What was the solution? I am facing same issue as you have raised. I can see display table being populated correctly on page load but when I click on any sortable column or click on next page, its result is getting opened in new window. How to keep it under tabbel panel? I tried everything that is suggested by Jeromy but no success MyMessages.jsp (This page includes tabbed Panel) s:url id=recMessages includeParams=get value=/myMessages_received.action / s:tabbedPanel id=myMessages theme=simple selectedTab=1 cssStyle=width:550px; height:400px; font-size: 12px; doLayout=true s:div href=%{recMessages} refreshOnShow=true theme=ajax label=Received Messages id=1 /s:div s:div href=%{sentMessages} theme=ajax label=Sent Messages id=2 /s:div s:div href=%{composeMessages} theme=ajax label=Compose Message id=3 /s:div s:div href=%{savedMessages} theme=ajax label=Saved Messages id=4 /s:div /s:tabbedPanel Received Messages.jsp: (This page contain displaytag table that has to be populated under remote div under tabbbed panel.. display:table id=myMessagesId name=myMessagesToLst requestURI=/myMessages_received.action defaultsort=2 defaultorder=descending pagesize=3 class=table display:column property=userName sortable=true titleKey=message.From style=width:20%; class=text/ display:column property=messageDate format={0,date,dd-MMM-} sortable=true titleKey=message.Date style=width:20%; class=text / display:column property=subject sortable=true titleKey= message.Subject url=/readMessage_read.action paramId=messageId paramProperty=messageId style=width:40%; text-decoration:none; class=text/ /display:table On 12/11/07, Jeromy Evans [EMAIL PROTECTED] wrote: quinquin2209 wrote: Thanks for reply. But I encounter this problem: In my main.jsp is the tab panel as follow: s:url id=messageList value=/member/list.action / s:tabbedPanel id=test2 theme=simple s:div id=1 label=ALL theme=ajax href=%{messageList} loadingText=Loading... refreshOnShow=true / /s:tabbedPanel And in my memberList.jsp, the display tag is defined as follow: display:table name=messages pagesize=18 requestURI= display:column property=Id title=ID sortable=true headerClass=sortable / display:column property=Type title=version / display:column property=issueDate title=Date sortable=true headerClass=sortable/ /display:table when I click on the sort hyperlink, it direct me to http://localhost:8080/app/folder/?dojo.preventCache=1197368118484d-49653-s=3d-49653-o=2 where the page is not found. And also the whole page refresh instead of the div in tab pannel. I presume you mean want the only table to refresh when the user clicks on a column header, not the entire tab and not the entire page. I have two suggestions at this point: 1. Try setting the requestURI to the URL of your action. Clearly when it does a sort it's going to the wrong URL and we just have to force it to go to the right place. Without the attribute it uses the JSP name, with blank it's literally using blank (which normally works), so now try the URL you would expect: display:table name=messages pagesize=18 requestURI=/member/list.action 2. modify s:url to state that only get parameters are included. s:url id=messageList includeParams=get value=/member/list.action / I don't see why it would make a difference in this case, but for more information see http://www.nabble.com/OT-3A-displaytag-remember-sort-config-..-to13347200.html The objective is to remove things that may interfere with display tags build-in sort functionality. Hope that helps. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: problem in tab layout
Probably a bug in tabbed panel... you can go though previous messages on tabbed panel... Some replied that this bug will be fixed in struts 2.1 What version are you using? On Dec 31, 2007 8:56 AM, Vidhyakar Kadarkarai [EMAIL PROTECTED] wrote: hi, i have a problem while using tabs. There two tabs in my application. when i submit the form in the first tab, will get the result page in the second tab. In the second tab, there is a link which will open another page in the same tab. After that, when i go to the first tab, i can see the content of the second tab appended with the content in the first tab. Any one faced such a problem before ? Waiting for the solution for this problem. Regards, Vidhyakar K __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in tab layout
I was talking about below issue...do you have this same issue? http://www.nabble.com/-S2.0.11--TabbedPanel-remote-div-loads-twice-on-notifyTopic-td13733215.html#a13733215 There was one more issue which seems to be resolved in 2.0.9 http://www.nabble.com/Default-tab-in-tabbedPanel-loaded-twice-td12223500.html#a12223500 Thanks Raghu On Dec 31, 2007 9:01 AM, Raghuveer Rawat [EMAIL PROTECTED] wrote: Probably a bug in tabbed panel... you can go though previous messages on tabbed panel... Some replied that this bug will be fixed in struts 2.1 What version are you using? On Dec 31, 2007 8:56 AM, Vidhyakar Kadarkarai [EMAIL PROTECTED] wrote: hi, i have a problem while using tabs. There two tabs in my application. when i submit the form in the first tab, will get the result page in the second tab. In the second tab, there is a link which will open another page in the same tab. After that, when i go to the first tab, i can see the content of the second tab appended with the content in the first tab. Any one faced such a problem before ? Waiting for the solution for this problem. Regards, Vidhyakar K __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in tab layout
Can you copy your sample code here? That will make things more clear... On Dec 31, 2007 9:36 AM, Vidhyakar Kadarkarai [EMAIL PROTECTED] wrote: the normal loading of two of the tabs are working fine. The problem that i face is only when a link is clicked on the second tab and after that if i click first tab, i can see the other page content in the first tab. Thanks and Regards, Vidhyakar K, Extn:- 7191 Off:- 91-44-22537191 Mob: - 9841647527 This document is classified as : ( ) LT Infotech Proprietary Confidential ( ) LT Infotech Confidential (x) LT Infotech Internal Use only ( ) LT Infotech General Business Information Larsen Toubro Infotech Ltd. www.Lntinfotech.com This Document is classified as: LT Infotech Proprietary LT Infotech Confidential LT Infotech Internal Use Only LT Infotech General Business This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system. Raghuveer Rawat [EMAIL PROTECTED] 12/31/2007 07:45 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: problem in tab layout I was talking about below issue...do you have this same issue? http://www.nabble.com/-S2.0.11--TabbedPanel-remote-div-loads-twice-on-notifyTopic-td13733215.html#a13733215 There was one more issue which seems to be resolved in 2.0.9 http://www.nabble.com/Default-tab-in-tabbedPanel-loaded-twice-td12223500.html#a12223500 Thanks Raghu On Dec 31, 2007 9:01 AM, Raghuveer Rawat [EMAIL PROTECTED] wrote: Probably a bug in tabbed panel... you can go though previous messages on tabbed panel... Some replied that this bug will be fixed in struts 2.1 What version are you using? On Dec 31, 2007 8:56 AM, Vidhyakar Kadarkarai [EMAIL PROTECTED] wrote: hi, i have a problem while using tabs. There two tabs in my application. when i submit the form in the first tab, will get the result page in the second tab. In the second tab, there is a link which will open another page in the same tab. After that, when i go to the first tab, i can see the content of the second tab appended with the content in the first tab. Any one faced such a problem before ? Waiting for the solution for this problem. Regards, Vidhyakar K __ - 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]
Internationalization - identification of client request by request header - accept-language ??
How the struts framework does identifies the client language and there by uses the Message Resources for Internationalization.. request.getHeader(accept-language) is giving the string as below accept-language-pl,en-us;q=0.7,de;q=0.3 I need to identify if my request is from polish /English language directly. is there facility inside the framework ? CODE Enumeration e=request.getHeaderNames(); while(e.hasMoreElements()){ strTemp=(String)e.nextElement(); System.out.println(strTemp + -+request.getHeader(strTemp) ); }
Re: Display tag and target div
Hi, Looks like this issue can be resolve with s:div tags listenTopics like below.. s:div href=%{recMessages} theme=ajax label=Received Messages id=1 listenTopics=/recMessagesNext /s:div But how should I publish this topic for my DisplayTag Table... Any thought..If someone has resolve this issue then please let me know..how? Thanks Raghu On 12/27/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hello quinquin2209, Is this issue resolved for you? What was the solution? I am facing same issue as you have raised. I can see display table being populated correctly on page load but when I click on any sortable column or click on next page, its result is getting opened in new window. How to keep it under tabbel panel? I tried everything that is suggested by Jeromy but no success MyMessages.jsp (This page includes tabbed Panel) s:url id=recMessages includeParams=get value=/myMessages_received.action / s:tabbedPanel id=myMessages theme=simple selectedTab=1 cssStyle=width:550px; height:400px; font-size: 12px; doLayout=true s:div href=%{recMessages} refreshOnShow=true theme=ajax label=Received Messages id=1 /s:div s:div href=%{sentMessages} theme=ajax label=Sent Messages id=2 /s:div s:div href=%{composeMessages} theme=ajax label=Compose Message id=3 /s:div s:div href=%{savedMessages} theme=ajax label=Saved Messages id=4 /s:div /s:tabbedPanel Received Messages.jsp: (This page contain displaytag table that has to be populated under remote div under tabbbed panel.. display:table id=myMessagesId name=myMessagesToLst requestURI=/myMessages_received.action defaultsort=2 defaultorder=descending pagesize=3 class=table display:column property=userName sortable=true titleKey=message.From style=width:20%; class=text/ display:column property=messageDate format={0,date,dd-MMM-} sortable=true titleKey=message.Date style=width:20%; class=text / display:column property=subject sortable=true titleKey= message.Subject url=/readMessage_read.action paramId=messageId paramProperty=messageId style=width:40%; text-decoration:none; class=text/ /display:table On 12/11/07, Jeromy Evans [EMAIL PROTECTED] wrote: quinquin2209 wrote: Thanks for reply. But I encounter this problem: In my main.jsp is the tab panel as follow: s:url id=messageList value=/member/list.action / s:tabbedPanel id=test2 theme=simple s:div id=1 label=ALL theme=ajax href=%{messageList} loadingText=Loading... refreshOnShow=true / /s:tabbedPanel And in my memberList.jsp, the display tag is defined as follow: display:table name=messages pagesize=18 requestURI= display:column property=Id title=ID sortable=true headerClass=sortable / display:column property=Type title=version / display:column property=issueDate title=Date sortable=true headerClass=sortable/ /display:table when I click on the sort hyperlink, it direct me to http://localhost:8080/app/folder/?dojo.preventCache=1197368118484d-49653-s=3d-49653-o=2 where the page is not found. And also the whole page refresh instead of the div in tab pannel. I presume you mean want the only table to refresh when the user clicks on a column header, not the entire tab and not the entire page. I have two suggestions at this point: 1. Try setting the requestURI to the URL of your action. Clearly when it does a sort it's going to the wrong URL and we just have to force it to go to the right place. Without the attribute it uses the JSP name, with blank it's literally using blank (which normally works), so now try the URL you would expect: display:table name=messages pagesize=18 requestURI=/member/list.action 2. modify s:url to state that only get parameters are included. s:url id=messageList includeParams=get value=/member/list.action / I don't see why it would make a difference in this case, but for more information see http://www.nabble.com/OT-3A-displaytag-remember-sort-config-..-to13347200.html The objective is to remove things that may interfere with display tags build-in sort functionality. Hope that helps. - 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]
Re: Display tag and target div
Looks like this is open issue... found something interesting in webwork forum http://forums.opensymphony.com/thread.jspa?messageID=116863#116863 On 12/27/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hello quinquin2209, Is this issue resolved for you? What was the solution? I am facing same issue as you have raised. I can see display table being populated correctly on page load but when I click on any sortable column or click on next page, its result is getting opened in new window. How to keep it under tabbel panel? I tried everything that is suggested by Jeromy but no success MyMessages.jsp (This page includes tabbed Panel) s:url id=recMessages includeParams=get value=/myMessages_received.action / s:tabbedPanel id=myMessages theme=simple selectedTab=1 cssStyle=width:550px; height:400px; font-size: 12px; doLayout=true s:div href=%{recMessages} refreshOnShow=true theme=ajax label=Received Messages id=1 /s:div s:div href=%{sentMessages} theme=ajax label=Sent Messages id=2 /s:div s:div href=%{composeMessages} theme=ajax label=Compose Message id=3 /s:div s:div href=%{savedMessages} theme=ajax label=Saved Messages id=4 /s:div /s:tabbedPanel Received Messages.jsp: (This page contain displaytag table that has to be populated under remote div under tabbbed panel.. display:table id=myMessagesId name=myMessagesToLst requestURI=/myMessages_received.action defaultsort=2 defaultorder=descending pagesize=3 class=table display:column property=userName sortable=true titleKey=message.From style=width:20%; class=text/ display:column property=messageDate format={0,date,dd-MMM-} sortable=true titleKey=message.Date style=width:20%; class=text / display:column property=subject sortable=true titleKey= message.Subject url=/readMessage_read.action paramId=messageId paramProperty=messageId style=width:40%; text-decoration:none; class=text/ /display:table On 12/11/07, Jeromy Evans [EMAIL PROTECTED] wrote: quinquin2209 wrote: Thanks for reply. But I encounter this problem: In my main.jsp is the tab panel as follow: s:url id=messageList value=/member/list.action / s:tabbedPanel id=test2 theme=simple s:div id=1 label=ALL theme=ajax href=%{messageList} loadingText=Loading... refreshOnShow=true / /s:tabbedPanel And in my memberList.jsp, the display tag is defined as follow: display:table name=messages pagesize=18 requestURI= display:column property=Id title=ID sortable=true headerClass=sortable / display:column property=Type title=version / display:column property=issueDate title=Date sortable=true headerClass=sortable/ /display:table when I click on the sort hyperlink, it direct me to http://localhost:8080/app/folder/?dojo.preventCache=1197368118484d-49653-s=3d-49653-o=2 where the page is not found. And also the whole page refresh instead of the div in tab pannel. I presume you mean want the only table to refresh when the user clicks on a column header, not the entire tab and not the entire page. I have two suggestions at this point: 1. Try setting the requestURI to the URL of your action. Clearly when it does a sort it's going to the wrong URL and we just have to force it to go to the right place. Without the attribute it uses the JSP name, with blank it's literally using blank (which normally works), so now try the URL you would expect: display:table name=messages pagesize=18 requestURI=/member/list.action 2. modify s:url to state that only get parameters are included. s:url id=messageList includeParams=get value=/member/list.action / I don't see why it would make a difference in this case, but for more information see http://www.nabble.com/OT-3A-displaytag-remember-sort-config-..-to13347200.html The objective is to remove things that may interfere with display tags build-in sort functionality. Hope that helps. - 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]
Re: Display tag and target div
Hello quinquin2209, Is this issue resolved for you? What was the solution? I am facing same issue as you have raised. I can see display table being populated correctly on page load but when I click on any sortable column or click on next page, its result is getting opened in new window. How to keep it under tabbel panel? I tried everything that is suggested by Jeromy but no success MyMessages.jsp (This page includes tabbed Panel) s:url id=recMessages includeParams=get value=/myMessages_received.action / s:tabbedPanel id=myMessages theme=simple selectedTab=1 cssStyle=width:550px; height:400px; font-size: 12px; doLayout=true s:div href=%{recMessages} refreshOnShow=true theme=ajax label=Received Messages id=1 /s:div s:div href=%{sentMessages} theme=ajax label=Sent Messages id=2 /s:div s:div href=%{composeMessages} theme=ajax label=Compose Message id=3 /s:div s:div href=%{savedMessages} theme=ajax label=Saved Messages id=4 /s:div /s:tabbedPanel Received Messages.jsp: (This page contain displaytag table that has to be populated under remote div under tabbbed panel.. display:table id=myMessagesId name=myMessagesToLst requestURI=/myMessages_received.action defaultsort=2 defaultorder=descending pagesize=3 class=table display:column property=userName sortable=true titleKey=message.From style=width:20%; class=text/ display:column property=messageDate format={0,date,dd-MMM-} sortable=true titleKey=message.Date style=width:20%; class=text / display:column property=subject sortable=true titleKey= message.Subject url=/readMessage_read.action paramId=messageId paramProperty=messageId style=width:40%; text-decoration:none; class=text/ /display:table On 12/11/07, Jeromy Evans [EMAIL PROTECTED] wrote: quinquin2209 wrote: Thanks for reply. But I encounter this problem: In my main.jsp is the tab panel as follow: s:url id=messageList value=/member/list.action / s:tabbedPanel id=test2 theme=simple s:div id=1 label=ALL theme=ajax href=%{messageList} loadingText=Loading... refreshOnShow=true / /s:tabbedPanel And in my memberList.jsp, the display tag is defined as follow: display:table name=messages pagesize=18 requestURI= display:column property=Id title=ID sortable=true headerClass=sortable / display:column property=Type title=version / display:column property=issueDate title=Date sortable=true headerClass=sortable/ /display:table when I click on the sort hyperlink, it direct me to http://localhost:8080/app/folder/?dojo.preventCache=1197368118484d-49653-s=3d-49653-o=2 where the page is not found. And also the whole page refresh instead of the div in tab pannel. I presume you mean want the only table to refresh when the user clicks on a column header, not the entire tab and not the entire page. I have two suggestions at this point: 1. Try setting the requestURI to the URL of your action. Clearly when it does a sort it's going to the wrong URL and we just have to force it to go to the right place. Without the attribute it uses the JSP name, with blank it's literally using blank (which normally works), so now try the URL you would expect: display:table name=messages pagesize=18 requestURI=/member/list.action 2. modify s:url to state that only get parameters are included. s:url id=messageList includeParams=get value=/member/list.action / I don't see why it would make a difference in this case, but for more information see http://www.nabble.com/OT-3A-displaytag-remember-sort-config-..-to13347200.html The objective is to remove things that may interfere with display tags build-in sort functionality. Hope that helps. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using Log4j in struts for application logs
Hello, Question 1 I have placed log4j.properties in WEB-INF of my struts application. With this application logs test.log is created in the directory. I found in all the logs were created for java files in package com.testapp.test to test.log In addition to this there is one more log file created called struts. log What I need to do to avoid the automatic creation of struts.log..i mean I want only application related log file created... poc\WEB-INF\src\log4j.properties log4j.logger.com.testapp.test=debug, test log4j.appender.test=org.apache.log4j.RollingFileAppender log4j.appender.test.File=logsserver\\APP_LOGS\\test\\test.log log4j.appender.test.MaxFileSize=5000KB log4j.appender.test.MaxBackupIndex=10 log4j.appender.test.layout=org.apache.log4j.PatternLayout #log4j.appender.test.layout.ConversionPattern=%d~%p~%c~ %m%n
Application logs
Is there way in struts to use logging configuration by declaratively.? What is the role of commons logging.. How to use this directly in code ..in java files and jsp files?
i18n - button names
Is it possible to get the Localized button names for Struts Internationalization (i18n)..?
Setting Session time out
Is there possibility of setting session time out of application for 15 minutes? If session of login user expires or left unused for 15 minutes application should fire session expire page automatically. Any idea of how to handle this in my struts application?
Re: [Struts2] problem with s:select tag
Thanks Dave, This issue has been resolved using Preparable/prepare() On Dec 15, 2007 8:18 PM, Dave Newton [EMAIL PROTECTED] wrote: You don't say how you initially populate the select box. In any case, unless you're populating it via Preparable/prepare() or some other automatic way or if it's not in application or session scope it won't get automatically re-populated when you re-visit the page. d. --- Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, I have a getting problem in using s:select tag. Need some help if anyone used s:select before. This dropdown is populated dynamically. When form is loaded initially dropdown is getting populated perfectly. No issue here. But when we submit the form and some of the validations fail then page is not getting displayed correctly. This is because dropdown values are not coming back after the form submit. Not sure what need to be done to bring back this dropdown values. I can see below error in the log. Servlet.service() for servlet jsp threw exception tag 'select', field 'list', name 'user.country': The requested list key 'countryList' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] Here is my jsp code for this issue: s:select name=user.country headerKey=-1 headerValue=Select Country cssClass=textbox1 list=countryList listKey=code listValue=name required=true / Pl. let me know if you need some more information. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2, file tag, accept attribute not working?
I am facing same problem and was about to post this question. How to validate file content type in struts2? Thanks in Advance.. Raghu On Dec 12, 2007 5:48 AM, Amit Rana [EMAIL PROTECTED] wrote: Hi Anton, Were you able to finally get it to work? I am using 2.0.9 and accept just doens't seem to be doing anything. Regards, Amit. Re: Struts 2, file tag, accept attribute not working? Anton Pussep Sat, 03 Nov 2007 10:09:23 -0800 Modifying FileUploadInterceptor or settings its parameters in struts.xml is not a proper solution since I have two s:file fields in my form and both require different content types. I am not looking for a work around, I rather have the question: Is the accept attribute working at all and if it does, why isn't it working for me? Best, Anton - Original Message - From: Anton Pussep [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, November 02, 2007 6:03 AM Subject: Struts 2, file tag, accept attribute not working? Hello, I am using the following tag for uploading text files: s:file name=myDoc accept=text/plain / I expected it to recognise wrong content types, but it accepts any files I upload. What might be the problem here? I tried this with Struts 2.0.9 and 2.0.11. Best, Anton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Help for Ajax Tabbed Panel
Still not able to make it working. I had s:url inside the tabbed panel which I have moved out but still output of MyArticlesDetail.jsp is not coming back into tab of the MyArticle.jsp Not sure what is causing this issue. Any help if someone is able to make tabbelpanel working. Tabbed Panel code look like below.. other details i have already given.. s:url var=storyAction value=article/myArticles_articlesByAuthorId.action?channelId=1/ s:url var=poemAction value=article/myArticles_articlesByAuthorId.action?channelId=2 / s:url var=jokesAction value=article/myArticles_articlesByAuthorId.action?channelId=3 / s:url var=shayariAction value=article/myArticles_articlesByAuthorId.action?channelId=4 / s:tabbedPanel id=test theme=simple cssStyle=height: 300px; doLayout=true selectedTab=one closeButton=tab s:div id=one label=Stories loadingText=Loading My Stories theme=ajax href=%{storyAction} /s:div s:div id=two label=Poem theme=ajax href=%{poemAction} loadingText=Loading My Poems /s:div s:div id=three label=Jokes/Humors theme=ajax href=%{jokesAction} loadingText=Loading My Jokes /s:div s:div id=four label=Shayaries/Ghazal theme=ajax href=%{shayariAction} loadingText=Loading My Shayaries /s:div /s:tabbedPanel On 11/13/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: I can see below message after execution in tabble panel.. *Couldn't load content:Unknown runtime error* It looks request is getting forwarded to new location /WEB-INF/jsp/MyArticlesDetail.jsp. How do I include response of MyArticlesDetail.jsp in main jsp MyArticles.jsp I have below configuration in struts.xml package name=article namespace=/article extends=struts-default action name=myArticles_* method={1} class= com.rawatsoft.write4smile.webapp.action.ArticleAction result name=success type=dispatcher /WEB-INF/jsp/MyArticlesDetail.jsp /result /action On 11/13/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Thanks Basti, I made this change for s:url Now I can see from log that DisplayTag is getting populated with correct data but table is not getting populated to main JSP MyArticles.jsp i.e. response of MyArticlesDetail.jsp is not getting included in MyArticle.jsp which contain TabbedPanel Not sure what to do now. Thanks Raghu On 11/13/07, lbastil [EMAIL PROTECTED] wrote: I think you have to use s:url .../ when using ajaxed remote divs. Try something like: s:url id=yourId ... / ... s:div id=one label=Stories theme=ajax href=%{yourId} labelposition=top /s:div Regards, basti Raghuveer Rawat wrote: Hi, I am using Struts2, Tile2, Spring2, Display Tag. I am implementing tabbed panel and all the tabs make remote calls. Each Tab will contain a table which are implemented using DisplayTag. I am implementing this table in a separagte JSP and want its content to be added to tab in the main jsp after execution. I can see Tabbed Panel but it is not able to load data. Request is reaching to Action class but data is not reaching back to original jsp. I am implementing like below.. *MyArticles.jsp* . . ...and it has Tabbed Panel. s:tabbedPanel id=test s:div id=one label=Stories theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=1 labelposition=top /s:div s:div id=two label=Poem theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=2 /s:div s:div id=three label=Jokes/Humors theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=3 /s:div s:div id=four label=Shayaries/Ghazal theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=4 /s:div /s:tabbedPanel *MyArticleDetail.jsp (*This jsp contain table, which will be added to tab*)* display:table id=articleId name=articlesByAuthor requestURI= defaultsort=3 sort=list defaultorder=descending pagesize=10 class=table display:column property=categoryName sortable=true title=name style=width:20%; class=text/ display:column property=title sortable=true title=title style=width:20%; class=text / display:column property=lastUpdatedDate format={0,date,dd-MMM-} sortable=true title=Date style=width:20%; class=text / display:column property=ratingCount sortable=true title=Rating style=width:20%; class=text / /display:table *Struts.xml* ** package name=article namespace=/article extends=struts-default action name=myArticles_* method={1} class= com.rawatsoft.write4smile.webapp.action.ArticleAction result name=success type=dispatcher /WEB-INF/jsp
Re: [S2] Help for Ajax Tabbed Panel
Thanks Basti, I made this change for s:url Now I can see from log that DisplayTag is getting populated with correct data but table is not getting populated to main JSP MyArticles.jsp i.e. response of MyArticlesDetail.jsp is not getting included in MyArticle.jspwhich contain TabbedPanel Not sure what to do now. Thanks Raghu On 11/13/07, lbastil [EMAIL PROTECTED] wrote: I think you have to use s:url .../ when using ajaxed remote divs. Try something like: s:url id=yourId ... / ... s:div id=one label=Stories theme=ajax href=%{yourId} labelposition=top /s:div Regards, basti Raghuveer Rawat wrote: Hi, I am using Struts2, Tile2, Spring2, Display Tag. I am implementing tabbed panel and all the tabs make remote calls. Each Tab will contain a table which are implemented using DisplayTag. I am implementing this table in a separagte JSP and want its content to be added to tab in the main jsp after execution. I can see Tabbed Panel but it is not able to load data. Request is reaching to Action class but data is not reaching back to original jsp. I am implementing like below.. *MyArticles.jsp*.. ...and it has Tabbed Panel. s:tabbedPanel id=test s:div id=one label=Stories theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=1 labelposition=top /s:div s:div id=two label=Poem theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=2 /s:div s:div id=three label=Jokes/Humors theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=3 /s:div s:div id=four label=Shayaries/Ghazal theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=4 /s:div /s:tabbedPanel *MyArticleDetail.jsp (*This jsp contain table, which will be added to tab*)* display:table id=articleId name=articlesByAuthor requestURI= defaultsort=3 sort=list defaultorder=descending pagesize=10 class=table display:column property=categoryName sortable=true title=name style=width:20%; class=text/ display:column property=title sortable=true title=title style=width:20%; class=text / display:column property=lastUpdatedDate format={0,date,dd-MMM-} sortable=true title=Date style=width:20%; class=text / display:column property=ratingCount sortable=true title=Rating style=width:20%; class=text / /display:table *Struts.xml* ** package name=article namespace=/article extends=struts-default action name=myArticles_* method={1} class= com.rawatsoft.write4smile.webapp.action.ArticleAction result name=success type=dispatcher /WEB-INF/jsp/MyArticlesDetail.jsp /result /action /package Error Log: [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Opening Hibernate Session [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | opened session at timestamp: 4894327269310466 [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | No bean named ' org.apache.struts2.dispatcher.ServletDispatcherResult' found in [EMAIL PROTECTED] : defining beans [dataSource,sessionFactory,transactionManager,articleDAO,userDAO,myMessageDAO,featuredArticlesDAO,myFriendsDAO,countryDAO,myInvitesDAO,writerInterestDAO,channelDAO,categoryDAO,securityQuestionsDAO,commentDAO,ratingDAO,testDAO,testServiceTarget,articleServiceTarget,countryServiceTarget,myInvitesServiceTarget,writerInterestServiceTarget,securityQuestionsServiceTarget,channelServiceTarget,categoryServiceTarget,userServiceTarget,myMessageServiceTarget,featuredArticlesServiceTarget,myFriendsServiceTarget,commentServiceTarget,ratingServiceTarget,testService,articleService,userService,myMessageService,featuredArticlesService,commentService,ratingService,myFriendsService,countryService,writerInterestService,channelService,categoryService,securityQuestionsService,myInvitesService]; root of factory hierarchy [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | setting flush mode to: NEVER [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Bound value [ [EMAIL PROTECTED] for key [ [EMAIL PROTECTED] to thread [http-8080-Processor22] [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Creating [ java.util.LinkedHashMap] [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Checking ConfigurationProviders for reload. [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Creating [ java.util.LinkedHashMap] [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Ignoring constructor [public org.apache.struts2.dispatcher.ServletDispatcherResult(java.lang.String)] of bean 'org.apache.struts2.dispatcher.ServletDispatcherResult': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ' org.apache.struts2.dispatcher.ServletDispatcherResult': Unsatisfied dependency expressed through constructor argument with index 0 of type [ java.lang.String]: There are 0 beans of type
Re: [S2] Help for Ajax Tabbed Panel
I can see below message after execution in tabble panel.. *Couldn't load content:Unknown runtime error* It looks request is getting forwarded to new location /WEB-INF/jsp/MyArticlesDetail.jsp. How do I include response of MyArticlesDetail.jsp in main jsp MyArticles.jsp I have below configuration in struts.xml package name=article namespace=/article extends=struts-default action name=myArticles_* method={1} class= com.rawatsoft.write4smile.webapp.action.ArticleAction result name=success type=dispatcher /WEB-INF/jsp/MyArticlesDetail.jsp /result /action On 11/13/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Thanks Basti, I made this change for s:url Now I can see from log that DisplayTag is getting populated with correct data but table is not getting populated to main JSP MyArticles.jsp i.e. response of MyArticlesDetail.jsp is not getting included in MyArticle.jspwhich contain TabbedPanel Not sure what to do now. Thanks Raghu On 11/13/07, lbastil [EMAIL PROTECTED] wrote: I think you have to use s:url .../ when using ajaxed remote divs. Try something like: s:url id=yourId ... / ... s:div id=one label=Stories theme=ajax href=%{yourId} labelposition=top /s:div Regards, basti Raghuveer Rawat wrote: Hi, I am using Struts2, Tile2, Spring2, Display Tag. I am implementing tabbed panel and all the tabs make remote calls. Each Tab will contain a table which are implemented using DisplayTag. I am implementing this table in a separagte JSP and want its content to be added to tab in the main jsp after execution. I can see Tabbed Panel but it is not able to load data. Request is reaching to Action class but data is not reaching back to original jsp. I am implementing like below.. *MyArticles.jsp* . . ...and it has Tabbed Panel. s:tabbedPanel id=test s:div id=one label=Stories theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=1 labelposition=top /s:div s:div id=two label=Poem theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=2 /s:div s:div id=three label=Jokes/Humors theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=3 /s:div s:div id=four label=Shayaries/Ghazal theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=4 /s:div /s:tabbedPanel *MyArticleDetail.jsp (*This jsp contain table, which will be added to tab*)* display:table id=articleId name=articlesByAuthor requestURI= defaultsort=3 sort=list defaultorder=descending pagesize=10 class=table display:column property=categoryName sortable=true title=name style=width:20%; class=text/ display:column property=title sortable=true title=title style=width:20%; class=text / display:column property=lastUpdatedDate format={0,date,dd-MMM-} sortable=true title=Date style=width:20%; class=text / display:column property=ratingCount sortable=true title=Rating style=width:20%; class=text / /display:table *Struts.xml* ** package name=article namespace=/article extends=struts-default action name=myArticles_* method={1} class= com.rawatsoft.write4smile.webapp.action.ArticleAction result name=success type=dispatcher /WEB-INF/jsp/MyArticlesDetail.jsp /result /action /package Error Log: [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Opening Hibernate Session [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | opened session at timestamp: 4894327269310466 [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | No bean named ' org.apache.struts2.dispatcher.ServletDispatcherResult' found in [EMAIL PROTECTED]: defining beans [dataSource,sessionFactory,transactionManager,articleDAO,userDAO,myMessageDAO,featuredArticlesDAO,myFriendsDAO,countryDAO,myInvitesDAO,writerInterestDAO,channelDAO,categoryDAO,securityQuestionsDAO,commentDAO,ratingDAO,testDAO,testServiceTarget,articleServiceTarget,countryServiceTarget,myInvitesServiceTarget,writerInterestServiceTarget,securityQuestionsServiceTarget,channelServiceTarget,categoryServiceTarget,userServiceTarget,myMessageServiceTarget,featuredArticlesServiceTarget,myFriendsServiceTarget,commentServiceTarget,ratingServiceTarget,testService,articleService,userService,myMessageService,featuredArticlesService,commentService,ratingService,myFriendsService,countryService,writerInterestService,channelService,categoryService,securityQuestionsService,myInvitesService]; root of factory hierarchy [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | setting flush mode to: NEVER [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Bound value [ [EMAIL PROTECTED] ] for key [ [EMAIL PROTECTED] to thread [http-8080-Processor22] [WRITE4SMILE] DEBUG
[S2] Help for Ajax Tabbed Panel
Hi, I am using Struts2, Tile2, Spring2, Display Tag. I am implementing tabbed panel and all the tabs make remote calls. Each Tab will contain a table which are implemented using DisplayTag. I am implementing this table in a separagte JSP and want its content to be added to tab in the main jsp after execution. I can see Tabbed Panel but it is not able to load data. Request is reaching to Action class but data is not reaching back to original jsp. I am implementing like below.. *MyArticles.jsp*.. ...and it has Tabbed Panel. s:tabbedPanel id=test s:div id=one label=Stories theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=1 labelposition=top /s:div s:div id=two label=Poem theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=2 /s:div s:div id=three label=Jokes/Humors theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=3 /s:div s:div id=four label=Shayaries/Ghazal theme=ajax href=article/myArticles_articlesByAuthorId.action?channelId=4 /s:div /s:tabbedPanel *MyArticleDetail.jsp (*This jsp contain table, which will be added to tab*)* display:table id=articleId name=articlesByAuthor requestURI= defaultsort=3 sort=list defaultorder=descending pagesize=10 class=table display:column property=categoryName sortable=true title=name style=width:20%; class=text/ display:column property=title sortable=true title=title style=width:20%; class=text / display:column property=lastUpdatedDate format={0,date,dd-MMM-} sortable=true title=Date style=width:20%; class=text / display:column property=ratingCount sortable=true title=Rating style=width:20%; class=text / /display:table *Struts.xml* ** package name=article namespace=/article extends=struts-default action name=myArticles_* method={1} class= com.rawatsoft.write4smile.webapp.action.ArticleAction result name=success type=dispatcher param name=location/WEB-INF/jsp/MyArticlesDetail.jsp/param /result /action /package Error Log: [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Opening Hibernate Session [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | opened session at timestamp: 4894327269310466 [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | No bean named ' org.apache.struts2.dispatcher.ServletDispatcherResult' found in [EMAIL PROTECTED]: defining beans [dataSource,sessionFactory,transactionManager,articleDAO,userDAO,myMessageDAO,featuredArticlesDAO,myFriendsDAO,countryDAO,myInvitesDAO,writerInterestDAO,channelDAO,categoryDAO,securityQuestionsDAO,commentDAO,ratingDAO,testDAO,testServiceTarget,articleServiceTarget,countryServiceTarget,myInvitesServiceTarget,writerInterestServiceTarget,securityQuestionsServiceTarget,channelServiceTarget,categoryServiceTarget,userServiceTarget,myMessageServiceTarget,featuredArticlesServiceTarget,myFriendsServiceTarget,commentServiceTarget,ratingServiceTarget,testService,articleService,userService,myMessageService,featuredArticlesService,commentService,ratingService,myFriendsService,countryService,writerInterestService,channelService,categoryService,securityQuestionsService,myInvitesService]; root of factory hierarchy [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | setting flush mode to: NEVER [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Bound value [ [EMAIL PROTECTED] for key [ [EMAIL PROTECTED] to thread [http-8080-Processor22] [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Creating [ java.util.LinkedHashMap] [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Checking ConfigurationProviders for reload. [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Creating [ java.util.LinkedHashMap] [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Ignoring constructor [public org.apache.struts2.dispatcher.ServletDispatcherResult(java.lang.String)] of bean 'org.apache.struts2.dispatcher.ServletDispatcherResult': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ' org.apache.struts2.dispatcher.ServletDispatcherResult': Unsatisfied dependency expressed through constructor argument with index 0 of type [ java.lang.String]: There are 0 beans of type [java.lang.String] available for autowiring: []. There should have been exactly 1 to be able to autowire constructor of bean 'org.apache.struts2.dispatcher.ServletDispatcherResult'. [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Forwarding to location /WEB-INF/jsp/MyArticlesDetail.jsp [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | servletPath=/WEB-INF/jsp/MyArticlesDetail.jsp, pathInfo=null, queryString=null, name=null [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Path Based Forward [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Entering nullPropertyValue [EMAIL PROTECTED], [EMAIL PROTECTED], property=org] [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | Removed value [ [EMAIL PROTECTED] for key [ [EMAIL PROTECTED] from thread [http-8080-Processor22] [WRITE4SMILE] DEBUG [2007/11/12 16:48:38] | JspEngine --
[Tile2] Help in Page Layout
Hi, I have newbie in GUI design (Tiles/Menuing) etc. I need some urgent help in Page Layout Design using Tile2/Struts Menu. I am using below template for my page. Menu is very simple one so I have just anchor tags in Header.jsp definition name=.layout template=/WEB-INF/common/Layout.jsp put-attribute name=title value=Title/ put-attribute name=header value=/WEB-INF/common/Header.jsp/ put-attribute name=leftPanel value=nothing/ put-attribute name=content value=nothing/ put-attribute name=rightPanel value=nothing/ put-attribute name=footer value=/WEB-INF/common/Footer.jsp/ /definition Now my other pages are extending this tile layout like below. definition name=welcome extends=.layout put-attribute name=title value=Title/ put-attribute name=leftPanel value=/WEB-INF/jsp/Left.jsp/ put-attribute name=content value=/WEB-INF/jsp/Center.jsp/ put-attribute name=rightPanel value=/WEB-INF/jsp/Right.jsp/ /definition Left.jsp contains a number of link. When user click on these links content of Center.jsp will also change. Now again Center.jsp have 4-5 menu items and page will change besed on menu item selection. I am wondering what will be best way to Design Layout of this Center.jsp. Anyone who can help me.
Re: Problem with Tiles decoration and struts2
Amit, looks like problem is with your struts.xml. You have set Tiles Result but your result is jsp page. I think you need to change it to tile definition. Try below... struts.xml struts package name=default extends=struts-default result-types result-typeclass= org.apache.struts2.views.tiles.TilesResult name=tiles /result-type /result-types action name=home class=com.tj.actions.HomeAction result *home*/result /action /package /struts tiles.xml ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 2.0//EN http://tiles.apache.org/dtds/tiles-config_2_0.dtd tiles-definitions definition name=blank template=/jsp/template/blankLayout.jsp put-attribute name=title value=my application / /definition definition name=home extends=blank put-attribute name=title value=my application / put-attribute name=body value=jsp/home.jsp / /definition /tiles-definitions On Nov 6, 2007 6:35 AM, Amit Rana [EMAIL PROTECTED] wrote: Hi, I am trying to get TilesDecorationFilter ( http://tiles.apache.org/tutorial/advanced/utils.html) to work with struts2.0.9 without any success. Can anyone please help me figure out where am I going wrong? I am not sure if this is a tiles list question or struts? Tiles is decorating jsps but not the out put from an action. If I access jsp/home.jsp it comes with the layout but home.action only prints layout and result of action is not seen anywhere. There are no errors. Kindly advice. web.xml web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns= http://java.sun.com/xml/ns/javaee; xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID version=2.5 display-nameMyApp/display-name listener listener-class org.apache.struts2.tiles.StrutsTilesListener /listener-class /listener filter filter-namestruts2/filter-name filter-class org.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter filter-nametilesdecoration/filter-name filter-class org.apache.tiles.web.util.TilesDecorationFilter/filter-class init-param param-namedefinition/param-name param-valueblank/param-value /init-param init-param param-nameattribute-name/param-name param-valuebody/param-value /init-param /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-nametilesdecoration/filter-name url-pattern/*/url-pattern /filter-mapping welcome-file-list welcome-filehome.action/welcome-file /welcome-file-list /web-app struts.xml struts package name=default extends=struts-default result-types result-typeclass= org.apache.struts2.views.tiles.TilesResult name=tiles /result-type /result-types action name=home class= com.tj.actions.HomeAction resultjsp/home.jsp/result /action /package /struts tiles.xml ?xml version= 1.0 encoding=ISO-8859-1 ? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 2.0//EN http://tiles.apache.org/dtds/tiles-config_2_0.dtd; tiles-definitions definition name=blank template=/jsp/template/blankLayout.jsp put-attribute name=title value=my application / /definition /tiles-definitions blankLayout.jsp %@ taglib uri=http://tiles.apache.org/tags-tiles; prefix=tiles % html head titletiles:getAsString name=title//title /head body tiles:insertAttribute name=body / /body /html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help Struts 2.0.8
Hi, still looking for help. On 10/31/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, I have form which allows user to invite other users. A user can invite a max of 10 users at a time. A row contain First Name, Last Name, and Email Address. How should I name these textfields (OGNL expression) and how should I retrieve these values in Action Class? table tr tdFirst Name/ td tdLast Name/ td tdEmail Address/ td /tr tr s:textfield name=firstName size=25 maxlength =20//td s:textfield name=lastName size=25 maxlength =20//td s:textfield name=email size=25 maxlength= 20//td /tr similarly 9 more rows like this. /table
Re: Need Help Struts 2.0.8
I found an Article on this in Ian Roughley's book. Posting here if someone is implementing Tabular Data Entry support in their apps. *Utilize Tabular Data Entry Support* Struts2 provides support for using lists to transfer tabulated data easily between the HTML user interface and actions. Let's take a look at an example. Here is a class for Person; each attribute has a getter and setter (not shown): public class Person { int id; String name; int age; float height; } Our action would then use the person class in a list: public class MyAction { public List getPeopleList() { … } public void setPeopleList( List peopleList ) { … } … } Before we can use the Person class as an element in MyAction, we need to add configuration information. This is achieved with the MyAction-conversion.properties file, which is created in the same package as MyAction. The name follows the same convention as for validation, the name of the action followed by a *-conversion.properties suffix. The file contents are: Element_peopleList=Person The prefix Element_ is constant, with the last part of the lefthand value being the name of the list property in the action class. The right-hand side value is the full class name (including package) of the class that is placed into the list. To finish the example we need to render the list to the user: ww:iterator value=peopleList status=stat s:property value=peopleList[#stat.index].id / s:property value=peopleList[#stat.index].name / s:property value=peopleList[#stat.index].age / s:property value=peopleList[#stat.index].height/ /ww:iterator Lists are indexed, so we use the index property of the iterators status object to reference the element being displayed. This is not the most efficient way of achieving this particular result, as the value of the s:property … / tags could have been simply id, name, age and height respectively. What it does show is a clean form of what is needed for an editable form. For a tabular editable form using the same objects, the JSP is: s:form action=update method=post s:iterator value=peopleList status=stat s:hidden name=peopleList[%{#stat.index}].id value=%{peopleList[#stat.index].id}/ s:textfield label=Name name=peopleList[%{#stat.index}].name value=%{peopleList[#stat.index].name}/ s:textfield label=Age name=peopleList[%{#stat.index}].age value=%{peopleList[#stat.index].age} / s:textfield label=Height name=peopleList[%{#stat.index}].height value=%{peopleList[#stat.index].height}/ br/ /s:iterator s:submit value=Update/ /s:form Notice that the name and value attribute of this code is similar to the value attribute above. The difference being in the name we need to provide the actual index by surrounding #stat.index with the correct token to obtain a value, and the value attribute has the entire expression surrounded. Using this code, Struts2 will create an ArrayList with populated People objects, and set the list on the action using the setPeopleList() method. To allow Struts2 to create new objects in the list (perhaps you are dynamically creating elements in the user interface), add the following line to MyAction-conversion.properties configuration file: CreateIfNull_peopleList = true On 11/1/07, John Doe [EMAIL PROTECTED] wrote: The simplest way (if I'have understood your problem right) is to create 10 variables in your action class (with getters and setters of course) and on the form. So it'll be private String firstName1; private String firstName2; private String firstName3; ... private String firstName10; in the action class and : s:textfield name=firstName1 size=25 maxlength =20/ s:textfield name=firstName2 size=25 maxlength =20/ s:textfield name=firstName3 size=25 maxlength =20/ ... s:textfield name=firstName10 size=25 maxlength =20/ Struts fills action variables values automatically using reflection. On 11/1/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, still looking for help. On 10/31/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, I have form which allows user to invite other users. A user can invite a max of 10 users at a time. A row contain First Name, Last Name, and Email Address. How should I name these textfields (OGNL expression) and how should I retrieve these values in Action Class? table tr tdFirst Name/ td tdLast Name/ td tdEmail Address/ td /tr tr s:textfield name=firstName size=25 maxlength =20//td s:textfield name=lastName size=25 maxlength =20//td s:textfield name=email size=25 maxlength= 20//td /tr similarly 9 more rows like this. /table -- Best regards, Bashmaкov Anton
Re: Need Help Struts 2.0.8
Oh, Didn't notice that. Can this message be deleted? On 11/1/07, Dave Newton [EMAIL PROTECTED] wrote: --- Raghuveer Rawat wrote: I found an Article on this in Ian Roughley's book. Posting here if someone is implementing Tabular Data Entry support in their apps. You know it's copyrighted, right? d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help Struts 2.0.8
Thanks Jim for link. Yeah, I have to upgrade to newer version 2.0.11. On 11/1/07, Jim Cushing [EMAIL PROTECTED] wrote: It's not necessary to do declare 10 variables. Here's an example: http://struts.apache.org/2.x/docs/tabular-inputs.html By the way, Struts 2.0.11 is out, so Raguveer, you might want to upgrade. The answer to your particular question doesn't change, but there are some bug and security fixes you should have. On Nov 1, 2007, at 7:14 AM, John Doe wrote: The simplest way (if I'have understood your problem right) is to create 10 variables in your action class (with getters and setters of course) and on the form. So it'll be private String firstName1; private String firstName2; private String firstName3; ... private String firstName10; in the action class and : s:textfield name=firstName1 size=25 maxlength =20/ s:textfield name=firstName2 size=25 maxlength =20/ s:textfield name=firstName3 size=25 maxlength =20/ ... s:textfield name=firstName10 size=25 maxlength =20/ Struts fills action variables values automatically using reflection. On 11/1/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, still looking for help. On 10/31/07, Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, I have form which allows user to invite other users. A user can invite a max of 10 users at a time. A row contain First Name, Last Name, and Email Address. How should I name these textfields (OGNL expression) and how should I retrieve these values in Action Class? table tr tdFirst Name/ td tdLast Name/ td tdEmail Address/ td /tr tr s:textfield name=firstName size=25 maxlength =20//td s:textfield name=lastName size=25 maxlength =20//td s:textfield name=email size=25 maxlength= 20//td /tr similarly 9 more rows like this. /table -- Best regards, Bashmaкov Anton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need Help Struts 2.0.8
Hi, I have form which allows user to invite other users. A user can invite a max of 10 users at a time. A row contain First Name, Last Name, and Email Address. How should I name these textfields (OGNL expression) and how should I retrieve these values in Action Class? table tr tdFirst Name/td tdLast Name/td tdEmail Address/td /tr tr s:textfield name=firstName size=25 maxlength=20//td s:textfield name=lastName size=25 maxlength=20//td s:textfield name=email size=25 maxlength=20//td /tr similarly 9 more rows like this. /table
Re: File Upload using Struts2
I already have enctype=multipart/form-data I can see below errors in log.. Looks like request is getting terminated befor Content-Type not allowed: myPhoto upload_7ddb4d8f_115a947dc12__8000_.tmp image/pjpeg java.lang.NullPointerException: Source must not be null Looks like request is getting complete before it reaches to FileUpload. How to make this request available to FileUpload? Thanks Raghu On 10/16/07, Rajagopal_Yendluri [EMAIL PROTECTED] wrote: Hi Raghu, There should be no problem with the configuration, you have to set the enctype Here is my code: JSP s:form action=Login enctype=multipart/form-data s:file name=myFile label=UploadFile/ Action File f = new File(C:\\Tomcat 6.0\\abcd.jpeg); FileUtils.copyFile(getMyFile(), f); Find out where is the problem in your code, if not able to please post the code. Regards, Rajagopal Y HCU-Consulting Enterprise Solutions. Phone: (C) +91-9886876114 / (W) 6658 3685. -Original Message- From: Raghuveer Rawat [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 16, 2007 10:31 AM To: Struts Users Mailing List Subject: Re: File Upload using Struts2 Thanks Dave for reply.. I have no clue what is happening...I can see below statement in log.. Content-Type not allowed: myPhoto upload_460c03b6_115a6ef087d__8000_.tmp image/jpeg I have configured filters like below in web.xml.. I don't have context clean-up filter. Where should I place this filter? filter filter-nameopenSessionInViewFilter/filter-name filter-class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter /filter-class /filter filter filter-namefilterDispatcher/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter-mapping filter-nameopenSessionInViewFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namefilterDispatcher/filter-name url-pattern/*/url-pattern /filter-mapping listener listener-class org.springframework.web.context.ContextLoaderListener/listener-class /listener listener listener-classorg.apache.struts2.tiles.StrutsTilesListener /listener-class /listener Thanks Raghu On 10/15/07, Dave Newton [EMAIL PROTECTED] wrote: In general it's a good idea to include things like what is actually happening: what symptoms (besides the file isn't uploading :) are there? Is there anything in the logs? Are you including the context cleanup filter in your web.xml? d. --- Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, I am trying to upload a jpg image using Struts2 but no luck till now. It will be great if someone could help me in moving further. I am using Struts 2.0.8 and i have commons-fileupload-1.2.jar and commons-io-1.3.2.jar in classpath My code looks like below. MyPhoto.jsp s:form method=post action=myPhotoUpload enctype=multipart/form-data s:file name=myPhoto cssClass=textbox1 accept=image/* / s:submit name=method:upload cssClass=btn value=Upload / /s:form Action class: MyPhotoUploadAction.java private File myPhoto;//The actual file private String myPhotoContentType; //The content type of the file private String myPhotoFileName; //The uploaded file name public File getMyPhoto() { return myPhoto; } public void setMyPhoto(File myPhoto) { System.out.println(Inside setMyPhoto); this.myPhoto = myPhoto; } public String getMyPhotoContentType() { return myPhotoContentType; } public void setMyPhotoContentType(String myPhotoContentType) { System.out.println(Inside setMyPhotoContentType); this.myPhotoContentType = myPhotoContentType; } public String getMyPhotoFileName() { System.out.println(Inside getMyPhotoFileName:+myPhotoFileName); return myPhotoFileName; } public void setMyPhotoFileName(String myPhotoFileName) { System.out.println(Inside setMyPhotoFileName:+myPhotoFileName); this.myPhotoFileName = myPhotoFileName; } public String upload() { try{ System.out.println(Inside Upload); File destDir = new File(images/member); System.out.println(File Name:+this.getMyPhotoFileName()); System.out.println(File ContentType:+this.getMyPhotoContentType()); FileUtils.copyFileToDirectory(getMyPhoto(), destDir); return SUCCESS; // redirect to welcome page
File Upload using Struts2
Hi, I am trying to upload a jpg image using Struts2 but no luck till now. It will be great if someone could help me in moving further. I am using Struts 2.0.8 and i have commons-fileupload-1.2.jar and commons-io-1.3.2.jar in classpath My code looks like below. MyPhoto.jsp s:form method=post action=myPhotoUpload enctype=multipart/form-data s:file name=myPhoto cssClass=textbox1 accept=image/* / s:submit name=method:upload cssClass=btn value=Upload / /s:form Action class: MyPhotoUploadAction.java private File myPhoto;//The actual file private String myPhotoContentType; //The content type of the file private String myPhotoFileName; //The uploaded file name public File getMyPhoto() { return myPhoto; } public void setMyPhoto(File myPhoto) { System.out.println(Inside setMyPhoto); this.myPhoto = myPhoto; } public String getMyPhotoContentType() { return myPhotoContentType; } public void setMyPhotoContentType(String myPhotoContentType) { System.out.println(Inside setMyPhotoContentType); this.myPhotoContentType = myPhotoContentType; } public String getMyPhotoFileName() { System.out.println(Inside getMyPhotoFileName:+myPhotoFileName); return myPhotoFileName; } public void setMyPhotoFileName(String myPhotoFileName) { System.out.println(Inside setMyPhotoFileName:+myPhotoFileName); this.myPhotoFileName = myPhotoFileName; } public String upload() { try{ System.out.println(Inside Upload); File destDir = new File(images/member); System.out.println(File Name:+this.getMyPhotoFileName()); System.out.println(File ContentType:+this.getMyPhotoContentType()); FileUtils.copyFileToDirectory(getMyPhoto(), destDir); return SUCCESS; // redirect to welcome page. }catch(Exception exp){ LOG.error(File Upload Error:+ exp); this.addActionError(File Upload Error:+ exp); return ERROR; } }
Fwd: File Upload using Struts2
Hi, I am new to sturts2. I am trying to upload a jpg image using Struts2 but no luck till now. It will be great if someone could help me in moving further. I am using Struts 2.0.8 and i have commons-fileupload-1.2.jar and commons-io-1.3.2.jar in classpath I put debug statement in setter methods. I can see even setter methods are not getting invoked. File, FileName, ContentType are all null at Action class. My code looks like below. MyPhoto.jsp s:form method=post action=myPhotoUpload enctype=multipart/form-data s:file name=myPhoto cssClass=textbox1 accept=image/* / s:submit name=method:upload cssClass=btn value=Upload / /s:form Action class: MyPhotoUploadAction.java private File myPhoto;//The actual file private String myPhotoContentType; //The content type of the file private String myPhotoFileName; //The uploaded file name public File getMyPhoto() { return myPhoto; } public void setMyPhoto(File myPhoto) { this.myPhoto = myPhoto; } public String getMyPhotoContentType() { return myPhotoContentType; } public void setMyPhotoContentType(String myPhotoContentType) { this.myPhotoContentType = myPhotoContentType; } public String getMyPhotoFileName() { return myPhotoFileName; } public void setMyPhotoFileName(String myPhotoFileName) { this.myPhotoFileName = myPhotoFileName; } public String upload() { try{ File destDir = new File(images/member); FileUtils.copyFileToDirectory (getMyPhoto(), destDir); return SUCCESS; // redirect to welcome page. }catch(Exception exp){ LOG.error(File Upload Error:+ exp); this.addActionError(File Upload Error:+ exp); return ERROR; } } Struts.xml struts package name=Non-RPC namespace=/ extends=tiles-default result-types result-type name=tiles class= org.apache.struts2.views.tiles.TilesResult default=true / /result-types action name=myPhotoUpload_* method={1} class= com.rawatsoft.write4smile.webapp.action.MyPhotoUploadAction interceptor-ref name=fileUpload param name=allowedTypes image/* /param /interceptor-ref interceptor-ref name=basicStack/ result name=inputmyPhotoUpload/result /action /package web.xml filter filter-namestruts-cleanup/filter-name filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter-class /filter filter filter-nameopenSessionInViewFilter/filter-name filter-class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter /filter-class /filter filter filter-namefilterDispatcher/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-nameopenSessionInViewFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namefilterDispatcher/filter-name url-pattern/*/url-pattern /filter-mapping listener listener-class org.springframework.web.context.ContextLoaderListener/listener-class /listener listener listener-classorg.apache.struts2.tiles.StrutsTilesListener /listener-class /listener
Re: File Upload using Struts2
Thanks Dave for reply.. I have no clue what is happening...I can see below statement in log.. Content-Type not allowed: myPhoto upload_460c03b6_115a6ef087d__8000_.tmp image/jpeg I have configured filters like below in web.xml.. I don't have context clean-up filter. Where should I place this filter? filter filter-nameopenSessionInViewFilter/filter-name filter-class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter /filter-class /filter filter filter-namefilterDispatcher/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter-mapping filter-nameopenSessionInViewFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namefilterDispatcher/filter-name url-pattern/*/url-pattern /filter-mapping listener listener-class org.springframework.web.context.ContextLoaderListener/listener-class /listener listener listener-classorg.apache.struts2.tiles.StrutsTilesListener /listener-class /listener Thanks Raghu On 10/15/07, Dave Newton [EMAIL PROTECTED] wrote: In general it's a good idea to include things like what is actually happening: what symptoms (besides the file isn't uploading :) are there? Is there anything in the logs? Are you including the context cleanup filter in your web.xml? d. --- Raghuveer Rawat [EMAIL PROTECTED] wrote: Hi, I am trying to upload a jpg image using Struts2 but no luck till now. It will be great if someone could help me in moving further. I am using Struts 2.0.8 and i have commons-fileupload-1.2.jar and commons-io-1.3.2.jar in classpath My code looks like below. MyPhoto.jsp s:form method=post action=myPhotoUpload enctype=multipart/form-data s:file name=myPhoto cssClass=textbox1 accept=image/* / s:submit name=method:upload cssClass=btn value=Upload / /s:form Action class: MyPhotoUploadAction.java private File myPhoto;//The actual file private String myPhotoContentType; //The content type of the file private String myPhotoFileName; //The uploaded file name public File getMyPhoto() { return myPhoto; } public void setMyPhoto(File myPhoto) { System.out.println(Inside setMyPhoto); this.myPhoto = myPhoto; } public String getMyPhotoContentType() { return myPhotoContentType; } public void setMyPhotoContentType(String myPhotoContentType) { System.out.println(Inside setMyPhotoContentType); this.myPhotoContentType = myPhotoContentType; } public String getMyPhotoFileName() { System.out.println(Inside getMyPhotoFileName:+myPhotoFileName); return myPhotoFileName; } public void setMyPhotoFileName(String myPhotoFileName) { System.out.println(Inside setMyPhotoFileName:+myPhotoFileName); this.myPhotoFileName = myPhotoFileName; } public String upload() { try{ System.out.println(Inside Upload); File destDir = new File(images/member); System.out.println(File Name:+this.getMyPhotoFileName()); System.out.println(File ContentType:+this.getMyPhotoContentType()); FileUtils.copyFileToDirectory(getMyPhoto(), destDir); return SUCCESS; // redirect to welcome page. }catch(Exception exp){ LOG.error(File Upload Error:+ exp); this.addActionError(File Upload Error:+ exp); return ERROR; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MVC1 -Frame Based JSP Application to Tiles
I Have a JSP web application using MVC1 framework. It uses Farmes(one left for navigational links and other right with tabs on top.) From tiles documentation i understand i can use tiles with out struts ? So i was thinking the possibility and feasibilty of using tiles for my current application. Any Comments? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Indexed Properties
hi Adam, I understand description,numProducts are properties in User defined Object/java bean in results(getResults(),setResults(..)) Collection in your actionForm. For this kind of requirments there will not be any change in actionform even though ,complixety increases in nesting.. Solution is to use Nested Tags. Nested tags are used for nesting a object inside the other. In your requirment results is a nested property in your actionform. results collection has a collection of objects. I have used Nested tags for most complex requirments and succeeded. Nested Tags is the real power of Struts... Regards Raghu -Original Message- From: Adam K [mailto:[EMAIL PROTECTED] Sent: Saturday, November 18, 2006 2:55 AM To: Struts Users Mailing List Subject: Re: Indexed Properties Thanks for the suggestion I'll keep trying things and see what I can get from it. On 11/17/06, Hubert Rabago [EMAIL PROTECTED] wrote: Lots of people have done it. Search the archives [1]. Search for indexed and lazyList. I've done it with both ActionForm and DynaActionForm. Hubert [1] http://struts.apache.org/mail.html On 11/17/06, Adam K [EMAIL PROTECTED] wrote: I think I have found the problem - or at least a potential cause. Would it be correct in stating that this will not work using ActionForm (what I was using) and that I must instead use DynaActionForm ? Thanks for the time thus far. On 11/17/06, Hubert Rabago [EMAIL PROTECTED] wrote: Adam, Try adding a getResultsPage() that doesn't take params and always returns a valid collection. (Throw in the setResultsPage() that accepts a collection as well.) Hubert On 11/17/06, Adam K [EMAIL PROTECTED] wrote: This has been driving me nuts for the past little bit. I have a page that is populated using indexed properties. The prepopulation works fine, and I get the results as I would expect them, but trying to submit the form I get an index out of bounds exception. I know that it is being caused because the page doesn't have the arrayList to use in the indexed properties. I guess my question boils down to using indexed properties properly. I will start by putting in an explanation of what I have and what I am trying to do: The following is what I am working with : JSP: logic:notEmpty name=ProdSelectionForm property=results logic:iterate name=ProdSelectionForm property=results id=ResultsPage tr tdbean:write name=ResultsPage property=description //td td html:text name=ResultsPage property=numProducts indexed=true / /td /tr /logic:iterate /logic:notEmpty What I am trying to achieve is that a user clicks on a link, they are sent to page, and all of the values are prepopulated. The page is then displayed and the user has the option to modify any of the variables that they want to before resubmitting the page. (When they resubmit the form has a url parameter attached to it). What is happening (or at least what I believe is happening is the following: link is clicked, reset is called action sets the variables, page is displayed, user can modify the page and resubmit, reset is called on the form, the action is called (this is where it dies as there is no longer an ArrayList) to modify. My question is am I going about this in a manner that seems sensible or am I way off base ? I have the values being prepopulated, but when trying to use the values that the user puts in I can't use them in the action, nor can I pull the values from the form without again setting the values in the form. I am hoping it is that I have over looked something, but it's possible that I don't understand something as well. Here is the Action code (This is the entire execute method) : HttpSession session = request.getSession(); ProdSelectionForm prodSelection = (ProdSelectionForm) form; User user ; user = (User)session.getAttribute(User); Order order = new Order(); ArrayList products = new ArrayList(); ArrayList pageRes = new ArrayList(); ArrayList results = new ArrayList(); String action = (request.getParameter(Dest) == null ? populate : request.getParameter(Dest) ); order = user.getCurrOrder(user); if(action.equals(populate)) { prodSelection.setResults(order.getProducts()); } if(action.equals(Delete)) { ArrayList p = new ArrayList(); p = prodSelection.getResults(); int count = 0; while (count p.size()) { Product t =
RE: Indexed Properties with nested Tags
Hi Adam, Use the sample code as requested by you. You can ask me any help with nested Tags and from advanced struts JSP nested:notEmpty name=ProdSelectionForm property=results nested:iterate name=ProdSelectionForm property=results id=Result type=com.test.javabeans.TestObject tr tdnested:text name=Result property=description / /td /tr /nested:iterate /nested:notEmpty ActionForm public class ProdSelectionForm extends ActionForm { Collection arlResults=null; //can be arrayalist /** * @return Returns the arlResults. */ public Collection getResults() { return arlResults; } /** * @param arlResultsThe arlResultsto set. */ public void setResults(Collection arlResults) { this.arlResults= arlResults; } /** * * toString representation of object * @return An instance of StringBuffer with Struts Action Form properties * */ public String toString() { StringBuffer sbTemp = new StringBuffer(); sbTemp.append({); sbTemp.append(arlResults= ); sbTemp.append(arlResults); sbTemp.append(}); return sbTemp.toString(); }//end of toString }//end Actionform TestObject Java Bean import java.io.Serializable; public class TestObject implements Serializable String description =null; int numProducts =0; /** * @return Returns the description. */ public String getDescription() { return description; } /** * @param description The description to set. */ public void setDescription(String description) { this.description = description; } /** * @return Returns the numProducts. */ public int getNumProducts() { return numProducts; } /** * @param numProducts The numProducts to set. */ public void setNumProducts(int numProducts) { this.numProducts = numProducts; } }//end object Action Class (loading the page) ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form; com.test.javabeans.TestObject obj1=new com.test.javabeans.TestObject (); obj1.setDescription(desc1); obj1.setNumProducts (1); com.test.javabeans.TestObject obj2=new com.test.javabeans.TestObject (); obj1.setDescription(desc2); obj1.setNumProducts (2); ArrayList arlResults=new ArrayList (); arlResults.add(obj1); arlResults.add(obj2); prodSelectionForm.setResults(arlResults); Action Class (Submitting the page) When you submit the page just print the actionform you wouyld see the updated results of description ,numproducts in action ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form; System.out.println(prodSelectionForm=+prodSelectionForm); Regards Raghu -Original Message- From: Adam K [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 22, 2006 3:06 AM To: [EMAIL PROTECTED] Cc: Struts Users Mailing List Subject: Re: Indexed Properties If you might be able to provide a sample I would be very greatful. As it stands I have come up with the following : changing the JSP to : logic:notEmpty name=ProdSelectionForm property=results logic:iterate name=ProdSelectionForm property=results id=Result tr tdhtml:text name=Result property=description indexed=true / /td /tr /logic:iterate /logic:notEmpty Result seemed more natural as it is a single element of the results. All I want to be able to do is pull 3 things out of an object, display them in a scope of request, and allow the user to update the list and submit the form and have the changes be picked up - who would have thought that would be so incredibly complex ? *Note* The part that leads me to believe it's a misunderstanding of the tags involved is that I can get a single textfield to work perfectly, with all the requirements (other than it being an object with multiple properties). On 11/21/06, Raghuveer [EMAIL PROTECTED] wrote: hi Adam, I understand description,numProducts are properties in User defined Object/java bean in results(getResults(),setResults(..)) Collection in your actionForm. For this kind of requirments there will not be any change in actionform even though ,complixety increases in nesting.. Solution is to use Nested Tags. Nested tags are used for nesting a object inside the other. In your requirment results is a nested property in your actionform. results collection has a collection of objects. I have used Nested tags for most complex requirments and succeeded. Nested Tags is the real power of Struts... Regards Raghu -Original Message- From: Adam K [mailto:[EMAIL PROTECTED] Sent: Saturday, November 18, 2006 2:55 AM To: Struts Users Mailing List Subject: Re: Indexed Properties Thanks for the suggestion I'll keep trying things and see what I can get from it. On 11/17/06, Hubert Rabago [EMAIL PROTECTED] wrote: Lots of people have done it. Search the archives [1]. Search for indexed and lazyList. I've done it with both ActionForm
ActionForm to DAO
Can we send ActionForm as argument to a method in DAO class from Action Class. What is Best Practice ? Thanks and Regards, Raghuveer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Java mail
What jar file i need to use for implementing mailing for my struts application. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Java mail
From where can i download this. I am using jdk1.4,servlets 2.3, struts1.2.8 -Original Message- From: Dongyi Liu [mailto:[EMAIL PROTECTED] Sent: Saturday, October 14, 2006 7:43 PM To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Java mail You may need the mail.jar (java mail api) and activation.jar (java activation framework). -Original Message- From: Raghuveer [mailto:[EMAIL PROTECTED] Sent: 14 October 2006 14:26 To: user@struts.apache.org Subject: Java mail What jar file i need to use for implementing mailing for my struts application. - 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]
RE: Html:file - urgent
/*** *** * Function name : checkFile * Description : This function is to stop the user from entering a file name * Input : * Output: **/ function checkFile(fname){ fname.select(); alert( Please use the ' Browse... ' button to select the file ); } html:file property=theFile onkeydown=checkFile(this) / var filename = document.Form.theFile.value; var filename = document.smiAttachmentForm.theFile.value; var varQuizCourseCode; var onlyFileName = filename.substring(filename.lastIndexOf(\\)+1, filename.length); var onlyExtension = filename.substring(filename.lastIndexOf(.)+1, filename.length); var varExten = onlyExtension.toUpperCase(); var varFileStatus=false; if (document.smiAttachmentForm.documnetType[0].selected == true){ alert('bean:message key=msg.customer.supplied.records.document/'); document.smiAttachmentForm.documnetType.focus(); return; } if(funTrim(filename)== ){ alert('bean:message key=msg.customer.supplied.records.document.invalid.operation/'); document.smiAttachmentForm.theFile.select(); document.smiAttachmentForm.theFile.focus(); return; }else{ filename = filename.split(\\); if( (filename[filename.length-1]).length3){ alert('bean:message key=msg.customer.supplied.records.document.invalid.file/'); document.smiAttachmentForm.theFile.select(); document.smiAttachmentForm.theFile.focus(); return; }else if (isWhitespace(document.smiAttachmentForm.theFile.value)){ alert('bean:message key=msg.customer.supplied.records.document.invalid.operation/'); document.smiAttachmentForm.theFile.select(); document.smiAttachmentForm.theFile.focus(); return; // filename check is set to only 40 character to limit for renaming of file // in database its length limited to 50 characters }else if( (filename[filename.length-1]).length40){ alert('bean:message key=msg.customer.supplied.records.document.invalid.file.length/'); document.smiAttachmentForm.theFile.select(); document.smiAttachmentForm.theFile.focus(); return; } } -Original Message- From: Abhimanyu Koul [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 20, 2006 1:19 PM To: Struts Mailing list Subject: Html:file - urgent Hi! Please tell me how can i use javascript to check that the user has not selected any file in the html:file tag. Koul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Project + Logging
Since for struts framework commons-logging.jar is used How can I use Commons logging so that logs related to my application are sent to separate log file. How to configure my logger by log.properties realted to application alone. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts for locale
What precautions i need to take for my struts project to be accessed in Canada(French language) and Other Countries(English) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FormFile arrays
try nested tags for file object in jsp and array of formfile for getter and setters nested:file -Original Message- From: Jeremiah Johnson [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 13, 2006 6:23 AM To: Struts Users Mailing List Subject: Re: FormFile arrays David Grundberg wrote: You are right about the jakarta commons fileupload and struts, you can't use commons fileupload in an action, because struts have already taken care of the multi-part parsing. You do have the option to make a servlet and commons fileupload, where you will have total control of the form data. I'm not certain about your way of making the files go into an array. Is that the way to do it with for example html:text? One would expect it to work in a similar fashion. http://www.jguru.com/faq/view.jsp?EID=915898 This link suggests that you use the same name all over again for each entry, like notworkingfile, notworkingfile, and so on... I've done this with html:text and it does work. The catch is that html:file requires the property attribute to be specified. I could make a class with accessors for each FromFile. That seems convoluted.. I'm hoping for a simpler solution then that. I'll post code if I can make this work. Jeremiah Johnson skrev: I would like to upload multiple files on a single web page by having multiple html:file elements. The exact number of these are different depending on the user who is using the application. So I want to store this in an array (FormFile[]) in order to have N number of files uploaded. When I try to use html:file/ tags in an iterate loop (with indexed=true) I get an error about requiring property attribute. There's isn't a good way of doing that so I just rendered the the HTML with scriplets. It looks something like: input type=file name=workingfile/ input type=file name=notworkingfile[0]/ input type=file name=notworkingfile[1]/ input type=file name=notworkingfile[2]/ The form has getters and setters for workingfile (of type FormFile) and notworkingfile ( of type FormFile[] that is 3 elements). workingfile is assigned an instantied object however each element of notworkingfile[] is null after submit. I then attempted to use commons-fileupload-1.1.1 in a struts action (struts 1.2.9) to read the uploaded data but it does not recognize that any files are being uploaded (including workingfile). I tried this code: List items = new ServletFileUpload( new DiskFileItemFactory()).parseRequest(request); items results in an empty collection (but not null). I've read that you can not use commons-fileupload in a struts action which may be why that doesn't work. Anyone know how to have variable number of file upload boxes? I know I could have properties for each file (file1,file2,file3 and so on) instead of array but I'd rather not implement it that way. Thanks! Jeremiah - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation and Form Collections
put the actionform scope in session in your action mapping in struts-config.xml -Original Message- From: John De Lello [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 12, 2006 4:44 PM To: user@struts.apache.org Subject: Validation and Form Collections Hello Everyone, I have a question regarding validation. I have JSP that uses the Html:Options tag to populate a DDLB. The action class creates the collection and puts it in the Form. All works fine until the form validation fails. When I come back from the form validation, I am getting a Bean define cannot assign to a null value error. I know this is because the action class is never reached if validation fails, so I'm wondering how I can preserve the collection in the form in that case. Do I need to re-populate the collection in the validate method if a failure occurs? I was trying to keep all that logic in the action class only. I can't put the collection in Session because for other reasons that I don't control. Any help or suggestions would be appreciated. Thank you John - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Submitting forms with javascript in struts
for document.formname.value to be worked you need to use html:hidden name=... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 12, 2006 4:50 PM To: user@struts.apache.org Subject: Submitting forms with javascript in struts Hello, I do have a problem, because I don't know how to submit a form with javascript in struts. Normally, I'm submitting forms like this: html:form action=somepath html:submit property=myvalue value=send /html:form I'm receiving the value with the getter-method getMyvalue() of the appropriate ActionForm. This time, I want to submit the form with a a href=javascript:dosubmit(value)Some text/a dosubmit is a function like script dosubmit(what) { document.formname.value=what; document.formname.submit(); } /script The browser submits the form (I'm getting no javascript error), but I don't get the value of document.formname.value. I would be glad to get some help, kind regards, Andreas Hartmann BTW: Is there a way to send another value in the html:submit - button as this, which is displayed to the user? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
response.setContentType(text/html; charset=utf-8)
From the source examples jakarta-struts-1.1-src\jakarta-struts-1.1-src\src\upload\org\apache\struts\w ebapp\upload What does the use of response.setContentType(text/html; charset=utf-8); --- /this line is here for when the input page is upload-utf8.jsp, //it sets the correct character encoding for the response String encoding = request.getCharacterEncoding(); if ((encoding != null) (encoding.equalsIgnoreCase(utf-8))) { response.setContentType(text/html; charset=utf-8); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Upload huge file size: The page cannot be displayed browser er
have an upload file operation in the web application. The web server is OC4J. //UploadForm.jsp FORM NAME=InputForm ACTION=UploadAction.jsp METHOD=POST enctype=multipart/form-data input type=file name=fileName //etc ... /FORM After I deploy the application to the web server, if I upload a small file size, it is fine. But if i upload huge data ,data is uploading but if any action button is clicked After 30 seconds, it has error The page cannot be displayed shown on the web browser. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Upload huge file size: The page cannot be displayed browser er
I am perfectly following the below link. I have done almost 10 time the same code in different projects. It is working fine when i have upto 55 records. But if i upload 130 records ,file is uploaded succefully.But if i click any action after file upload i am getting The page cannot be displayed shown on the web browser. after processing request forever -Original Message- From: nuwan chandrasoma [mailto:[EMAIL PROTECTED] Sent: Thursday, August 31, 2006 1:15 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Upload huge file size: The page cannot be displayed browser er Hi, What is the file size?. in struts the default file size is 250MB, hope it is not bigger than this. but you can configure this read the below link. I think u shouldnt allow any button to be clicked when the file is being uploaded :). http://wiki.apache.org/struts/StrutsFileUpload Thanks, Nuwan. On 8/31/06, Raghuveer [EMAIL PROTECTED] wrote: have an upload file operation in the web application. The web server is OC4J. //UploadForm.jsp FORM NAME=InputForm ACTION=UploadAction.jsp METHOD=POST enctype=multipart/form-data input type=file name=fileName //etc ... /FORM After I deploy the application to the web server, if I upload a small file size, it is fine. But if i upload huge data ,data is uploading but if any action button is clicked After 30 seconds, it has error The page cannot be displayed shown on the web browser. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Upload huge file size: The page cannot be displayed browser er
I dont understand the problem. There is some problem after uploading more then 50 records. Our Investigation found , My Struts Actionform is not geeting updated for http request after File Upload with large data. Request is not at all going even upto actionform after uploading more then 50-60 records. Each record in my CSV file will be 12345,30245,1,07/07/2006,out,New -Original Message- From: nuwan chandrasoma [mailto:[EMAIL PROTECTED] Sent: Thursday, August 31, 2006 1:24 PM To: [EMAIL PROTECTED] Cc: Struts Users Mailing List Subject: Re: Upload huge file size: The page cannot be displayed browser er Ok, is it something to do with session timeout?, On 8/31/06, Raghuveer [EMAIL PROTECTED] wrote: I am perfectly following the below link. I have done almost 10 time the same code in different projects. It is working fine when i have upto 55 records. But if i upload 130 records ,file is uploaded succefully.But if i click any action after file upload i am getting The page cannot be displayed shown on the web browser. after processing request forever -Original Message- From: nuwan chandrasoma [mailto:[EMAIL PROTECTED] Sent: Thursday, August 31, 2006 1:15 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Upload huge file size: The page cannot be displayed browser er Hi, What is the file size?. in struts the default file size is 250MB, hope it is not bigger than this. but you can configure this read the below link. I think u shouldnt allow any button to be clicked when the file is being uploaded :). http://wiki.apache.org/struts/StrutsFileUpload Thanks, Nuwan. On 8/31/06, Raghuveer [EMAIL PROTECTED] wrote: have an upload file operation in the web application. The web server is OC4J. //UploadForm.jsp FORM NAME=InputForm ACTION=UploadAction.jsp METHOD=POST enctype=multipart/form-data input type=file name=fileName //etc ... /FORM After I deploy the application to the web server, if I upload a small file size, it is fine. But if i upload huge data ,data is uploading but if any action button is clicked After 30 seconds, it has error The page cannot be displayed shown on the web browser. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Upload huge file size: The page cannot be displayed browser er
I have found logger messages some difference FAILURE LOGS with huge data 2006-08-31 14:33:19,840~DEBUG~org.apache.struts.action.RequestProcessor~ Validating input form properties 2006-08-31 14:33:19,840~DEBUG~org.apache.struts.action.RequestProcessor~ Rolling back multipart request 2006-08-31 14:33:19,840~DEBUG~org.apache.struts.action.RequestProcessor~ Validation failed, returning to '.page.order.rfq.main' SUCCESS LOGS with few records 9,967~DEBUG~org.apache.struts.action.RequestProcessor~ Validating input form properties 2006-08-31 14:40:39,967~DEBUG~org.apache.struts.action.RequestProcessor~ No errors detected, accepting input 2006-08-31 14:40:39,967~DEBUG~org.apache.struts.action.RequestProcessor~ Looking for Action instance for class com.DispatchAction -Original Message- From: nuwan chandrasoma [mailto:[EMAIL PROTECTED] Sent: Thursday, August 31, 2006 1:24 PM To: [EMAIL PROTECTED] Cc: Struts Users Mailing List Subject: Re: Upload huge file size: The page cannot be displayed browser er Ok, is it something to do with session timeout?, On 8/31/06, Raghuveer [EMAIL PROTECTED] wrote: I am perfectly following the below link. I have done almost 10 time the same code in different projects. It is working fine when i have upto 55 records. But if i upload 130 records ,file is uploaded succefully.But if i click any action after file upload i am getting The page cannot be displayed shown on the web browser. after processing request forever -Original Message- From: nuwan chandrasoma [mailto:[EMAIL PROTECTED] Sent: Thursday, August 31, 2006 1:15 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Upload huge file size: The page cannot be displayed browser er Hi, What is the file size?. in struts the default file size is 250MB, hope it is not bigger than this. but you can configure this read the below link. I think u shouldnt allow any button to be clicked when the file is being uploaded :). http://wiki.apache.org/struts/StrutsFileUpload Thanks, Nuwan. On 8/31/06, Raghuveer [EMAIL PROTECTED] wrote: have an upload file operation in the web application. The web server is OC4J. //UploadForm.jsp FORM NAME=InputForm ACTION=UploadAction.jsp METHOD=POST enctype=multipart/form-data input type=file name=fileName //etc ... /FORM After I deploy the application to the web server, if I upload a small file size, it is fine. But if i upload huge data ,data is uploading but if any action button is clicked After 30 seconds, it has error The page cannot be displayed shown on the web browser. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with processValidate in RequestProcessor.java
I am getting Rolling back multipart request is logged after executing Multipart request. What i need to do to resolve this issue. // Special handling for multipart request if (form.getMultipartRequestHandler() != null) { if (log.isTraceEnabled()) { log.trace( Rolling back multipart request); } form.getMultipartRequestHandler().rollback(); } -- 9,967~DEBUG~org.apache.struts.action.RequestProcessor~ Validating input form properties 2006-08-31 14:40:39,967~DEBUG~org.apache.struts.action.RequestProcessor~ No errors detected, accepting input 2006-08-31 14:40:39,967~DEBUG~org.apache.struts.action.RequestProcessor~ Looking for Action instance for class com.pwc.acs.web.op.actions.DispatchAction - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
File Upload Causing page expire
I have useed struts1.2 file upload in many projects for many times.It worked well perfectly. But in my current project struts1.2.8 After uploading file ,I am showing data in jsp by nested tags. When clicked any of the action in JSP latest data is not set to ACTIONFORM. to be simple, Data is not set to actionform after file uplod. some times page is getting expired What could be the reason ? controller bufferSize=4096 maxFileSize=100K processorClass=org.apache.struts.tiles.TilesRequestProcessor / - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FormFile
What is minimum requirement for file upload configuration in struts. My ActionForm is in session scope in actionmapping. What are precautions to configuring declaritively in struts-config.xml or in action in order to avoid unwanted thread/IO stream hanging or some other problems. After file upload and submit form latest data is not getting updated to ActionForm. What could be the problem and how to resolve such issues. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multipart request
What are best practices in using Multipart request for file uploads using struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]