How to call to another action from the action class
Hi Guys, I want to call to another action mapping which has defined in the struts.xml file within another action class, its like this, *struts.xml* /pages/ext/summary.jsp currently im inside of another Action class, from that action class i need to call to the above mentioned action mapping... is there anyway to do this.? -- Regards Kushan Jayathilake
How to render HTML in Form Tag Label?
Hi All, As part of a registration form, I want to have a checkbox that lets the user agree to some terms: ( ) I agree to the _Terms of Service_ Where _Terms of Service_ should be a link to another page with some legal mumbo jumbo. The obvious code is: Unfortunately the HTML for is encoded and rendered as code, rather than as HTML: ( ) I agree to the Terms of Service Viewing the source shows that < and > have been changed to < and >, respectively. Is there a way to tell struts not to use the label text as-is? - David - - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Validating mutltiple uploads in a single action
I think it would best to validate the type in a 'validate' function and make your action implement Validateable. It will give you greater control on the action/field errors that you present to the end user as well. Thanks, Burton On 6/23/10, john.vargh...@smartonline.com wrote: > Hi, > I have two file fields in my Action, one is an Image and one is a > document. Is there a way I can use the allowedTypes filter to specify the > valid content types specific to each type of field in the same action > > Thanks in advance. > > Regards, > > > JOHN VARGHESE > Sr. Developer > > Smart Online > 4505 EmperorBoulevard, Suite 320, Durham, NC 27703 > T (919) 237 4172F (919) 237 4259[http://www.smartonline.com/] > www.smartonline.com > > Note: The information contained in this email is privileged and confidential > information intended for the use of the addressee. If the reader of this > email is not the intended recipient, or the employee or agent thereof, you > are hereby notified that any dissemination, distribution, or copying of this > communication is strictly prohibited. If you received this email in error, > please immediately notify the sender listed above and destroy this message -- Sent from my mobile device - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: IMPORTANT Call action on application deploy, like servlet with load-on-startup (Struts 2)
Create a servlet that makes a request to the action. Gustavo Felisberto On 23 de Jun de 2010, at 19:03, Oscar wrote: > Hi to all, i have the next situation: I need to call an action on > application startup like you can call a servlet on application startup > by setting parameter servlet on web.xml . I can't > use a servlet because i need to trigger my interceptors that > initialize JPA EntityManager . Is there a way to achieve this? > > Best regards. > > -- > Oscar Calderón > SCJP 6 > http://www.javahowto.net/ > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Validating mutltiple uploads in a single action
Hi, I have two file fields in my Action, one is an Image and one is a document. Is there a way I can use the allowedTypes filter to specify the valid content types specific to each type of field in the same action Thanks in advance. Regards, JOHN VARGHESE Sr. Developer Smart Online 4505 EmperorBoulevard, Suite 320, Durham, NC 27703 T (919) 237 4172F (919) 237 4259[http://www.smartonline.com/] www.smartonline.com Note: The information contained in this email is privileged and confidential information intended for the use of the addressee. If the reader of this email is not the intended recipient, or the employee or agent thereof, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you received this email in error, please immediately notify the sender listed above and destroy this message
Re: Modify JSON Format?
Any example of how to do option #2? -- Michael Griffith Managing Partner, OpenPrinciple Consulting, LLC. http://www.openprinciple.com On Jun 23, 2010, at 12:21 AM, Rahul Mohan wrote: Hi, I don't think the plugin has any option like that. But, even if you manage to do that how will you ensure that the order of data returned will match the order of grid columns on the client? You have two options: 1. Use a List of List on your action class itself so that the order is preserved. The json plugin serialized an Iterable into a JSON array and a bean to { name: value,. } structure. So you will end up having the array of array in your JSON as well. 2. Post process the JSON data on your ajax callback function before feeding it to the table. (You also have the order available on client from the table declaration, so it should be easy. ) Regards, Rahul Mohan From: Ozu Natsu To: Struts Users Mailing List Date: 22-06-2010 20:57 Subject: Modify JSON Format? Hi, I am using JSON plugin to return data to JQuery DataTable, but format is not compatible with Datatable plugin. I have a collection with a getter function on my struts2 action that is annotated with @JSON annotation. The action returns an array of objects, such as: {"aaData":[",{"age":2,"breed":"Unkown","gender":"Female","id": 2,"name":"Snowflake 2"}, ...} when what I really wany is an array of arrays: aaData: [ [ 2, Unknown, Female, 2, Snowflake 2 ], [ ...] ] As I understand it, both forms of the notation are valid. Is there any way to configure the plug in to modify the style/format of JSON to render the array of arrays without hand rolling my own function to return the data in a string? Using struts 2.1.8.1 Thank you. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org =-=-= Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: IMPORTANT Call action on application deploy, like servlet with load-on-startup (Struts 2)
If u have used spring in ur application then u can use the init-method. Here is how it works You can configure your war to load the spring upon app start-up. The init method will auomatically get invoked. Sent from my iPhone On Jun 23, 2010, at 11:03 AM, Oscar wrote: > Hi to all, i have the next situation: I need to call an action on > application startup like you can call a servlet on application startup > by setting parameter servlet on web.xml . I can't > use a servlet because i need to trigger my interceptors that > initialize JPA EntityManager . Is there a way to achieve this? > > Best regards. > > -- > Oscar Calderón > SCJP 6 > http://www.javahowto.net/ > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
IMPORTANT Call action on application deploy, like servlet with load-on-startup (Struts 2)
Hi to all, i have the next situation: I need to call an action on application startup like you can call a servlet on application startup by setting parameter servlet on web.xml . I can't use a servlet because i need to trigger my interceptors that initialize JPA EntityManager . Is there a way to achieve this? Best regards. -- Oscar Calderón SCJP 6 http://www.javahowto.net/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Get a list stored in the session to the struts tag
On 6/23/10 6:55 AM, Kushan Jayathilake wrote: Thank you very much for your quick reply, i have found the way, no need of that # sign there. That probably means that your action has a getSession() method. Since you may use that view layer page from a different action, or you may want to get something from the session when something other than your action is on top of the value stack, I'd suggest using the # notation. -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Get a list stored in the session to the struts tag
Yeah that seems working too :) Thanks mate -- Regards Kushan Jayathilake On Wed, Jun 23, 2010 at 4:29 PM, James Cook wrote: > Ah ok cool, > > Just checked my book and it says > > > > > > > Are also valid. > > (Bonus points to anyone out there that can name the book ;) ) > > -Original Message- > From: Kushan Jayathilake [mailto:kusha...@gmail.com] > Sent: 23 June 2010 11:55 > To: Struts Users Mailing List > Subject: Re: Get a list stored in the session to the struts tag > > Hi James, > > Thank you very much for your quick reply, i have found the way, > > > > no need of that # sign there. > > Thanks again, you helped me to solve this :) > > -- > Regards > Kushan Jayathilake > > > On Wed, Jun 23, 2010 at 4:20 PM, James Cook > wrote: > > > Try %{#session.test} > > > > James > > > > -Original Message- > > From: Kushan Jayathilake [mailto:kusha...@gmail.com] > > Sent: 23 June 2010 11:49 > > To: Struts Users Mailing List > > Subject: Get a list stored in the session to the struts tag > > > > Hi Guys, > > > > I want to get a list stored in the session and feed that value in to > the > > iterator... i have done like as shown below, but its not working > > > > > > > > > > > > Can anyone suggest me how to do this..? > > > > > > -- > > Regards > > Kushan Jayathilake > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
RE: Get a list stored in the session to the struts tag
Ah ok cool, Just checked my book and it says Are also valid. (Bonus points to anyone out there that can name the book ;) ) -Original Message- From: Kushan Jayathilake [mailto:kusha...@gmail.com] Sent: 23 June 2010 11:55 To: Struts Users Mailing List Subject: Re: Get a list stored in the session to the struts tag Hi James, Thank you very much for your quick reply, i have found the way, no need of that # sign there. Thanks again, you helped me to solve this :) -- Regards Kushan Jayathilake On Wed, Jun 23, 2010 at 4:20 PM, James Cook wrote: > Try %{#session.test} > > James > > -Original Message- > From: Kushan Jayathilake [mailto:kusha...@gmail.com] > Sent: 23 June 2010 11:49 > To: Struts Users Mailing List > Subject: Get a list stored in the session to the struts tag > > Hi Guys, > > I want to get a list stored in the session and feed that value in to the > iterator... i have done like as shown below, but its not working > > > > > > Can anyone suggest me how to do this..? > > > -- > Regards > Kushan Jayathilake > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Get a list stored in the session to the struts tag
Hi James, Thank you very much for your quick reply, i have found the way, no need of that # sign there. Thanks again, you helped me to solve this :) -- Regards Kushan Jayathilake On Wed, Jun 23, 2010 at 4:20 PM, James Cook wrote: > Try %{#session.test} > > James > > -Original Message- > From: Kushan Jayathilake [mailto:kusha...@gmail.com] > Sent: 23 June 2010 11:49 > To: Struts Users Mailing List > Subject: Get a list stored in the session to the struts tag > > Hi Guys, > > I want to get a list stored in the session and feed that value in to the > iterator... i have done like as shown below, but its not working > > > > > > Can anyone suggest me how to do this..? > > > -- > Regards > Kushan Jayathilake > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
RE: Get a list stored in the session to the struts tag
Try %{#session.test} James -Original Message- From: Kushan Jayathilake [mailto:kusha...@gmail.com] Sent: 23 June 2010 11:49 To: Struts Users Mailing List Subject: Get a list stored in the session to the struts tag Hi Guys, I want to get a list stored in the session and feed that value in to the iterator... i have done like as shown below, but its not working Can anyone suggest me how to do this..? -- Regards Kushan Jayathilake - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Get a list stored in the session to the struts tag
Hi Guys, I want to get a list stored in the session and feed that value in to the iterator... i have done like as shown below, but its not working Can anyone suggest me how to do this..? -- Regards Kushan Jayathilake
Re: Page composition strategy
BTW, any of those two are easily integrated into S2 as plugins (in fact already bundled with S2 distribution, just add the jars): http://struts.apache.org/2.1.8.1/docs/tiles-plugin.html http://struts.apache.org/2.1.8.1/docs/sitemesh-plugin.html I've been using Tiles and always found it confusing a little bit, now that I'm starting to test Sitemesh my vote would be for this last one. They accomplish the same thing, only Tiles is like saying each time "my page is made up of this, this and this". Sitemesh is more about taking a piece of a page and decorate it into a full page (more like "intercepting" or filtering). Allow me to throw in a vote for Sitemesh. I've never used Tiles, so I can't directly compare the two, but Sitemesh is quite easy to use and incredibly powerful for this sort of thing. You define it as a servlet filter in your project, and it adds decoration to the requests that come through. The JSPs never even have to know that they're being decorated in the first place! -Brian On Tue, Jun 22, 2010 at 1:35 PM, satyanarayana katta wrote: U should try tiles for this Sent from my iPhone On Jun 22, 2010, at 10:03 AM, "Antonio S." wrote: Hello. I'm a beginner in web development with Struts2 and I'm planning the structure of my application. Let me tell you my problem. With 'page composition strategy' I mean the strategy for making all pages in the application share the same HTML structure (header, left-column, content, right column, footer) using template inclusion mechanisms or others. Currently I'm using inclusion and all my JSPs share the same structure: A. 'include' prelude content: header, left-column. B. Specific content. C. 'include' coda content: right-column, footer. I don't like this approach and I'm thinking about alternatives; I wonder if Struts2 can help with this: i. Use the very same JSP template for all requests. That template would include specific content by calling the corresponding segment. This would involve a default result pointing to this JSP template and some means of specifying the name of the specific segment that will be invoked from inside the main template. ii. Use result pages as segments and render only specific content. Later on, some interceptor or servlet filter would include prelude and coda in the output stream. So, my questions are: 1. Can you recommend the best practice for page composition in Struts2? 2. Can I use Struts2 for implementing above mentioned strategies i. and ii.? How? Thanks for your time. Regards. Antonio. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Page composition strategy
I've been using Tiles and always found it confusing a little bit, now that I'm starting to test Sitemesh my vote would be for this last one. They accomplish the same thing, only Tiles is like saying each time "my page is made up of this, this and this". Sitemesh is more about taking a piece of a page and decorate it into a full page (more like "intercepting" or filtering). Allow me to throw in a vote for Sitemesh. I've never used Tiles, so I can't directly compare the two, but Sitemesh is quite easy to use and incredibly powerful for this sort of thing. You define it as a servlet filter in your project, and it adds decoration to the requests that come through. The JSPs never even have to know that they're being decorated in the first place! -Brian On Tue, Jun 22, 2010 at 1:35 PM, satyanarayana katta wrote: U should try tiles for this Sent from my iPhone On Jun 22, 2010, at 10:03 AM, "Antonio S." wrote: Hello. I'm a beginner in web development with Struts2 and I'm planning the structure of my application. Let me tell you my problem. With 'page composition strategy' I mean the strategy for making all pages in the application share the same HTML structure (header, left-column, content, right column, footer) using template inclusion mechanisms or others. Currently I'm using inclusion and all my JSPs share the same structure: A. 'include' prelude content: header, left-column. B. Specific content. C. 'include' coda content: right-column, footer. I don't like this approach and I'm thinking about alternatives; I wonder if Struts2 can help with this: i. Use the very same JSP template for all requests. That template would include specific content by calling the corresponding segment. This would involve a default result pointing to this JSP template and some means of specifying the name of the specific segment that will be invoked from inside the main template. ii. Use result pages as segments and render only specific content. Later on, some interceptor or servlet filter would include prelude and coda in the output stream. So, my questions are: 1. Can you recommend the best practice for page composition in Struts2? 2. Can I use Struts2 for implementing above mentioned strategies i. and ii.? How? Thanks for your time. Regards. Antonio. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [struts2]Provider org.apache.xalan.processor.TransformerFactoryImpl not found
Hi Prabesh, I was also facing the same issue with JDK1.6 and Tomcat6. I tried your solution and it worked. I removed xmlParserAPIs.jar from tomcat6\common\endorsed. Thanks for your post, -Abhishek -- View this message in context: http://old.nabble.com/-struts2-Provider-org.apache.xalan.processor.TransformerFactoryImpl-not-found-tp7641415p28969382.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org