Struts2 spring 2.5 in portlet
Hi, I'v just started to implement a portlet application using struts2-portlet-plugin and struts2-spring plugin. To manage my objects I'm planning to use spring 2.5. My problem starts when using the scopes session and request on my spring managed beans. I get the following error despite configurating RequestContextListener in web.xml: 13:57:50,724 ERROR [jsp:52] java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request. at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:126) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143) at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113) at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275) at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365) at com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:74) at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:34) at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:415) at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.render(Jsr168Dispatcher.java:299) at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:121) at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:69) at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:96) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) Am I missing something? Doesn't the struts2-spring plugin work within a portal environment? When running in a web application it works, and when changing my beans scope to factory socpe my configuration work in the portal. Best regards Erik Mellegård
Re: [S2] Struts and blob image from Oracle
I'm sorry again. The mailing list manager does not allow attached files. But the problem is still the same. I get the image from DB, but I see binary characters and not the image. Probably I have to use some special tags but I cannot understand what. Thanks. Alessio Bandini wrote: Thanks, I'm sorry, I intend mistake, writing the modules, not error. The image is stored in an Oracle DB, not in a file system. I get the BLOB from DB, but when I try to view the image what I see is in the file attached to this mail. I see binary characters and not the image. Thanks. Gabriel Belingueres wrote: Please post the error (stack trace?). I suppose that if you want to show the image, you need some img tag in your html page result. s:action tag doesn't generate img tags for you AFAIK. 2008/8/21, Alessio Bandini [EMAIL PROTECTED]: Hello, I have a web application that must get image from blob field stored in an Oracle DB, but I cannot find how to examples. Here is my sources. Where is the error? default.jsp --- s:action name=pgetpicture executeResult=true s:param name=id value=2950 / /s:action struts.xml -- package name=pgetpicture extends=struts-default action name=pgetpicture class=pgetpicture.PGetPictureAction result name=success type=stream param name=contentTypeimage/jpeg/param param name=inputNameimg/param param name=bufferSize1024/param param name=contentDispositioninline/param /result /action /package PGetPictureAction.java -- package pgetpicture; import com.opensymphony.xwork2.ActionSupport; import maps.SqlMapConfig; import java.io.*; @SuppressWarnings(serial) public class PGetPictureAction extends ActionSupport { private Integer id; private PGetPicture imgobj; public String execute() throws Exception { imgobj = (PGetPicture)SqlMapConfig.getSqlMapIstance().queryForObject (getpromopicture, getId()); return SUCCESS; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public InputStream getImg() { return imgobj.getImg(); } } PGetPicture.java package pgetpicture; import java.sql.SQLException; import com.ibatis.sqlmap.client.SqlMapClient; import java.util.*; import java.io.*; public class PGetPicture { private byte[] img; public void PGetPicture(){ //super(): } public InputStream getImg() { InputStream is = new ByteArrayInputStream(img); return is; } public void setImg(byte[] img) { this.img = img; } } PGetPicture.xml --- ?xml version=1.0 encoding=UTF-8? !DOCTYPE sqlMap PUBLIC -//iBATIS.com//DTD SQL Map 2.0//EN http://www.ibatis.com/dtd/sql-map-2.dtd; sqlMap namespace=pgetpicture typeAlias alias=picture type=pgetpicture.PGetPicture/ resultMap id=picture-map class=picture result property=img column=img jdbcType=BLOB / /resultMap select id=getpromopicture resultMap=picture-map SELECT b_imgbkg as img FROM table_name WHERE i_id = #id# /select /sqlMap Please, help me. - 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] __ Informazione NOD32 3375 (20080821) __ Questo messaggio è stato controllato dal Sistema Antivirus NOD32 http://www.nod32.it -- Alessio Bandini Database Manager CHL S.p.A. 055-50517.222 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Struts and blob image from Oracle
Your configuration is okay but you have misused the action tag. You can't embed an inline image within an HTML page. ie. you've started sending a result, which is from JSP, and then part-way though you've attempted to output some binary data in the same output stream. You do not need special tags. As Gabriel suggested, you simple need an image tag. default.jsp: pThe image follows/p img src=pgetpicture.action alt=generated image/ That means there's first an HTML stream (from the JSP), then separately browser opens the image stream from your action. Hope that makes sense. Jeromy Evans Alessio Bandini wrote: I'm sorry again. The mailing list manager does not allow attached files. But the problem is still the same. I get the image from DB, but I see binary characters and not the image. Probably I have to use some special tags but I cannot understand what. Thanks. Alessio Bandini wrote: Thanks, I'm sorry, I intend mistake, writing the modules, not error. The image is stored in an Oracle DB, not in a file system. I get the BLOB from DB, but when I try to view the image what I see is in the file attached to this mail. I see binary characters and not the image. Thanks. Gabriel Belingueres wrote: Please post the error (stack trace?). I suppose that if you want to show the image, you need some img tag in your html page result. s:action tag doesn't generate img tags for you AFAIK. 2008/8/21, Alessio Bandini [EMAIL PROTECTED]: Hello, I have a web application that must get image from blob field stored in an Oracle DB, but I cannot find how to examples. Here is my sources. Where is the error? default.jsp --- s:action name=pgetpicture executeResult=true s:param name=id value=2950 / /s:action struts.xml -- package name=pgetpicture extends=struts-default action name=pgetpicture class=pgetpicture.PGetPictureAction result name=success type=stream param name=contentTypeimage/jpeg/param param name=inputNameimg/param param name=bufferSize1024/param param name=contentDispositioninline/param /result /action /package PGetPictureAction.java -- package pgetpicture; import com.opensymphony.xwork2.ActionSupport; import maps.SqlMapConfig; import java.io.*; @SuppressWarnings(serial) public class PGetPictureAction extends ActionSupport { private Integer id; private PGetPicture imgobj; public String execute() throws Exception { imgobj = (PGetPicture)SqlMapConfig.getSqlMapIstance().queryForObject (getpromopicture, getId()); return SUCCESS; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public InputStream getImg() { return imgobj.getImg(); } } PGetPicture.java package pgetpicture; import java.sql.SQLException; import com.ibatis.sqlmap.client.SqlMapClient; import java.util.*; import java.io.*; public class PGetPicture { private byte[] img; public void PGetPicture(){ //super(): } public InputStream getImg() { InputStream is = new ByteArrayInputStream(img); return is; } public void setImg(byte[] img) { this.img = img; } } PGetPicture.xml --- ?xml version=1.0 encoding=UTF-8? !DOCTYPE sqlMap PUBLIC -//iBATIS.com//DTD SQL Map 2.0//EN http://www.ibatis.com/dtd/sql-map-2.dtd; sqlMap namespace=pgetpicture typeAlias alias=picture type=pgetpicture.PGetPicture/ resultMap id=picture-map class=picture result property=img column=img jdbcType=BLOB / /resultMap select id=getpromopicture resultMap=picture-map SELECT b_imgbkg as img FROM table_name WHERE i_id = #id# /select /sqlMap Please, help me. - 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] __ Informazione NOD32 3375 (20080821) __ Questo messaggio è stato controllato dal Sistema Antivirus NOD32 http://www.nod32.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 spring 2.5 in portlet
If it should work with a regular portlet, then it should also work with the Struts 2 portlet plugin. There's nothing special happening inside the framework that should prevent this. You'd probably be better off asking the question on a Spring or a Liferay mailing list. Maybe this [1] thread is relevant? Nils-H [1] - http://www.liferay.com/web/guest/community/forums?p_p_id=19p_p_lifecycle=0p_p_state=normalp_p_mode=view_19_struts_action=%2Fmessage_boards%2Fview_message_19_messageId=347191 On Fri, Aug 22, 2008 at 8:53 AM, Erik Mellegård [EMAIL PROTECTED] wrote: Hi, I'v just started to implement a portlet application using struts2-portlet-plugin and struts2-spring plugin. To manage my objects I'm planning to use spring 2.5. My problem starts when using the scopes session and request on my spring managed beans. I get the following error despite configurating RequestContextListener in web.xml: 13:57:50,724 ERROR [jsp:52] java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request. at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:126) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143) at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113) at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275) at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365) at com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:74) at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:34) at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.serviceAction(Jsr168Dispatcher.java:415) at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.render(Jsr168Dispatcher.java:299) at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:121) at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:69) at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:96) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) Am I missing something? Doesn't the struts2-spring plugin work within a portal environment? When running in a web application it works, and when changing my beans scope to factory socpe my configuration work in the portal. Best regards Erik Mellegård - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Struts and blob image from Oracle
Thanks a lot. It works. :) Jeromy Evans wrote: Your configuration is okay but you have misused the action tag. You can't embed an inline image within an HTML page. ie. you've started sending a result, which is from JSP, and then part-way though you've attempted to output some binary data in the same output stream. You do not need special tags. As Gabriel suggested, you simple need an image tag. default.jsp: pThe image follows/p img src=pgetpicture.action alt=generated image/ That means there's first an HTML stream (from the JSP), then separately browser opens the image stream from your action. Hope that makes sense. Jeromy Evans Alessio Bandini wrote: I'm sorry again. The mailing list manager does not allow attached files. But the problem is still the same. I get the image from DB, but I see binary characters and not the image. Probably I have to use some special tags but I cannot understand what. Thanks. Alessio Bandini wrote: Thanks, I'm sorry, I intend mistake, writing the modules, not error. The image is stored in an Oracle DB, not in a file system. I get the BLOB from DB, but when I try to view the image what I see is in the file attached to this mail. I see binary characters and not the image. Thanks. Gabriel Belingueres wrote: Please post the error (stack trace?). I suppose that if you want to show the image, you need some img tag in your html page result. s:action tag doesn't generate img tags for you AFAIK. 2008/8/21, Alessio Bandini [EMAIL PROTECTED]: Hello, I have a web application that must get image from blob field stored in an Oracle DB, but I cannot find how to examples. Here is my sources. Where is the error? default.jsp --- s:action name=pgetpicture executeResult=true s:param name=id value=2950 / /s:action struts.xml -- package name=pgetpicture extends=struts-default action name=pgetpicture class=pgetpicture.PGetPictureAction result name=success type=stream param name=contentTypeimage/jpeg/param param name=inputNameimg/param param name=bufferSize1024/param param name=contentDispositioninline/param /result /action /package PGetPictureAction.java -- package pgetpicture; import com.opensymphony.xwork2.ActionSupport; import maps.SqlMapConfig; import java.io.*; @SuppressWarnings(serial) public class PGetPictureAction extends ActionSupport { private Integer id; private PGetPicture imgobj; public String execute() throws Exception { imgobj = (PGetPicture)SqlMapConfig.getSqlMapIstance().queryForObject (getpromopicture, getId()); return SUCCESS; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public InputStream getImg() { return imgobj.getImg(); } } PGetPicture.java package pgetpicture; import java.sql.SQLException; import com.ibatis.sqlmap.client.SqlMapClient; import java.util.*; import java.io.*; public class PGetPicture { private byte[] img; public void PGetPicture(){ //super(): } public InputStream getImg() { InputStream is = new ByteArrayInputStream(img); return is; } public void setImg(byte[] img) { this.img = img; } } PGetPicture.xml --- ?xml version=1.0 encoding=UTF-8? !DOCTYPE sqlMap PUBLIC -//iBATIS.com//DTD SQL Map 2.0//EN http://www.ibatis.com/dtd/sql-map-2.dtd; sqlMap namespace=pgetpicture typeAlias alias=picture type=pgetpicture.PGetPicture/ resultMap id=picture-map class=picture result property=img column=img jdbcType=BLOB / /resultMap select id=getpromopicture resultMap=picture-map SELECT b_imgbkg as img FROM table_name WHERE i_id = #id# /select /sqlMap Please, help me. - 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] __ Informazione NOD32 3375 (20080821) __ Questo messaggio è stato controllato dal Sistema Antivirus NOD32 http://www.nod32.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Informazione NOD32 3378 (20080822) __ Questo messaggio è stato controllato dal Sistema Antivirus NOD32 http://www.nod32.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: [S2] Iterate through two lists
If all you're trying to do is set message properties why are you bothering with the push? s:iterator value=fruits1 status=rowstatus s:text name=names s:param value=someObject.fruits2[#rowstatus.index].name/ /s:text /s:iterator Looks good (if fruit1 is accessable bei a getter in the action class). Does it work for you? s:text name=names s:push value=someObject.fruits2[#rowstatus.index] s:param name=value value=name/ /s:push /s:text I'm not sure why the push tag is causing the issue, though. Maybe the param tag tries to bind with the push tag and not with the text tag??? /Stephan -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.1 Tree Problem
Hi, Issue is solved and migration is successful with respect to tree control, i found solution in code pencil blog. Have a nice time. On Thu, Aug 21, 2008 at 6:44 PM, Narayana S [EMAIL PROTECTED] wrote: Hi, i was using struts 2.0.11 and we know tree control is having some issues in that version, so i want to migrate to struts 2.1. for that i removed struts 2.0.11 jars and replaced them with 2.1 version files, and also copied struts-dojo-plugin-2.1.2.jar. still i couldn't trace the tree node select event. some example i tried on struts-blank-2.1.2 it is working and recognizing events and responding. am i missing any imp step in migration, is that replacing jar files is not enough for migration? Please help me...
Re: [S2] Iterate through two lists
--- On Fri, 8/22/08, Stephan Schröder [EMAIL PROTECTED] wrote: Maybe the param tag tries to bind with the push tag and not with the text tag??? Oh, that makes sense, although it'd probably be better to not throw a huge exception :/ Hopefully I'll have time to look in to that soon. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts-hibernate-mysql date problem
hi i am using hibernate 3 with s2 my problem is that im mysql table i have field of date type so i have set type date in hb mapping.xml and in pojo(if i am set as string in pojo and mapping file it gives error ) now i have to set date in input as format mm/dd/yy so mysql accepts it automatically and convert in its foramt type(YY-dd-mm) otherwise it return to input result but i want to show it as dd/mm/yy ,what i have to do for this any convertor of s2 apply or what? please help to solve this problem - Java/J2EE developer India blogs http://hardik4u.wordpress.com wordpress blog -- View this message in context: http://www.nabble.com/struts-hibernate-mysql-date-problem-tp19104863p19104863.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts-hibernate-mysql date problem
quick and dirty solution: i know that this works if you use hibernate with annotations so i'm certain that there is a possibility to do it with xml. With annotations you can declare whether the data is extracted directly from the property or indirectly over the getter-method of the property. Make hibernate get the value directly from the property which uses the mm/dd/yy format. Define the getter-method and setter-to format in and out of dd/mm/yy. Because Struts 2 always uses the getter-setter you alway have the right format. class DomainModelObject { //format = mm/dd/yy private String date; public String getDate() { formatToDDMMYY( date ); } public void setDate( String ddmmyyDate ) { date = formatToMMDDYY( ddmmyyDate ); } } cleaner solution: I'm certain there is a better way to do this because the i18n-part of Struts 2 allows you to format the date differently depending on the locale of the date. Therefore you should save the date in the format hibernate wants and use DateFormat to format the Date for the view layer. Maybe you find something here: http://struts.apache.org/2.0.11.2/docs/formatting-dates-and-numbers.html /Stephan Original-Nachricht Datum: Fri, 22 Aug 2008 03:31:30 -0700 (PDT) Von: Hardik Shah [EMAIL PROTECTED] An: user@struts.apache.org Betreff: struts-hibernate-mysql date problem hi i am using hibernate 3 with s2 my problem is that im mysql table i have field of date type so i have set type date in hb mapping.xml and in pojo(if i am set as string in pojo and mapping file it gives error ) now i have to set date in input as format mm/dd/yy so mysql accepts it automatically and convert in its foramt type(YY-dd-mm) otherwise it return to input result but i want to show it as dd/mm/yy ,what i have to do for this any convertor of s2 apply or what? please help to solve this problem - Java/J2EE developer India blogs http://hardik4u.wordpress.com wordpress blog -- View this message in context: http://www.nabble.com/struts-hibernate-mysql-date-problem-tp19104863p19104863.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to use Jasper plugin with multiple reports
Hi all, Currently I m working with Jasper Reports for one of report. And for that report after all the data, a full page of static text is to be placed at the end of the report (in my case 2nd page). But in Jasper report, we can have only one page per report and so I m nit able to add a full page static text. When I googled for this, I found this can be implemented using 2 or more jasper reports and merging them as a single final report. Can any one tell me how to merge two jasper reports usign S2 Jasper plugin? Thanks in advance, Regards, ManiKanta G ** DISCLAIMER ** Information contained and transmitted by this E-MAIL is proprietary to Sify Limited and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this E-MAIL may not have been sent with the authority of the Company. If you are not the intended recipient, an agent of the intended recipient or a person responsible for delivering the information to the named recipient, you are notified that any use, distribution, transmission, printing, copying or dissemination of this information in any way or in any manner is strictly prohibited. If you have received this communication in error, please delete this mail notify us immediately at [EMAIL PROTECTED]
RE: struts-hibernate-mysql date problem
Hi friend Hope this helps you. String yourDate=date in mm/dd/ format (example: 08/22/2008) DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT); ParsePosition pos = new ParsePosition (0); java.sql.Date wantedDate = new java.sql.Date(df.parse(yourDate,pos).getTime()); wantedDate is the variable of Date type. Example usage: In prepared statement: PreparedStatement ps=null; preparedStatement = con.prepareStatement(insert into table(date) values(?)); ps.setDate(1,wantedDate); ps.executeQuery(); and import the necessary.(DateFormat and ParsePosition) Regards Nataraj Tata Consultancy Services No- 9985834848 -Original Message- From: Hardik Shah [mailto:[EMAIL PROTECTED] Sent: Friday, August 22, 2008 4:02 PM To: user@struts.apache.org Subject: struts-hibernate-mysql date problem hi i am using hibernate 3 with s2 my problem is that im mysql table i have field of date type so i have set type date in hb mapping.xml and in pojo(if i am set as string in pojo and mapping file it gives error ) now i have to set date in input as format mm/dd/yy so mysql accepts it automatically and convert in its foramt type(YY-dd-mm) otherwise it return to input result but i want to show it as dd/mm/yy ,what i have to do for this any convertor of s2 apply or what? please help to solve this problem - Java/J2EE developer India blogs http://hardik4u.wordpress.com wordpress blog -- View this message in context: http://www.nabble.com/struts-hibernate-mysql-date-problem-tp19104863p191 04863.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] == i-choose online store at www.tataindicom.com Your Comfort.Your Convenience.YourChoice. == DISCLAIMER: The information contained in this message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and permanently delete this message and any attachments from your system. Any dissemination, use, review, distribution, printing or copying of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change.TATATELESERVICES LTD. (including its group companies) shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. TATA TELESERVICES LTD. (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference. == i-choose online store at www.tataindicom.com Your Comfort.Your Convenience.YourChoice. == DISCLAIMER: The information contained in this message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and permanently delete this message and any attachments from your system. Any dissemination, use, review, distribution, printing or copying of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change.TATATELESERVICES LTD. (including its group companies) shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. TATA TELESERVICES LTD. (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference.
Re: How to use Jasper plugin with multiple reports
--- On Fri, 8/22/08, ManiKanta G wrote: But in Jasper report, we can have only one page per report and so I m nit able to add a full page static text. When I googled for this, I found this can be implemented using 2 or more jasper reports and merging them as a single final report. Can any one tell me how to merge two jasper reports usign S2 Jasper plugin? You'd need to merge them in JR somehow, or define the report in such a way that the extra text will split over pages etc. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] problem setting parameter
On Thu, Aug 21, 2008 at 7:40 PM, Andrei Ivanov [EMAIL PROTECTED] wrote: Hello, I'm having a difficult problem for which I hope someone here can help me.. The short story: the parameters interceptor is unable to set a parameter. These are the classes involved: package model; public class Language extends org.apache.commons.lang.enums.Enum { protected Language(String name) { super(name); } } public interface IPreference { public T extends model.Language T getLanguage(); } package project.model; public class Language extends model.Language { public static final Language ENGLISH = new Language(en); public static final Language RUSSIAN = new Language(ru); } public class Preference implements IPreference { public project.model.Language getLanguage() { return language; } public void setLanguage(project.model.Language language) { this.language = language; } } The choice of this hierarchy is to allow to have the first 2 classes in separate, generic and reusable bundle and the next 2 classes specific to a project. In the interface I'm using T extends model.Language T in the interface to avoid the need to cast the result of the method to a specific implementation and let the compiler use type inference to do it for me(and I think this is were the root of the problem is). I'm trying to use Preference inside an action and allow a user to choose the preferred language by sending a form parameter: preference.language The custom converter does it's job and converts 'en' to project.model.Language.ENGLISH The problem is that the parameters interceptor, through ognl, cannot find the setter for the type project.model.Language I've looked at the ognl sources and found that it is using introspection to find the properties of Preference. The introspector, trying to create a list of the properties, obtains a list of all methods of the class that respect the JavaBeans spec. The problem is that the compiler generates a second method inside Preference: public volatile model.Language getLanguage() { return getLanguage(); } The introspector sees first the method written by me in the source and then the generated method, which overrides my method. After that, it find the setter, but the setter doesn't match the type returned by this second getter, so it ignores it. Now ognl will throw an exception saying it cannot set the value on a private field, because it doesn't find the setter. I've tried adding a second setter for the base Language class, and introspection finds it but now the converter isn't working because it cannot work with the base Language class. I've tried creating a PreferenceBeanInfo class, but it doesn't seem right to *manually* create a list of property descriptors that can get of of sync when Preference changes. Any ideas on how to resolve this problem? I know this is really an ognl problem, but ognl seems abandoned... Just for the record, ognl 2.7.3-snapshot seems to work fine with this. I hope the ognl devs will find the time to make a release. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OGNL
Hi friends, How to understand the OGNL. I am working with it, most of the time I guess the things but I want to know how exactly the OGNL works. What is value stack? What is root and exactly how to write OGNL? Apart of the doc that is there on struts site, is there any good tutorial for OGNL so that I don't need to guess when writing OGNL when writing jsp pages using struts? I am really confused? Sometimes we use %{} notation, sometimes we use ${} notation? Which is OGNL? I am really confused? Kindly help me in this. Warm regards, Muralidhar Y [EMAIL PROTECTED] US Main: 877 KENSIUM (536.7486) India Main: +91 9949495511 India Fax: +91 9949495522 Kensium 200 S Wacker Dr, Suite 3100 Chicago, IL 60606 Confidentiality Note: - The information contained in this e-mail is strictly confidential and for the intended use of the addressee only. Any disclosure, use or copying of the information by anyone other than the intended recipient is prohibited. If you have received this message in error, please notify the sender immediately by return e-mail and securely discard this message. _
Re: OGNL
--- On Fri, 8/22/08, Muralidhar Y wrote: What is value stack? The value stack is both a stack (where the current action is pushed, the object of an iterator tag is pushed (on top of the action), etc. It's also a context, though--it stores some named objects (like #session and #attr) by default, and we can add our own (most easily via tags like s:set..., s:url... etc.) exactly how to write OGNL? The OGNL home [1] has a link to a user manual. Sometimes we use %{} notation, sometimes we use ${} notation? The only time you ever use ${} notation for OGNL is in configuration, both XML and annotations. That's a wart; it's unfortunate that it uses a different escape sequence there (and actually messes me up a little bit as I'm fond of code generation and used ${} a lot :/ In things like JSP pages ${} is plain old JSP EL notation. Dave [1] OGNL home: http://www.ognl.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use Jasper plugin with multiple reports
Thanks Dave. I've included a page break just before the static text. But as the static text is almost an another page, it is going out of page dimensions and I m not able to compile the report. For another report, the end text is small and I m getting according to my wish. For large static text, if adjusted with in page boundaries, the text is being cropped and is displaying only some portion. Isn't possible to include two .jasper's in location param, like comma separated or by some other means? Regards, ManiKanta Dave Newton wrote: --- On Fri, 8/22/08, ManiKanta G wrote: But in Jasper report, we can have only one page per report and so I m nit able to add a full page static text. When I googled for this, I found this can be implemented using 2 or more jasper reports and merging them as a single final report. Can any one tell me how to merge two jasper reports usign S2 Jasper plugin? You'd need to merge them in JR somehow, or define the report in such a way that the extra text will split over pages etc. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** DISCLAIMER ** Information contained and transmitted by this E-MAIL is proprietary to Sify Limited and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this E-MAIL may not have been sent with the authority of the Company. If you are not the intended recipient, an agent of the intended recipient or a person responsible for delivering the information to the named recipient, you are notified that any use, distribution, transmission, printing, copying or dissemination of this information in any way or in any manner is strictly prohibited. If you have received this communication in error, please delete this mail notify us immediately at [EMAIL PROTECTED]
[OT] Re: How to use Jasper plugin with multiple reports
--- On Fri, 8/22/08, ManiKanta G wrote: I've included a page break just before the static text. But as the static text is almost an another page, it is going out of page dimensions and I m not able to compile the report. Please see the JasperReport docs for how to deal with that. Workarounds include making the field very small but making it expand to size of largest element and so on. Isn't possible to include two .jasper's in location param, like comma separated or by some other means? No. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: How to use Jasper plugin with multiple reports
Thanks Dave. I'll see that. Regards, ManiKanta Dave Newton wrote: --- On Fri, 8/22/08, ManiKanta G wrote: Please see the JasperReport docs for how to deal with that. Workarounds include making the field very small but making it expand to size of largest element and so on. Dave ** DISCLAIMER ** Information contained and transmitted by this E-MAIL is proprietary to Sify Limited and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this E-MAIL may not have been sent with the authority of the Company. If you are not the intended recipient, an agent of the intended recipient or a person responsible for delivering the information to the named recipient, you are notified that any use, distribution, transmission, printing, copying or dissemination of this information in any way or in any manner is strictly prohibited. If you have received this communication in error, please delete this mail notify us immediately at [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
s:if comparing a string
Hello, in m'y jsp i'm trying to compare a String link this s:if test=#session.request._status != 'T' but is not working, does anybody knows the sintaxis? Thanks -- View this message in context: http://www.nabble.com/s%3Aif-comparing-a-string-tp19106286p19106286.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:if comparing a string
What are you trying to compare with? A value in the session, or a value in the request? Or do you actually have an object named request with a _status property in the session? Maybe these resources can help: http://struts.apache.org/2.x/docs/tag-syntax.html http://struts.apache.org/2.x/docs/ognl.html Nils-H On Fri, Aug 22, 2008 at 2:33 PM, piltrafeta [EMAIL PROTECTED] wrote: Hello, in m'y jsp i'm trying to compare a String link this s:if test=#session.request._status != 'T' but is not working, does anybody knows the sintaxis? Thanks -- View this message in context: http://www.nabble.com/s%3Aif-comparing-a-string-tp19106286p19106286.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:if comparing a string
--- On Fri, 8/22/08, piltrafeta wrote: in m'y jsp i'm trying to compare a String link this s:if test=#session.request._status != 'T' s:if test='#session.request._status != T ' Using single quotes around a single character will create a char, not a string, like in Java. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: if comparing a string
Where is your _status property? Is it in session or request or as a property in your action class? And what is the data type of your _status field? If it is in your session the below one will work s:if test=#session._status != 'T' If it is in your action class as property having getter and setter, the below one will work s:if test=%{_status != 'T'} All the best. -Original Message- From: piltrafeta [mailto:[EMAIL PROTECTED] Sent: Friday, August 22, 2008 6:04 PM To: user@struts.apache.org Subject: s:if comparing a string Hello, in m'y jsp i'm trying to compare a String link this s:if test=#session.request._status != 'T' but is not working, does anybody knows the sintaxis? Thanks -- View this message in context: http://www.nabble.com/s%3Aif-comparing-a-string-tp19106286p19106286.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OGNL
Here are the language and developer guides: http://www.opensymphony.com/ognl/ I'm pretty sure that neither %{} nor ${} are actually part of OGNL. %{} is a marker for struts2 that the content should be evaluated as OGNL-Statement and not as String while ${} is the marker for freemarker, which is used in Struts2 to generate html from tags, that the content should be evaluated with a customized data model which wraps the value stack. The ValueStack isn't part of OGNL either. It's just a class with the special behavior regarding to OGNL. Normally OGNL walks the object path like this: Map m = new Map(); m.put( model,new DomainModel() ); //DomainModel has the Property id; OGNL can now retrieve the ID with m['model'].id The Value Stack now hides the fact that it's not the value stack that has a property but object that was given to it. ValueStack v = new ValueStack(); v.push( new DomainModel() ); this is why OGNL can now ask v.id (and not v.top.id) as if the ID was a property of the stack. Because the Actionclass-Instance is added to the ValueStack automatically and every expression is evaluated against the value stack you can write id and retrieve the getId()-property of the action. The action is the root of the context map wich uses OGNL as a starting point therefore you don't need the '#'-before the name of the variable. Normally when looking for a property on the value stack the first occurence of it (starting at the top of the stack) is returned. But some tags (eg. property) only evaluate 'top' which is the last element that was pushed on the Value Stack (which is the action instance itself at the start of the evaluation of you JSP/Freemarker/Velocity page). /Stephan Original-Nachricht Datum: Fri, 22 Aug 2008 17:32:34 +0530 Von: Muralidhar Y [EMAIL PROTECTED] An: \'Struts Users Mailing List\' user@struts.apache.org Betreff: OGNL Hi friends, How to understand the OGNL. I am working with it, most of the time I guess the things but I want to know how exactly the OGNL works. What is value stack? What is root and exactly how to write OGNL? Apart of the doc that is there on struts site, is there any good tutorial for OGNL so that I don't need to guess when writing OGNL when writing jsp pages using struts? I am really confused? Sometimes we use %{} notation, sometimes we use ${} notation? Which is OGNL? I am really confused? Kindly help me in this. Warm regards, Muralidhar Y [EMAIL PROTECTED] US Main: 877 KENSIUM (536.7486) India Main: +91 9949495511 India Fax: +91 9949495522 Kensium 200 S Wacker Dr, Suite 3100 Chicago, IL 60606 Confidentiality Note: - The information contained in this e-mail is strictly confidential and for the intended use of the addressee only. Any disclosure, use or copying of the information by anyone other than the intended recipient is prohibited. If you have received this message in error, please notify the sender immediately by return e-mail and securely discard this message. _ -- GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion! http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:if comparing a string
Thanks you all guys ! I was trying to compare a String so using single cuotes solved my problem. s:if test='#session.request._status != T ' Thanks again!!! piltrafeta wrote: Hello, in m'y jsp i'm trying to compare a String link this s:if test=#session.request._status != 'T' but is not working, does anybody knows the sintaxis? Thanks -- View this message in context: http://www.nabble.com/s%3Aif-comparing-a-string-tp19106286p19107093.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 spring 2.5 in portlet
I would start with http://weblogs.java.net/blog/felipeal/archive/2008/03/spring_icefaces.html http://weblogs.java.net/blog/felipeal/archive/2008/03/spring_icefaces.html -- View this message in context: http://www.nabble.com/Struts2---spring-2.5-in-portlet-tp19102346p19107333.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0.11 from 2.0.9 EL Expression problem
try using neither ${} nor %{}: listKey='listKey' listValue='listValue' 2008/8/22, crappycrumpet [EMAIL PROTECTED]: Hi All, I know EL Expression has been disabled from 2.0.10 on. Unfortunately I have some jsp has uses EL. I have this jsp files that renders a generic dropdown box that looks like the following. s:select name=%{fieldName} list='list' listKey='${listKey}' listValue='${listValue}' multiple='true' size='8' required=%{required} / So the action that uses this would have a list of objects and a listKey field that contains a string saying for example id and a listValue string saying for example name and the select drop would be shown with the list of object's id and it's name value for display. This however no longer works after updating to 2.0.11.2. Substituting ${} with %{} only end it putting the literal value (e.g. id and name) in the drop down box's value and display value. Any idea how I can work around this? Cheers. -- View this message in context: http://www.nabble.com/Struts-2.0.11-from-2.0.9-EL-Expression-problem-tp19100876p19100876.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 And JFreeChart
No Milan Milanovic wrote: Hi, do I need to have this p (String type) parameter in my action class ? -- Thx, Milan dynamicd wrote: its some parameter name (the name does not matter) and RANDOM is set in the controller (Action) or to make it easy img src=/Dashboard/DisplayChart.action?p=%=request.hashCode()% / instead of passing DisplayChart.action each time. it is passed in as a different url everytime and so it will display the new image other wise if the url is the same then you will get displayed the cached image. Milan Milanovic wrote: I don't understand this solution, what is p parameter, and whait is RANDOM ? -- Regards, Milan dynamicd wrote: got it to work.. could not stop the caching so added a param to the src img src=/Dashboard/DisplayChart.action?p=%=request.getParameter(RANDOM)% / dynamicd wrote: I have tried % response.setHeader(Cache-Control, no-cache); //HTTP 1.1 response.setHeader(Pragma, no-cache); //HTTP 1.0 response.setDateHeader(Expires, 0); //prevents caching at the proxy server % as well.. newton.dave wrote: --- On Wed, 8/6/08, dynamicd [EMAIL PROTECTED] wrote: Also tried implementing the SessionAware. However the same thing. Why? Did you try setting the headers for not caching? Dave dynamicd wrote: This is cool.. I tried it out. However once the chart_display.jsp is called the first time through the image tag. it does not call the DisplayChart.action again to refresh the image with a new one when clicked on the DrawChart.action. (I added the println statement in the display method to find out that the div is not refreshing) I have to log out and log in (invalidate session) to get the new chart. I am missing something public String display() throws Exception { System.out.println(I AM IN THE DISPLAY NOW ); Map attributes = ActionContext.getContext().getSession(); this.chart = (JFreeChart) attributes.get(CHART); if(chart == null) { return Constants.FORWARD_INVALIDACTION; } return Constants.FORWARD_SUCCESS; } private void setChart(JFreeChart chart){ Map attributes = ActionContext.getContext().getSession(); attributes.put(CHART, null); this.chart = chart; attributes.put(CHART, this.chart); } public JFreeChart getChart() { return chart; } Leena Borle wrote: Hello, See if this helps you. I have a form with remote DIV which displays chart after user clicks on submit. Trick here is to generate chart object, store it in session and display it in separate JSP. Remove the form part if you want to display just the dynamic-DIV using Chart image. Form.jsp [ s:form s:url id=display_chart value=DrawChart_draw.action namespace=/user / s:submit value=Draw chart href=%{display_chart} theme=ajax targets=*chart_div* / br / /s:form h4Your Running Chart/h4 div id=*chart_div* /div!-- End display chart -- /div ] display_chart.jsp [ body /MyApp/user/DrawChart_display.action /body ] struts.xml[ package name=user extends =struts-default,jfreechart-default !-- Separate method to draw and display due to Remote DIV/Button tag contsraints. -- action name=DrawChart_input method=input class=.xxx.DrawChart result name=inputform.jsp /result /action action name=DrawChart_draw method=draw class=xxx..DrawChart result name=success/jsp/display_chart.jsp /result /action action name=DrawChart_display method=display class=xxx.DrawChart result name=success type=chart 400 300 /result /action /package ] DrawChart.java [ JFreeChart chart; public String draw() throws Exception { //chart creation logic. //generate chart object chart = session = session.put(CHART, chart); return success; } /** * returns chart obejct from the session. This methos is used by display_chart.jsp */ public String display() throws Exception { session = ...get session ... this.chart = (JFreeChart) session.get(CHART); if(chart == null) { addActionError(getText(error.nochart));
html:checkboxu tag and his jsId atribute
Help please I cannot find description of html:checkbox tag? What does it mean his atribute jsId? -- View this message in context: http://www.nabble.com/html%3Acheckboxu-tag-and-his-jsId-atribute-tp19108102p19108102.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:checkboxu tag and his jsId atribute
--- On Fri, 8/22/08, aleoson wrote: I cannot find description of html:checkbox tag? The Struts 1 tag? Did you try looking on the Struts website? What does it mean his atribute jsId? Sounds like Dojo, I think they use jsId, but could be anything, I suppose, with nothing to go on. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:checkboxu tag and his jsId atribute
Yes, I searched there. But I cannot find any information about such tag. I'd like to use html:checkbox tag. But I want to have possibility to refer bu id to it. And I don't see id attribute among attributes of html:checkbox tag http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#html:checkbox How can I do this? newton.dave wrote: --- On Fri, 8/22/08, aleoson wrote: I cannot find description of html:checkbox tag? The Struts 1 tag? Did you try looking on the Struts website? What does it mean his atribute jsId? Sounds like Dojo, I think they use jsId, but could be anything, I suppose, with nothing to go on. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/html%3Acheckboxu-tag-and-his-jsId-atribute-tp19108102p19108772.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:checkboxu tag and his jsId atribute
--- On Fri, 8/22/08, aleoson wrote: Yes, I searched there. But I cannot find any information about such tag. But... you just gave a link for it. And I don't see id attribute among attributes of html:checkbox tag http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#html:checkbox How can I do this? Reading the styleId attribute documentation reveals: Identifier to be assigned to this HTML element (renders an id attribute). Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2 Ajax validation actionErrors
Hello To put it straight: do I understand it right that S2 AJAX validation doesn't take care of action errors, only the field ones? So that action errors are displayed only on submit. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2 Ajax validation actionErrors
[2.1] No, it also serializes action errors: http://struts.apache.org/2.x/docs/ajax-validation.html musachy On Fri, Aug 22, 2008 at 11:32 AM, Oleg Mikheev [EMAIL PROTECTED] wrote: Hello To put it straight: do I understand it right that S2 AJAX validation doesn't take care of action errors, only the field ones? So that action errors are displayed only on submit. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2 Ajax validation actionErrors
I think I misunderstood your question, it does serializes the action errors, but it doesn't show them on the page for you. On Fri, Aug 22, 2008 at 11:32 AM, Oleg Mikheev [EMAIL PROTECTED] wrote: Hello To put it straight: do I understand it right that S2 AJAX validation doesn't take care of action errors, only the field ones? So that action errors are displayed only on submit. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why do s:select and s:submit add a tr ?
Hi again! I'm still struggling with the theme. See below.. I don't even know if I've put the theme in the right place in the NetBeans (5.5.1) structure. Is there a way to check that? Where did you put it? Did you read the template loading page? http://struts.apache.org/2.x/docs/template-loading.html? Yes, I read that but I'm afraid that Templates ae loaded first by searching the application and then by searching the classpath is not helping me since I haven't been able to figure out exactly what the classpath of NetBeans is. I've tried putting the template files in different places and changing the value of the property struts.ui.templateDir according to that.. But then I decided to download the code that belonged to the theme tutorial at: http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme (which I mentionend earlier) ..and to do as much as possible like they had done. About the location of the files, they had put it in /WEB-INF/classes/template, so I did that to and changed the value of the struts property to: /WEB-INF/classes/template I think that location is ok since I tried a different location once (right under /WEB-INF) and then actually got an exception, saying that the files of this theme couldn't be found, but now I don't get that exception. I also compared my controlheader-core.ftl, controlfooter.ftl, the newly created controlheader-trlogic.ftl and controlfooter-trlogic to the downloaded equivalents and found that I needed to add some stuff (like an #include in controlheader-core that includes controlheader-trlogic, which I actually had thought that I might need) and remove some other stuff, so I did that. Now my ftl files look exactly like the ones I downloaded, but when I run the application I still get the 2 column theme, and I wonder why. One difference between what I've done and what was done in the downloaded examples is that I don't have the tablecolspan variable (used for inst. like #if qTableLayout?exists qTableLayout.tablecolspan?exists #assign columnCount = qTableLayout.currentColumnCount /) as a property in any action. I thought that maybe there was no need when you just wanted to set the nr of columns from the jsp like: s:bean name=java.util.HashMap id=qTableLayout s:param name=tablecolspan value=%{10} / /s:bean I thought that the tablecolspan somehow was created automatically, but maybe I'm wrong. Is that why it's not working? Please, Dave or anybody who knows how to do this, can you help me figure this out? (I attached the most significant files in case you need to see them.) I just want the easiest way to be able to change the number of columns in a theme, and I thought the example I followed was.. (And I can't spend a really long time learning about some complicated template stuff because I really need to finish this whole project in three weeks to finish my education, get an income and a life again.. Sorry for being personal but that's the way it is.) Please please help me! /Ylva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2 Ajax validation actionErrors
Musachy Barroso wrote: I think I misunderstood your question, it does serializes the action errors, but it doesn't show them on the page for you. But it doesn't serialize them in 2.0.x right? I understand that 2.1 is very promising, but it is still in beta... And since 2.1 doesn't display action errors it might be a good idea to implement that, I guess it's not hard to do - modify s:actionerror tag and add some code to addError JavaScript. I can't do that b/c of my defense in October :) Thanks Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2 Ajax validation actionErrors
Don't remember about 2.0, but it was done with DWR for sure. On Fri, Aug 22, 2008 at 12:14 PM, Oleg Mikheev [EMAIL PROTECTED] wrote: Musachy Barroso wrote: I think I misunderstood your question, it does serializes the action errors, but it doesn't show them on the page for you. But it doesn't serialize them in 2.0.x right? I understand that 2.1 is very promising, but it is still in beta... And since 2.1 doesn't display action errors it might be a good idea to implement that, I guess it's not hard to do - modify s:actionerror tag and add some code to addError JavaScript. I can't do that b/c of my defense in October :) Thanks Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action as Welcome File
Hello James, I had the same problem and another Struts 2 developer showed me one way to do it. (I didn't get it to work to specify the action as a welcome-file.) The solution is almost like you did. The only difference is how you call the action from index.jsp. I don't know if it's more elegant but this should also work (at the top of index.jsp): meta http-equiv=Refresh CONTENT=0; URL = /myproject/MyAction.action/ -Just in case you wanted to know. /Ylva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why do s:select and s:submit add a tr ?
If you deploy the theme to the classpath (it's not relevant what *NetBean's* classpath is--it should be on the *webapp's* classpath) then you should be able to load templates. Have you tried creating a minimal test case, like changing one of the existing templates, and see if the changes are visible? If you put it in template/name-of-theme you shouldn't have to set anything. Dave --- On Fri, 8/22/08, Ylva Degerfeldt [EMAIL PROTECTED] wrote: From: Ylva Degerfeldt [EMAIL PROTECTED] Subject: Re: Why do s:select and s:submit add a tr ? To: Struts Users Mailing List user@struts.apache.org, [EMAIL PROTECTED] Date: Friday, August 22, 2008, 11:45 AM Hi again! I'm still struggling with the theme. See below.. I don't even know if I've put the theme in the right place in the NetBeans (5.5.1) structure. Is there a way to check that? Where did you put it? Did you read the template loading page? http://struts.apache.org/2.x/docs/template-loading.html? Yes, I read that but I'm afraid that Templates ae loaded first by searching the application and then by searching the classpath is not helping me since I haven't been able to figure out exactly what the classpath of NetBeans is. I've tried putting the template files in different places and changing the value of the property struts.ui.templateDir according to that.. But then I decided to download the code that belonged to the theme tutorial at: http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme (which I mentionend earlier) ..and to do as much as possible like they had done. About the location of the files, they had put it in /WEB-INF/classes/template, so I did that to and changed the value of the struts property to: /WEB-INF/classes/template I think that location is ok since I tried a different location once (right under /WEB-INF) and then actually got an exception, saying that the files of this theme couldn't be found, but now I don't get that exception. I also compared my controlheader-core.ftl, controlfooter.ftl, the newly created controlheader-trlogic.ftl and controlfooter-trlogic to the downloaded equivalents and found that I needed to add some stuff (like an #include in controlheader-core that includes controlheader-trlogic, which I actually had thought that I might need) and remove some other stuff, so I did that. Now my ftl files look exactly like the ones I downloaded, but when I run the application I still get the 2 column theme, and I wonder why. One difference between what I've done and what was done in the downloaded examples is that I don't have the tablecolspan variable (used for inst. like #if qTableLayout?exists qTableLayout.tablecolspan?exists #assign columnCount = qTableLayout.currentColumnCount /) as a property in any action. I thought that maybe there was no need when you just wanted to set the nr of columns from the jsp like: s:bean name=java.util.HashMap id=qTableLayout s:param name=tablecolspan value=%{10} / /s:bean I thought that the tablecolspan somehow was created automatically, but maybe I'm wrong. Is that why it's not working? Please, Dave or anybody who knows how to do this, can you help me figure this out? (I attached the most significant files in case you need to see them.) I just want the easiest way to be able to change the number of columns in a theme, and I thought the example I followed was.. (And I can't spend a really long time learning about some complicated template stuff because I really need to finish this whole project in three weeks to finish my education, get an income and a life again.. Sorry for being personal but that's the way it is.) Please please help me! /Ylva - 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]
type conversion per method
I'm running struts 2.0.11 trying to do a custom type conversion. The conversion is working for the action that calls the execute() method in the action class but it does not work for an action that is declared using the method=methodName parameter in struts.xml so when methodName() runs I get an input result because it doesn't convert. I have my properties file to wire up the conversion named as: ActionClass-conversion.properties The property file contains: parameter=com.type.conversion.ClassName I also tried putting this in xwork-conversion.properties without success. Has anyone had success using type conversion for actions that don't run execute()? -Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why do s:select and s:submit add a tr ?
Thanks for replying again, Dave! On Fri, Aug 22, 2008 at 7:30 PM, Dave Newton [EMAIL PROTECTED] wrote: If you deploy the theme to the classpath (it's not relevant what *NetBean's* classpath is--it should be on the *webapp's* classpath) then you should be able to load templates. Well, I'm actually not sure what the webapp's classpath is, but it seems I Have managed to put the templates there (/WEB-INF/classes - that sounds like the perfect place for that, right?). I know that for sure now since I actually managed to change a small thing in my theme which is visible! - In the submit.ftl of my theme (a copy of the one from xhtml) I changed the align value from ${parameters.align?html} to left and that worked!! So the problem is something about the template code and not about the location. I just don't know where to start to solve it. Could there be any other files than controlheader-core.ftl and controlfooter.ftl that I need to change? As you could see I attached those files in my last email, but maybe it's too much to ask if you could read through them and try to see if something is wrong..? (But it shouldn't be, though, since those files look exactly like the files in that tutorial. I think I'll try to ask the writer of the tutorial too.) Anyway, I would be really grateful for some more help with this since it's completely new and confusing to me. Thanks! /Ylva Have you tried creating a minimal test case, like changing one of the existing templates, and see if the changes are visible? If you put it in template/name-of-theme you shouldn't have to set anything. Dave --- On Fri, 8/22/08, Ylva Degerfeldt [EMAIL PROTECTED] wrote: From: Ylva Degerfeldt [EMAIL PROTECTED] Subject: Re: Why do s:select and s:submit add a tr ? To: Struts Users Mailing List user@struts.apache.org, [EMAIL PROTECTED] Date: Friday, August 22, 2008, 11:45 AM Hi again! I'm still struggling with the theme. See below.. I don't even know if I've put the theme in the right place in the NetBeans (5.5.1) structure. Is there a way to check that? Where did you put it? Did you read the template loading page? http://struts.apache.org/2.x/docs/template-loading.html? Yes, I read that but I'm afraid that Templates ae loaded first by searching the application and then by searching the classpath is not helping me since I haven't been able to figure out exactly what the classpath of NetBeans is. I've tried putting the template files in different places and changing the value of the property struts.ui.templateDir according to that.. But then I decided to download the code that belonged to the theme tutorial at: http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme (which I mentionend earlier) ..and to do as much as possible like they had done. About the location of the files, they had put it in /WEB-INF/classes/template, so I did that to and changed the value of the struts property to: /WEB-INF/classes/template I think that location is ok since I tried a different location once (right under /WEB-INF) and then actually got an exception, saying that the files of this theme couldn't be found, but now I don't get that exception. I also compared my controlheader-core.ftl, controlfooter.ftl, the newly created controlheader-trlogic.ftl and controlfooter-trlogic to the downloaded equivalents and found that I needed to add some stuff (like an #include in controlheader-core that includes controlheader-trlogic, which I actually had thought that I might need) and remove some other stuff, so I did that. Now my ftl files look exactly like the ones I downloaded, but when I run the application I still get the 2 column theme, and I wonder why. One difference between what I've done and what was done in the downloaded examples is that I don't have the tablecolspan variable (used for inst. like #if qTableLayout?exists qTableLayout.tablecolspan?exists #assign columnCount = qTableLayout.currentColumnCount /) as a property in any action. I thought that maybe there was no need when you just wanted to set the nr of columns from the jsp like: s:bean name=java.util.HashMap id=qTableLayout s:param name=tablecolspan value=%{10} / /s:bean I thought that the tablecolspan somehow was created automatically, but maybe I'm wrong. Is that why it's not working? Please, Dave or anybody who knows how to do this, can you help me figure this out? (I attached the most significant files in case you need to see them.) I just want the easiest way to be able to change the number of columns in a theme, and I thought the example I followed was.. (And I can't spend a really long time learning about some complicated template stuff because I really need to finish this whole project in three weeks to finish my education, get an income and a life again.. Sorry for being personal but that's the way it is.) Please
Re: type conversion per method
Figured it out. Had a bad URL going. Thanks! On Fri, 2008-08-22 at 14:41 -0400, Jason Deffenbaugh wrote: I'm running struts 2.0.11 trying to do a custom type conversion. The conversion is working for the action that calls the execute() method in the action class but it does not work for an action that is declared using the method=methodName parameter in struts.xml so when methodName() runs I get an input result because it doesn't convert. I have my properties file to wire up the conversion named as: ActionClass-conversion.properties The property file contains: parameter=com.type.conversion.ClassName I also tried putting this in xwork-conversion.properties without success. Has anyone had success using type conversion for actions that don't run execute()? -Jason - 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: Why do s:select and s:submit add a tr ?
--- On Fri, 8/22/08, Ylva Degerfeldt wrote: I'm actually not sure what the webapp's classpath is [...] Any of a million JEE tutorials, articles, books, etc. will bring you up to speed on the basics of Java webapp development, which is beyond the scope of the Struts list. it seems I Have managed to put the templates there (/WEB-INF/classes - that sounds like the perfect place for that, right?). Correct, since it works (and it's on the webapp classpath). Could there be any other files than controlheader-core.ftl and controlfooter.ftl that I need to change? I thought you were trying to remove the table-oriented HTML elements; it shouldn't be difficult to locate the files in which those elements exist. If you're undertaking a massive functional change then you're probably better off continuing to explore the existing tags and Mark's theme and its templates. I'd also suggest starting smaller and making incremental changes to prove your implementation of desired behavior and take it one step at a time. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] S2 Stream Result, downloading large file, advice needed
I'm still interested in hear any suggestions. I know that this is not strictly an S2 issue but it is related to using a Stream result type. If I was writing a servlet I would just get the OutputStream and write directly to it, putting the burden of buffering etc. onto the container. What I decided to do (until I hear a better suggestion) is to write to a temporary file (File.createTempFile()) then for the InputStream I created a wrapper around FileInputStream which will delete the file when close() is called. This seems to work fine in the conditions I can test, not sure if close() will be called if the user hits Cancel in the middle of a very large download. Greg Lindholm wrote: Hi Folks, I'm using S2 Stream result type to allow users to download a CSV file that I dynamically write from records selected from a database. First pass on this I'm using a StringWriter to write out the CSV data (using SuperCSV) that using the string to build a ByteArrayInputStream for the InputStream result. My concern is that the results could get very large based on the the selection criteria the user supplies. So trying to do this all in-memory with a StringWriter-String-Byte[] is likely a bad idea. I'm looking for advice on a better way of doing this? I thought I could write to a temp file, but how do I ensure the file is deleted when the download completes? I also thought about using a PipedInputStream and hooking to a PipedOutputStream which I write to in another thread, but this seems like it could become overly complicated having to deal with the threads and database sessions and error conditions etc. Do you know a better way? Any advice or suggestions would be appreciated. Thanks Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-OT--S2-Stream-Result%2C-downloading-large-file%2C-advice-needed-tp19094823p19114445.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Struts 2 And JFreeChart
But if I don't have p property in my action class, I got warning in log ParamsPrepareParams setting String... interceptor and so on ? -- Milan newton.dave wrote: do I need to have this p (String type) parameter in my action class ? No, it's there to create a unique URL, so it won't be cached. Dave dynamicd wrote: its some parameter name (the name does not matter) and RANDOM is set in the controller (Action) or to make it easy img src=/Dashboard/DisplayChart.action?p=%=request.hashCode()% / instead of passing DisplayChart.action each time. it is passed in as a different url everytime and so it will display the new image other wise if the url is the same then you will get displayed the cached image. Milan Milanovic wrote: I don't understand this solution, what is p parameter, and whait is RANDOM ? -- Regards, Milan dynamicd wrote: got it to work.. could not stop the caching so added a param to the src img src=/Dashboard/DisplayChart.action?p=%=request.getParameter(RANDOM)% / dynamicd wrote: I have tried % response.setHeader(Cache-Control, no-cache); //HTTP 1.1 response.setHeader(Pragma, no-cache); //HTTP 1.0 response.setDateHeader(Expires, 0); //prevents caching at the proxy server % as well.. newton.dave wrote: --- On Wed, 8/6/08, dynamicd [EMAIL PROTECTED] wrote: Also tried implementing the SessionAware. However the same thing. Why? Did you try setting the headers for not caching? Dave dynamicd wrote: This is cool.. I tried it out. However once the chart_display.jsp is called the first time through the image tag. it does not call the DisplayChart.action again to refresh the image with a new one when clicked on the DrawChart.action. (I added the println statement in the display method to find out that the div is not refreshing) I have to log out and log in (invalidate session) to get the new chart. I am missing something public String display() throws Exception { System.out.println(I AM IN THE DISPLAY NOW ); Map attributes = ActionContext.getContext().getSession(); this.chart = (JFreeChart) attributes.get(CHART); if(chart == null) { return Constants.FORWARD_INVALIDACTION; } return Constants.FORWARD_SUCCESS; } private void setChart(JFreeChart chart){ Map attributes = ActionContext.getContext().getSession(); attributes.put(CHART, null); this.chart = chart; attributes.put(CHART, this.chart); } public JFreeChart getChart() { return chart; } Leena Borle wrote: Hello, See if this helps you. I have a form with remote DIV which displays chart after user clicks on submit. Trick here is to generate chart object, store it in session and display it in separate JSP. Remove the form part if you want to display just the dynamic-DIV using Chart image. Form.jsp [ s:form s:url id=display_chart value=DrawChart_draw.action namespace=/user / s:submit value=Draw chart href=%{display_chart} theme=ajax targets=*chart_div* / br / /s:form h4Your Running Chart/h4 div id=*chart_div* /div !-- End display chart -- /div ] display_chart.jsp [ body /MyApp/user/DrawChart_display.action /body ] struts.xml[ package name=user extends =struts-default,jfreechart-default !-- Separate method to draw and display due to Remote DIV/Button tag contsraints. -- action name=DrawChart_input method=input class=.xxx.DrawChart result name=inputform.jsp /result /action action name=DrawChart_draw method=draw class=xxx..DrawChart result name=success/jsp/display_chart.jsp /result /action action name=DrawChart_display method=display class=xxx.DrawChart result name=success type=chart 400 300 /result /action /package ] DrawChart.java [ JFreeChart chart; public String draw() throws Exception { //chart creation logic. //generate chart object chart = session = session.put(CHART,
Re: [OT] Re: Struts 2 And JFreeChart
--- On Fri, 8/22/08, Milan Milanovic [EMAIL PROTECTED] wrote: But if I don't have p property in my action class, I got warning in log ParamsPrepareParams setting String... interceptor and so on? ... So put a p parameter in your action. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Iterate through two lists
Dear Dave, now, I don't get 500 server error, but null values! I don't know why? Where can I set levels DEBUG for S2, XWork and OGNL ? -- Thx, Milan newton.dave wrote: --- On Thu, 8/21/08, Milan Milanovic wrote: I have struts devMode on and logging works for Struts, i.e., I get all messages from Apache Tomcat and Struts in console. What do you mean by logging turned up ? Set log levels to DEBUG for S2, XWork, and OGNL. Did my solution work for you? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--Iterate-through-two-lists-tp19052842p19116450.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] S2 Stream Result, downloading large file, advice needed
I have a somewhat similar situation in an application I am creating where I needed to provide a .tar.gz file that I create for the user. I want that file to hang around for some configurable amount of time in case the user re-requests that file and then I wanted to remove it. I used quartz to periodically run a cleanup method to remove old files. Right now it is running once a day to delete any file older then 72 hours but that can all be changed in my spring configuration later on if we have too many files sticking around. I am extending the StreamResult class to return my tar file for downloaded. Hope this helps. I can provide more detail into some or all of the above if you want. I don't really think that the details of quartz and/or spring belong on this list so if you want information about that feel free to contact me off list. -Brendan Greg Lindholm wrote: I'm still interested in hear any suggestions. I know that this is not strictly an S2 issue but it is related to using a Stream result type. If I was writing a servlet I would just get the OutputStream and write directly to it, putting the burden of buffering etc. onto the container. What I decided to do (until I hear a better suggestion) is to write to a temporary file (File.createTempFile()) then for the InputStream I created a wrapper around FileInputStream which will delete the file when close() is called. This seems to work fine in the conditions I can test, not sure if close() will be called if the user hits Cancel in the middle of a very large download. Greg Lindholm wrote: Hi Folks, I'm using S2 Stream result type to allow users to download a CSV file that I dynamically write from records selected from a database. First pass on this I'm using a StringWriter to write out the CSV data (using SuperCSV) that using the string to build a ByteArrayInputStream for the InputStream result. My concern is that the results could get very large based on the the selection criteria the user supplies. So trying to do this all in-memory with a StringWriter-String-Byte[] is likely a bad idea. I'm looking for advice on a better way of doing this? I thought I could write to a temp file, but how do I ensure the file is deleted when the download completes? I also thought about using a PipedInputStream and hooking to a PipedOutputStream which I write to in another thread, but this seems like it could become overly complicated having to deal with the threads and database sessions and error conditions etc. Do you know a better way? Any advice or suggestions would be appreciated. Thanks Greg - 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: [S2] Double conversion issue
This is some wierd Struts behaviour for Double conversion, e.g., if my prop attribute in JSP was 2232.435, when user click on this Delete link, in my action class for prop attribute I get: 2232435.0 ?! -- Milan Milan Milanovic wrote: Hi, I have this code in my jsp: s:iterator value=someObject status=rowstatus ... s:url id=removeUrl action=remove s:param name=prop value=prop / /s:url s:a id=a_%{prop} href=%{removeUrl} theme=ajax notifyTopics=/delete targets=fruitsDelete/s:a ... /s:iterator This remove.action is mapped into remove() method in my action class, and prop is a double property with get/set methods in my action class. What happens now, when user enter, e.g. 1234.0 for prop, it is well represented here, e.g. prop value is 1234.0 in jsp and my list in action class, but when user click on the link above to delete it, in my action class remove() method for prop I get: 12340.0 ! Zero is always added at end of the number, does anyone know why this could happen ? -- Regards, Milan -- View this message in context: http://www.nabble.com/-S2--Double-conversion-issue-tp19092842p19116746.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Iterate through two lists
--- On Fri, 8/22/08, Milan Milanovic wrote: Where can I set levels DEBUG for S2, XWork and OGNL ? Search the fine web for Java logging, possibly after checking what S2 has for logging-oriented dependencies. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2: Unable to undeploy app in Tomcat
I am unable to have Tomcat delete the physical directory of my webapp when I undeploy from Tomcat Manager. My application gets undeployed, but there is a lock is on the struts2-core library. Anyone encounter this problem? I am using 2.0.11.2 and Tomcat 6.0.16. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Double conversion issue
I've seen this reported previous as a bug in S2/Xwork (appending an extra 0 character). I can't recall where I saw that. Write a custom type-converter for that field to work-around it. Milan Milanovic wrote: This is some wierd Struts behaviour for Double conversion, e.g., if my prop attribute in JSP was 2232.435, when user click on this Delete link, in my action class for prop attribute I get: 2232435.0 ?! -- Milan Milan Milanovic wrote: Hi, I have this code in my jsp: s:iterator value=someObject status=rowstatus ... s:url id=removeUrl action=remove s:param name=prop value=prop / /s:url s:a id=a_%{prop} href=%{removeUrl} theme=ajax notifyTopics=/delete targets=fruitsDelete/s:a ... /s:iterator This remove.action is mapped into remove() method in my action class, and prop is a double property with get/set methods in my action class. What happens now, when user enter, e.g. 1234.0 for prop, it is well represented here, e.g. prop value is 1234.0 in jsp and my list in action class, but when user click on the link above to delete it, in my action class remove() method for prop I get: 12340.0 ! Zero is always added at end of the number, does anyone know why this could happen ? -- Regards, Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: Unable to undeploy app in Tomcat
On Fri, Aug 22, 2008 at 9:10 PM, Paul Benedict [EMAIL PROTECTED] wrote: I am unable to have Tomcat delete the physical directory of my webapp when I undeploy from Tomcat Manager. My application gets undeployed, but there is a lock is on the struts2-core library. Anyone encounter this problem? I am using 2.0.11.2 and Tomcat 6.0.16. Windows I assume? Look for some Tomcat options like 'antiJARLocking' and 'antiResourceLocking' to set in (I think) context.xml. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: Unable to undeploy app in Tomcat
Paul Benedict wrote: I am unable to have Tomcat delete the physical directory of my webapp when I undeploy from Tomcat Manager. My application gets undeployed, but there is a lock is on the struts2-core library. Anyone encounter this problem? I am using 2.0.11.2 and Tomcat 6.0.16. Paul Yes. I don't think there's a work-around in 2.0. I think there's an issue in JIRA and recall it relates to the threadlocal ActionContext not being released. A work-around was applied to the FilterDispatcher in 2.1 that would force it to release the ActionContext. Sounds like you're using windows. On that platform I always perform an undeploy, stop, then a reliable delete, then start, then deploy. Linux platforms don't experience the same file locking issue. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: Unable to undeploy app in Tomcat
Jeromy, Any good chance 2.0.12 would contain the fix? Is the fix totally not able to be backported? Paul On Sat, Aug 23, 2008 at 12:05 AM, Jeromy Evans [EMAIL PROTECTED] wrote: Paul Benedict wrote: I am unable to have Tomcat delete the physical directory of my webapp when I undeploy from Tomcat Manager. My application gets undeployed, but there is a lock is on the struts2-core library. Anyone encounter this problem? I am using 2.0.11.2 and Tomcat 6.0.16. Paul Yes. I don't think there's a work-around in 2.0. I think there's an issue in JIRA and recall it relates to the threadlocal ActionContext not being released. A work-around was applied to the FilterDispatcher in 2.1 that would force it to release the ActionContext. Sounds like you're using windows. On that platform I always perform an undeploy, stop, then a reliable delete, then start, then deploy. Linux platforms don't experience the same file locking issue. - 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: S2: Unable to undeploy app in Tomcat
https://issues.apache.org/struts/browse/WW-2167 On Sat, Aug 23, 2008 at 12:05 AM, Jeromy Evans [EMAIL PROTECTED] wrote: Paul Benedict wrote: I am unable to have Tomcat delete the physical directory of my webapp when I undeploy from Tomcat Manager. My application gets undeployed, but there is a lock is on the struts2-core library. Anyone encounter this problem? I am using 2.0.11.2 and Tomcat 6.0.16. Paul Yes. I don't think there's a work-around in 2.0. I think there's an issue in JIRA and recall it relates to the threadlocal ActionContext not being released. A work-around was applied to the FilterDispatcher in 2.1 that would force it to release the ActionContext. Sounds like you're using windows. On that platform I always perform an undeploy, stop, then a reliable delete, then start, then deploy. Linux platforms don't experience the same file locking issue. - 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: S2: Unable to undeploy app in Tomcat
Paul Benedict wrote: https://issues.apache.org/struts/browse/WW-2167 Yes, it's easy to retrofit to 2.0. It only requires a finally statement in the init and destroy methods. PS. stop developing java on windows... ;-) My estimate is that Sun's java compiler is at least 50% faster (perhaps more) under Linux. I don't know the reason, but that alone makes for a significant productivity difference when working with struts. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]