Invalid field value(due to type coversion) in Struts2
Hi Problem in Struts2. I have problem when using OGNL to set the Object directly on Model. For e.g. s:select name=courseImplementation.department list=listPropertySelectionModel.departmentListOfSchool listValue=name / e.g. Final html which is rendered by struts2 select name=courseImplementation.department id=_courseImplementation_department option value=Department#3/-970525270 selected=selectedDermetology/option option value=Department#4/-970525207Orthopedic_dept/option option value=Department#5/-970525141Art of Fashion/option option value=Department#6/-970524313MBA/option /select here i am trying to set the Object of Department directly on Model CourseImplementation's setDepartment(Department department) method using ognl : courseImplementation.department. My listKey contains the Object of type Department. When i am trying to save it gives me following error. Error : Invalid field value for field courseImplementation.department. i know that this is error is due to incompatible type. But what could be the solution? Any reply is most welcomed. I have spend a lot of time behined it. Please reply Thnak you -- View this message in context: http://www.nabble.com/Invalid-field-value%28due-to-type-coversion%29-in-Struts2-tf4682207.html#a13379578 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem while setting object directly from s:select tag
Hi, I am having problem while setting my selected list object directly to my bean class. My code looks like given below:- s:select name=user.item list=itemList listValue=name/ public MyAction extends ActionSupport { ... public ListItem getItemList() { return (a list with itemobjects in it); } public User getUser() { return user object; } } public class User { private Item item; public Item getItem() { return item; } public void setItem(Item item) { this.item = item; } } public class Item { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } My listKey contains the Object of type Item. But when i am trying to save my user object gives me following error. Error : Invalid field value for field user.item. Can anybody help me to find solution. Thanks in advanced, Jignesh -- View this message in context: http://www.nabble.com/Problem-while-setting-object-directly-from-%3Cs%3Aselect%3E-tag-tf4682431.html#a13380117 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: conditional statement in struts2
would this code function correctly..that if pdfValue==1 it will display an iframe containing a pdf generated from jasperreports else a strut div will be displayed containing an html format report? s:if test=pdfValue==1 iframe id=reportPreview name=reportPreview src=%{getReportNumber()}.action?reportId=%{getReportId()} width=800 height=600/ /s:if s:else s:div theme=ajax id=reportPreview href=%{getReportNumber()}.action?reportId=%{getReportId()} cssStyle=componentHolder loadingText=Loading report... Please wait. errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true Loading report... Please wait. /s:div /s:else thanks again. jignesh(india) wrote: It's simple dude use s:if and s:else like mentioned below s:if test=pdfValue!=0 if part /s:if s:else else part /s:else hope it will help u.! Regards, Jignesh carmi_cd wrote: hi i'm new in struts 2..my question is how can i get a value from a member variable of my action class and evaluate it in my if-else-if statemet? i try to code it but it doesn't evaluate properly..here is my exisiting code. s:if test='%{getPdfValue()} == 0' s:div theme=ajax id=reportPreview href=%{getReportNumber()}.action?reportId=%{getReportId()} cssStyle=componentHolder loadingText=Loading report... Please wait. errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true Loading report... Please wait. /s:div /s:if s:else s:div theme=ajax id=reportPreview cssStyle=componentHolder loadingText=Loading PDF errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true iframe id=pdf_container name=pdf_container src=%{getReportNumber()}.action?reportId=%{getReportId()} width=800 height=600/ /s:div /s:else it supposed to display the genereated pdf inside the iframe if the getPdfValue() method return are not equal to 0. please help me its not evaluating properly..thanks in advance. -- View this message in context: http://www.nabble.com/conditional-statement-in-struts2-tf4682064.html#a13382105 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: conditional statement in struts2
Please check http://www.roseindia.net/struts/struts2/struts-2-tags.shtml Thanks -Original Message- From: carmi_cd [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 24, 2007 2:47 PM To: user@struts.apache.org Subject: Re: conditional statement in struts2 would this code function correctly..that if pdfValue==1 it will display an iframe containing a pdf generated from jasperreports else a strut div will be displayed containing an html format report? s:if test=pdfValue==1 iframe id=reportPreview name=reportPreview src=%{getReportNumber()}.action?reportId=%{getReportId()} width=800 height=600/ /s:if s:else s:div theme=ajax id=reportPreview href=%{getReportNumber()}.action?reportId=%{getReportId()} cssStyle=componentHolder loadingText=Loading report... Please wait. errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true Loading report... Please wait. /s:div /s:else thanks again. jignesh(india) wrote: It's simple dude use s:if and s:else like mentioned below s:if test=pdfValue!=0 if part /s:if s:else else part /s:else hope it will help u.! Regards, Jignesh carmi_cd wrote: hi i'm new in struts 2..my question is how can i get a value from a member variable of my action class and evaluate it in my if-else-if statemet? i try to code it but it doesn't evaluate properly..here is my exisiting code. s:if test='%{getPdfValue()} == 0' s:div theme=ajax id=reportPreview href=%{getReportNumber()}.action?reportId=%{getReportId()} cssStyle=componentHolder loadingText=Loading report... Please wait. errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true Loading report... Please wait. /s:div /s:if s:else s:div theme=ajax id=reportPreview cssStyle=componentHolder loadingText=Loading PDF errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true iframe id=pdf_container name=pdf_container src=%{getReportNumber()}.action?reportId=%{getReportId()} width=800 height=600/ /s:div /s:else it supposed to display the genereated pdf inside the iframe if the getPdfValue() method return are not equal to 0. please help me its not evaluating properly..thanks in advance. -- View this message in context: http://www.nabble.com/conditional-statement-in-struts2-tf4682064.html#a13382 105 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: conditional statement in struts2
As per my local set up here it is working ok. I have taken local method in action class named getPdfValue() public int getPdfValue() { return 1; } and it is working ok. Jignesh. carmi_cd wrote: would this code function correctly..that if pdfValue==1 it will display an iframe containing a pdf generated from jasperreports else a strut div will be displayed containing an html format report? s:if test=pdfValue==1 iframe id=reportPreview name=reportPreview src=%{getReportNumber()}.action?reportId=%{getReportId()} width=800 height=600/ /s:if s:else s:div theme=ajax id=reportPreview href=%{getReportNumber()}.action?reportId=%{getReportId()} cssStyle=componentHolder loadingText=Loading report... Please wait. errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true Loading report... Please wait. /s:div /s:else thanks again. jignesh(india) wrote: It's simple dude use s:if and s:else like mentioned below s:if test=pdfValue!=0 if part /s:if s:else else part /s:else hope it will help u.! Regards, Jignesh carmi_cd wrote: hi i'm new in struts 2..my question is how can i get a value from a member variable of my action class and evaluate it in my if-else-if statemet? i try to code it but it doesn't evaluate properly..here is my exisiting code. s:if test='%{getPdfValue()} == 0' s:div theme=ajax id=reportPreview href=%{getReportNumber()}.action?reportId=%{getReportId()} cssStyle=componentHolder loadingText=Loading report... Please wait. errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true Loading report... Please wait. /s:div /s:if s:else s:div theme=ajax id=reportPreview cssStyle=componentHolder loadingText=Loading PDF errorText=Unable to load report. listenTopics=load_report_preview executeScripts=true iframe id=pdf_container name=pdf_container src=%{getReportNumber()}.action?reportId=%{getReportId()} width=800 height=600/ /s:div /s:else it supposed to display the genereated pdf inside the iframe if the getPdfValue() method return are not equal to 0. please help me its not evaluating properly..thanks in advance. -- View this message in context: http://www.nabble.com/conditional-statement-in-struts2-tf4682064.html#a13383571 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: How to get initialized at startup
I am writing my own servlet for this as I didn't found anything. As I feel I have more control on that. post it if you got solution for this one. - Original Message - From: Brian Hawkins [EMAIL PROTECTED] To: user@struts.apache.org Sent: Tuesday, October 23, 2007 3:06 AM Subject: How to get initialized at startup I'm pretty new to Struts2. I have some code I need to initialize when the servlet comes up for the first time. How do I do that when I'm using struts and I do not have my own servlet? Do I create a servlet just for this purpose? Thanks Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with findForward(null) (Struts 1.1)
Himstedt, Maik (EXTERN: T-Systems on) wrote: return findForward(null); This might work, but IIRC you should just return null if you're handling the result yourself. Debug shows that the code in the action method is executed, but the browser shows an empty page after executing the action. You've submitted a form--this is standard browser behavior. If you want to submit a form without refreshing the entire page you'd probably want to use Ajax. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with findForward(null) (Struts 1.1)
2007/10/24, Himstedt, Maik (EXTERN: T-Systems on) [EMAIL PROTECTED]: return findForward(null); ... Debug shows that the code in the action method is executed, but the browser shows an empty page after executing the action. I would expect that simple nothing would happen (as the real download functionality/the response) isn't implemented yet. It's perfectly normal! Since you are forwarding to nothing, a response MUST be sent to the client, and it is a default response (no content, but the HTTP headers are present). To be more precise, I'd expect the browser to show the search mask and the result still. Do you mean that you expected that the original page is still present after that request? This is true, if the file is not HTML, plain text, and other formats that are directly interpretable by the browser. If you put in the response, say, a zip file, your browser will ask you to save/open it (possibly you have to set the Content-disposition HTTP header parameter). Antonio
[S2] validation annotation problem
I use model driven actions and want to use validation by annotation. so I have somethings like: @Validation public Class ...Action implements ...{ ... @VisitorFieldValidator(message = , appendPrefix = false) public TestModel getModel() { return testModel; } ... in the model class TestModel I have: @Validation @Entity @Table(name = ...) public class TestModel implements IPersistable { ... @VisitorFieldValidator(message = ) public void setSubModel(SubModel subModel) { this.subModel = subModel; } ... (beside validation you see some hibernate annotations) Now the problem I see when debugging (JBoss 4.0.3SP1) is: the first VisitorFieldValidator is recognized correctly, but within the TestModel class no annotations at all are found! when I write a simple unit tests which does pretty the same then in the validation annotation logic of struts2 / xwork, I get the annotation! What is difference / problem here? the units tests found the Annotation (size of array = 1), debugging real application shows size = 0 (yes I am sure I have deployed the same class which is used in Unit Test) Part of Unit Tests (which works) is: @Test public void testGetAnnotation() { TestModel testModel = new TestModel(); Method[] methods = testModel.getClass().getDeclaredMethods(); for (Method method : methods) { if(method.getName().equals(setSubModel)){ System.out.println(method: + method.getName()); Annotation[]annotations = method.getAnnotations(); System.out.println(annotation size: + annotations.length); } } } Any help highly appreciated, thank you in davance -- View this message in context: http://www.nabble.com/-S2--validation-annotation-problem-tf4684043.html#a13384745 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Change struts-default.xml content
Hello. I want to change some information in struts-default.xml. I can move it to classes directoty and do any change:-) Is there any more sofisticated method to do the same from struts.xml? For example i want to change TextProvider: From bean type=com.opensymphony.xwork2.TextProvider name=struts class=one class / to bean type=com.opensymphony.xwork2.TextProvider name=struts class=another class / -- View this message in context: http://www.nabble.com/-S2---Change-struts-default.xml-content-tf4684048.html#a13384756 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts 2 action messages / action errors
Does struts2 handle the css-styling of action errors and messages the same as struts1? In struts 1, i defined some keys in the message bundle errors.prefix and errors.suffix that were automatically used to style the html generated by the actionerrors. Is this enabled in struts2? Thanks, Brian
Re: How to get initialized at startup
I did what Sartini suggested. I implemented the ServletContextListener interface and added it as a listener to my application. I use it to create and take down some database connections that I need for my application. It works really well. Brian On 10/24/07, vamsi [EMAIL PROTECTED] wrote: I am writing my own servlet for this as I didn't found anything. As I feel I have more control on that. post it if you got solution for this one. - Original Message - From: Brian Hawkins [EMAIL PROTECTED] To: user@struts.apache.org Sent: Tuesday, October 23, 2007 3:06 AM Subject: How to get initialized at startup I'm pretty new to Struts2. I have some code I need to initialize when the servlet comes up for the first time. How do I do that when I'm using struts and I do not have my own servlet? Do I create a servlet just for this purpose? Thanks Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts 2 action messages / action errors
Struts 2 allows you to style them, but using themes. Themes are both more powerful and more complicated than what Struts 1 offered. Before you dive into customizing a theme, see if you can style it entirely with CSS. You're best better is probably to View source in your browser to see the rendered HTML, noting the classes that the built-in themes use. Then, override these styles with your own stylesheet. Using the built-in css_xhtml theme (add struts.ui.theme=css_xhtml to struts.properties) will give you more flexibility, compared to the default theme (xhtml). If that doesn't give you the look you want, it's time to dive into themes. Themes are documented here: http://struts.apache.org/2.x/docs/themes-and-templates.html http://struts.apache.org/2.x/docs/extending-themes.html Mark Menard has provided an excellent tutorial on creating custom themes here: http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme On Oct 24, 2007, at 11:58 AM, Brian Relph wrote: Does struts2 handle the css-styling of action errors and messages the same as struts1? In struts 1, i defined some keys in the message bundle errors.prefix and errors.suffix that were automatically used to style the html generated by the actionerrors. Is this enabled in struts2? Thanks, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation Best Practices?
Hey, I have a question concerning where validation should be performed, and what people feel best practices are. Specifically, I have a number of business objects that validate parameters supplied to their setters for correctness, and throw IllegalArgumentExceptions if something is invalid. For example, in a hypothetical Person class I would have: ... public void setAge(int age) { if (age 0) throw new MyInvalidValueException(some i18n-ed error msg); this.age = age; } This is done so that if there is a failure to properly validate at some other layer of the application, it will fail-fast and allow the problem to be debugged more easily. (It also gives confidence that all references to a business object do not contain invalid data.) Now, we are using Struts2 and intend to use the provided annotations for validation. The problem is, if I create the app so that HTTP parameters are set directly on the business objects (by using a 'name' value of person.name for a form field, for example), these exceptions will prevent the value from being set, so validation is never performed (and no errors are set on the action). The way I see it, I have three options: 1) Remove all validity checks from the business objects, and rely on Struts to validate incoming data, and the DAO layer to validate them before inserting. This would probably be the simplest option, but I wanted to get peoples thoughts on it first. Are argument checks like the ones above a good idea? Or is it better to have these type of objects be dumb-data transfer objects that will carry any value they are given? 2) Duplicate all properties of the business objects on the struts actions, where they can be validated using the validation annotations. The action methods must then copy the values into the business objects as needed. This would allow the business objects to remain unchanged, but has a lot of duplication and maintenance overhead if fields are added/removed/changed. (It basically reminds me of the nightmare of Struts1 form beans :p ) 3) Extend the ParametersInterceptor and/or validation interceptor to do some kind of magic involving catching the argument exceptions, setting appropriate errors on the action, and preserving the invalid values so that they can be redisplayed on the form. This option is definitely the most work (and I haven't looked at the Struts source closely enough to know exactly how much is involved, and if its even possibly to do in an elegant fashion). So in addition to commenting on the above specific situation, the general question is this: should business objects be self-validating, and how should they handle validation errors? Thanks in advance for any input, Sean Kleinjung AV Support, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Change struts-default.xml content
you can redefine it in your struts.xml, much like how you would specify the object factory to override the default object factory . -a Igor Vlasov wrote: Hello. I want to change some information in struts-default.xml. I can move it to classes directoty and do any change:-) Is there any more sofisticated method to do the same from struts.xml? For example i want to change TextProvider: From bean type=com.opensymphony.xwork2.TextProvider name=struts class=one class / to bean type=com.opensymphony.xwork2.TextProvider name=struts class=another class / -- View this message in context: http://www.nabble.com/-S2---Change-struts-default.xml-content-tf4684048.html#a13391033 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] Websphere 6.1 Showcase application, Response already committed warning in logs
Hi, I am using RAD 7.0 with WAS test environment. My Struts2 app is not working (There is no Action mapped for action name - error) in the test environment. I exported my project as WAR and deployed it in the app server. This time it worked. I observed the same behavior even with the Struts Blank application. With resources in my workspace, it is not working but when I deploy the app as WAR it is working. I even upgraded to WAS 6.1.0.5 Fix pack but with no luck. Could anyone explain the reason for this strange behavior? Thanks Antony Stubbs wrote: Great news guys - problems solved. Everything now seems to be working great. So - to get it working, i installed the 6.1.0.5 fix pack, and the http://www-1.ibm.com/support/docview.wss?rs=0uid=swg24014758 interim fix for PK33090 . There is another related issue:PK27620. Now here's the key - what you also have to do, is set com.ibm.ws.webcontainer.invokefilterscompatibility custom property on your web container settings to 'true' for the fix to take effect. Hoorah! The struts2-blank, struts2-showcase also works great, as well as the AJAX pages! And my app as well - along with SiteMesh decoration! When a request is made for a file that does not exist at the location specified in the request the Webcontainer calls the filters (if any) associated with the request. If the filters were able to find the requested resource the request is supposed to continue on as normal. However the webcontainer is sending back a 404 error even though the filters were able to find the resource. AND If a JSP is accessed using a URI that does not exist as part of a web application (but can be mapped via a servlet filter), a 404 File not found exception will be reported. http://forum.springframework.org/newreply.php?do=newreplynoquote=1p=100026 pea1: I got a response from IBM. They ackowledge this problem and gave me a work-around. Quote: One of our level 2 technicians stated this about the apar... APAR PK27620 changed a lot of the code dealing with filters. We had to add a property in our methods to keep certain functionality. While fixing some problems it(the apar) has changed the behaviour of certain filter functionality. So we had to add a new custom property for 6.1.0.3+ The custom property he is talkin about is; com.ibm.ws.webcontainer.invokefilterscompatibility The com.ibm.ws.webcontainer.invokefilterscompatibility should be set to true through Application Servers - server - Web Container Settings - Web Container - Custom Properties. Once set, you don't need to remove this custom property even if you upgrade the WAS. I tried this and it appears to work for me. Here's a similar issue: http://www-1.ibm.com/support/docview...=utf-8lang=en Note, that I have some other apps using Acegi 1.0.2 on WebSphere 6.1.0.3 and they weren't having this issue, so it's not a consistent problem. Antony Stubbs wrote: Ok, after installing Websphere 6.1 update pack (6.1.0.5-WS-WAS-IFPK33090), I know get a worse result. It seems that the struts2 filter isn't even being run? now *all* i get is Error 404: SRVE0190E: File not found: /eventProfile.action printed to the screen, and *nothing* in the logs. ugh. It appears as though Struts2 filter isn't even being invoked. I switched to Tapio's custom WebsphereFilterDispatcher and put some break points in there to catch execution, but it never breaks - it just very quickly puts up that msg. struts1 within the same project still works fine though, running the servlet *.do mapping. And just in case someone asks: filter filter-namestruts2/filter-name!-- filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class init-param param-nameactionPackages/param-name param-valuecom.fonterra.tams.actions.s2/param-value /init-param /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping Antony Stubbs wrote: Just double checked your fix, still doesn't work for me. I will let you know how it goes after I finish installing the fix packs. Antony Stubbs wrote: Yes I have tried your solution, and I still get those messages, along with the lines appended to my js files. I'm trying to patch WebSphere now, but am not sure if the fix described here is available. You see I think it may be caused by http://www-1.ibm.com/support/docview.wss?uid=swg24014758 this WebSphere issue . Found while browsing http://www.mail-archive.com/[EMAIL PROTECTED]/msg17765.html this thread . I will double check your fix again in a second - download of fix pack to 6.0.5 is going to take an hour. then there's a interim fix for the issue i linked to (but gotta install the .5 fix pack first). Tapio Holopainen wrote: If you define WebsphereFilterDispatcher in your web.xml, do you still get those 'response
Re: about Struts 2.0.9 portlet example ...
Ok thanks, that's good to know. There is a strong recommendation coming from a colleague to use the IBM Portlet API on WebSphere Portal, particularly because of its support for inter-portlet communication - from what I'm told, this isn't supported by the standard JSR-168 API. I'm not too keen on using proprietary extensions, unless it does provide a significant advantage. Would Struts2 provide the necessary mechanism to accomplish this communication? What are the advantages of using Struts2 on top of the standard portlet API or the IBM API? Thanks again, GB Nils-Helge Garli wrote: The portlet support in the next 2.0.x and 2.1.x has been improved a lot. You can browse the changelogs and remaining issues in the issue tracker. It does not include Ajax support, but you can add that yourself. I know of several projects that are using it in production already. Nils-H On 10/23/07, Guillaume Bilodeau [EMAIL PROTECTED] wrote: We will soon start a portal project and we're evaluating the technologies available to us. Is Struts2 support for portlets ready for primetime, or should we use something else until it's stabilized? Cheers, GB Nils-Helge Garli wrote: Hi! If you're thinking of the struts2-portlet application, you need to install it into a portlet container to test it. However, ajax is not yet built into the portlet framework. Nils-H On 10/18/07, Giovanni Azua [EMAIL PROTECTED] wrote: hi all, I managed to see the examples in the portlet webapp demo (there is no index page) but I didn't see any portlet anywhere ... so I am curious as if to there is at all an AJAX portlet control delivered with Struts 2? Lack of portlets in S2 and AJAxification of displaytag would be the two main reasons for me to use ajaxtags in addition to S2. Any alternatives to ajaxtags? regards, Giovanni - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/about-Struts-2.0.9-portlet-example-...-tf4646784.html#a13356144 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/about-Struts-2.0.9-portlet-example-...-tf4646784.html#a13394151 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] [S2.0.9] s:submit method=.../ v. Ajax
Howdy, If you have an s:submit.../ with method='' or name='method:foo' attributes and set theme='ajax' is the method attribute/name-thing ignored? Thanks, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts2 run time error
Hi I am using Coverter for following thing. s:select name=courseImplementation.department list=listPropertySelectionModel.departmentListOfSchool listValue=name listKey=id / After submiting form when i will come back to the same page at that time it gives me following error. ERROR [runtime] Method public boolean org.apache.struts2.components.ListUIBean.contains(java.lang.Object,java.lang.Object) threw an exception when invoked on [EMAIL PROTECTED] The problematic instruction: -- == if tag.contains(parameters.nameValue, itemKey) == true [on line 64, column 9 in template/simple/select.ftl] in user-directive s.iterator [on line 41, column 1 in template/simple/select.ftl] Please see this if any one knows the cause of this problem. Thanks in Advance -- View this message in context: http://www.nabble.com/struts2-run-time-error-tf4688474.html#a13399829 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
2.0.9 OptionTransferSelect
I am trying to upgrade our app to 2.0.9 and having difficulty in the optiontransferselect tag. Here is a sample of what a typical OTS tag looks like in our app: - s:form name=editForm2 action=saveScanNotifications theme=xhtml s:optiontransferselect theme=xhtml label=%{getText('item.notifications')} name=systemUsers rightTitle=Users Notified by Scan leftTitle=System User List list=%{systemUsers} listValue=email listKey=id allowAddToLeft=true allowAddAllToLeft=true allowUpDownOnLeft=true multiple=true headerKey=headerKey headerValue=--- Please Select --- emptyOption=true doubleList=%{notificationUsers} doubleListValue=email doubleListKey=id doubleName=notificationUsers doubleHeaderKey=doubleHeaderKey doubleHeaderValue=--- Please Select --- doubleEmptyOption=true doubleMultiple=true / - In versions previous to 2.0.9, the associated action executes perfectly and everything works. The execution order in the action layer goes like this: 1) Prepare is called. 2) saveScanNotifications (method in Action mapped class) is called. 3) Prepare is called. In 2.0.9 the associated action executes in a different order and thus throws NullPointerExceptions. Here is what happens in 209: 1) Prepare is called. 2) Prepare is called. 3) saveScanNotifications (method in Action mapped class) is called. When the above happens the first prepare works and retrieves the object from the db by id correctly. When the second prepare happens, all of a sudden there is no id to load , or object present from the previous prepare. Almost like it is being called without any knowledge of the request context. Then saveScanNotifications is called and exceptions hit everywhere b/c the object was not loaded. Does anyone have an idea on what might have changed in 2.0.9 or where we may have gone wrong? Thanks, Brian- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 and Tomcat JDBCRealm
Hi, I am trying to add user authetication using tomcat JDBCRealm in my struts-2 application. But I don't seem to get it working. Has anyone tried it ? I have configured web.xml and my context.xml for Form based validation. but after I click submit, it goes back to error page described in web.xml for Realm. I would appreciate if you could describe me steps. Leena - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: about Struts 2.0.9 portlet example ...
It is true that inter portlet communication is not supported in the JSR168 spec, but there are ways to exchange data between portlets in a less proprietary manner. The easiest way is to use the shared session scope which is available to all portlets in the same portlet application (same war file). So if you have portlets that need to communicate, put them in the same application (which they probably should anyway, since they obviously have some relation). Without having tried it, you might also be able to build something on top of a distributed caching/JMS/database system. The Portlet 2.0 (JSR 286) specification includes support for inter portlet communication. The main advantage using Struts 2 (or any web framework that support portlets) is that you get a framework on top of the portlet API. I am not aware of any framework support for the IBM Portlet API (besides a custom struts framework that really wasn't any good the last time I tried it), so it would be like programming servlets in a web application. But still, if you know that inter portlet communication will be important for your application, and none of the proposed solutions are good enough for you to use, I guess you don't have a choice but lock yourself to a vendor. Nils-H On 10/24/07, Guillaume Bilodeau [EMAIL PROTECTED] wrote: Ok thanks, that's good to know. There is a strong recommendation coming from a colleague to use the IBM Portlet API on WebSphere Portal, particularly because of its support for inter-portlet communication - from what I'm told, this isn't supported by the standard JSR-168 API. I'm not too keen on using proprietary extensions, unless it does provide a significant advantage. Would Struts2 provide the necessary mechanism to accomplish this communication? What are the advantages of using Struts2 on top of the standard portlet API or the IBM API? Thanks again, GB Nils-Helge Garli wrote: The portlet support in the next 2.0.x and 2.1.x has been improved a lot. You can browse the changelogs and remaining issues in the issue tracker. It does not include Ajax support, but you can add that yourself. I know of several projects that are using it in production already. Nils-H On 10/23/07, Guillaume Bilodeau [EMAIL PROTECTED] wrote: We will soon start a portal project and we're evaluating the technologies available to us. Is Struts2 support for portlets ready for primetime, or should we use something else until it's stabilized? Cheers, GB Nils-Helge Garli wrote: Hi! If you're thinking of the struts2-portlet application, you need to install it into a portlet container to test it. However, ajax is not yet built into the portlet framework. Nils-H On 10/18/07, Giovanni Azua [EMAIL PROTECTED] wrote: hi all, I managed to see the examples in the portlet webapp demo (there is no index page) but I didn't see any portlet anywhere ... so I am curious as if to there is at all an AJAX portlet control delivered with Struts 2? Lack of portlets in S2 and AJAxification of displaytag would be the two main reasons for me to use ajaxtags in addition to S2. Any alternatives to ajaxtags? regards, Giovanni - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/about-Struts-2.0.9-portlet-example-...-tf4646784.html#a13356144 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/about-Struts-2.0.9-portlet-example-...-tf4646784.html#a13394151 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]