Re: Factoring out URL and link generation
Dear user list, How difficult and risky it is to shift my project from struts 2.0.x to 2.1.8.x. I have a very huge erp project done 80% in struts 2.0.x, will you recommend to use new struts or complete the project without any major change.
Migrating from Struts 2.0.x to 2.1.8.x
On Wed, Jun 16, 2010 at 12:05 PM, Amol Ghotankar wrote: > Dear user list, > > How difficult and risky it is to shift my project from struts 2.0.x to > 2.1.8.x. > > I have a very huge erp project done 80% in struts 2.0.x, will you recommend > to use new struts or complete the project without any major change. >
Action redirect back to called actions
Hello. I am using struts 2.0.x and facing one issue mentioned below. I have actions x, y, z from these three actions I can call action A. Now what i want is whichever action calls A success of A must redirect to called action. x---> A ---> x y---> A ---> y z---> A ---> z But I also do not want to use static binding here and it must be automatically done for some action means if tomorrow I decide n---> A ---> n, it must work without any changes. Can I write such result type or something from where I can get the called action from value stack etc.. Please help me on the same. Regards, Amol Ghotankar cursivetech.com
Re: Action redirect back to called actions
Dear Greg. Thanks for the information. Is this an inbuilt variable or we need to define it somewhere in the calling action. Can we also the namespace of the calling action in the called action directly. Regards, Amol Ghotankar cursivetech.com On Thu, Jun 17, 2010 at 6:31 PM, Greg Lindholm wrote: > You can configure a dynamic result like this: > > >${nextAction} > > > In your action class you would then need a method "String > getNextAction()" that returns the next action name. > > > On Thu, Jun 17, 2010 at 1:19 AM, Amol Ghotankar > wrote: > > Hello. > > > > I am using struts 2.0.x and facing one issue mentioned below. > > > > I have actions x, y, z from these three actions I can call action A. > > > > Now what i want is whichever action calls A success of A must redirect to > > called action. > > > > x---> A ---> x > > > > y---> A ---> y > > > > z---> A ---> z > > > > But I also do not want to use static binding here and it must be > > automatically done for some action means if tomorrow I decide > > > > n---> A ---> n, it must work without any changes. > > > > Can I write such result type or something from where I can get the called > > action from value stack etc.. > > > > Please help me on the same. > > > > Regards, > > > > > > Amol Ghotankar > > cursivetech.com > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Action redirect back to called actions
Dear Greg, I understood this of how to redirect to next action. But I want to get the previous action from the context which called this action. For eg. LoginAction calls LoadHomeAction, so can I get the details of which action called LoadHomeAction in it. Inshort *can the called Action get the details of calling action directly from the context *or value stack etc.. Please guide me. With regards, Amol Ghotankar cursivetech.com On Thu, Jun 17, 2010 at 7:17 PM, Amol Ghotankar wrote: > Dear Greg. > > Thanks for the information. > > Is this an inbuilt variable or we need to define it somewhere in the > calling action. > > Can we also the namespace of the calling action in the called action > directly. > > > Regards, > > Amol Ghotankar > > cursivetech.com > > On Thu, Jun 17, 2010 at 6:31 PM, Greg Lindholm wrote: > >> You can configure a dynamic result like this: >> >> >>${nextAction} >> >> >> In your action class you would then need a method "String >> getNextAction()" that returns the next action name. >> >> >> On Thu, Jun 17, 2010 at 1:19 AM, Amol Ghotankar >> wrote: >> > Hello. >> > >> > I am using struts 2.0.x and facing one issue mentioned below. >> > >> > I have actions x, y, z from these three actions I can call action A. >> > >> > Now what i want is whichever action calls A success of A must redirect >> to >> > called action. >> > >> > x---> A ---> x >> > >> > y---> A ---> y >> > >> > z---> A ---> z >> > >> > But I also do not want to use static binding here and it must be >> > automatically done for some action means if tomorrow I decide >> > >> > n---> A ---> n, it must work without any changes. >> > >> > Can I write such result type or something from where I can get the >> called >> > action from value stack etc.. >> > >> > Please help me on the same. >> > >> > Regards, >> > >> > >> > Amol Ghotankar >> > cursivetech.com >> > >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> >
Jasper Report Problem in HTML format
Dear List members, I have successfully embedded jasper reports with struts 2, thanks to the documentation. Only major problem that i am facing is when I give format as HTML in xml file, the html page opens but the images are not found. What can be done so that the path of images will be taken correctly. I tried a lot but I am not successful. Please help urgently. On Sun, Jun 20, 2010 at 2:44 AM, Brian Thompson wrote: > " /> > > Brian > > On Jun 19, 2010 5:01 AM, "Fabio Perfetti" wrote: > > Hi all, before to start, i want say sorry for my bad english. > I am developing an easy social network for a university project > > Every User has an image for the profile. > > I want to list all friends, and i want display Name, Surname and the image. > So i have an action that retrieve the list of friends: > > public String list() { > Utente utente; > utente = (Utente) session > .get(AuthenticationInterceptor.authenticationSessionField); > utenteDao.update(utente.getId()); > setListaAmici(utente.getListaAmici()); > System.out.println("total friends: " + listaAmici.size()); > return SUCCESS; > } > > Now I have a list of Users. So in my jsp: > > friends : > > > > > > > > I don't know how do it! > The database save the name of the image. > > Sorry for my bad english. > Thanks > Fabio >
Re: Jasper Report Problem in HTML format
Dear List members, When I try to see the HTML page it shows path of images as src="/images/px" But in web content images folder no such images are created, nor they are created any where on my disk. Does this means that their is a bug in Struts 2 that it does not properly create images required for report for HTML format. Other formats like pdf, xls work perfectly fine. Generally where are these images stored??? In temp dir or in tomcat server or in project dir or somewhere else on disk. Can we change it. I am trying it very hard but not able to get any solution as images are created dynamically. On Sun, Jun 20, 2010 at 4:34 PM, Amol Ghotankar wrote: > Dear List members, > > I have successfully embedded jasper reports with struts 2, thanks to the > documentation. > > Only major problem that i am facing is when I give format as HTML in xml > file, the html page opens but the images are not found. > > What can be done so that the path of images will be taken correctly. > > I tried a lot but I am not successful. > > Please help urgently. > > On Sun, Jun 20, 2010 at 2:44 AM, Brian Thompson wrote: > >> " /> >> >> Brian >> >> On Jun 19, 2010 5:01 AM, "Fabio Perfetti" wrote: >> >> Hi all, before to start, i want say sorry for my bad english. >> I am developing an easy social network for a university project >> >> Every User has an image for the profile. >> >> I want to list all friends, and i want display Name, Surname and the >> image. >> So i have an action that retrieve the list of friends: >> >> public String list() { >> Utente utente; >> utente = (Utente) session >> .get(AuthenticationInterceptor.authenticationSessionField); >> utenteDao.update(utente.getId()); >> setListaAmici(utente.getListaAmici()); >> System.out.println("total friends: " + listaAmici.size()); >> return SUCCESS; >> } >> >> Now I have a list of Users. So in my jsp: >> >> friends : >> >> >> >> >> >> >> >> I don't know how do it! >> The database save the name of the image. >> >> Sorry for my bad english. >> Thanks >> Fabio >> > >
Re: Jasper Report Problem in HTML format
As per my knowleadge they are not getting generated properly, as i tried to search them on all possible folders, evern via searching in my computer. Has anyone tried jasper reports in html format before? PDF & XLS working perfectly fine and images are generated and displayed there with no problem. Please let me know if its problem in struts or jasper or my project, so that my efforts will get some direction. On Sun, Jun 20, 2010 at 6:59 PM, Brian Thompson wrote: > Are the images saved as temp files and accessed as files through tomcat, or > are they generated on access by something like /getImage.action? > > On Jun 20, 2010 6:12 AM, "Amol Ghotankar" wrote: > > Dear List members, > > When I try to see the HTML page it shows path of images as src="/images/px" > > But in web content images folder no such images are created, nor they are > created any where on my disk. > > Does this means that their is a bug in Struts 2 that it does not properly > create images required for report for HTML format. > > Other formats like pdf, xls work perfectly fine. > > Generally where are these images stored??? In temp dir or in tomcat server > or in project dir or somewhere else on disk. Can we change it. > > I am trying it very hard but not able to get any solution as images are > created dynamically. > > > > On Sun, Jun 20, 2010 at 4:34 PM, Amol Ghotankar >wrote: > > > > Dear List members, > > > > I have successfully embedded jasper reports with struts 2, thanks to the > >... >
Re: Jasper Report Problem in HTML format
Dear List members, My problem is still not resolved. I am not able to show jasper reports in html format in struts 2. The images that are generated in html format are missing. Please help me on it. Regards, Amol ghotankar On Sun, Jun 20, 2010 at 11:56 PM, Amol Ghotankar wrote: > As per my knowleadge they are not getting generated properly, as i tried to > search them on all possible folders, evern via searching in my computer. > > Has anyone tried jasper reports in html format before? > > PDF & XLS working perfectly fine and images are generated and displayed > there with no problem. > > Please let me know if its problem in struts or jasper or my project, so > that my efforts will get some direction. > > > > On Sun, Jun 20, 2010 at 6:59 PM, Brian Thompson wrote: > >> Are the images saved as temp files and accessed as files through tomcat, >> or >> are they generated on access by something like /getImage.action? >> >> On Jun 20, 2010 6:12 AM, "Amol Ghotankar" >> wrote: >> >> Dear List members, >> >> When I try to see the HTML page it shows path of images as >> src="/images/px" >> >> But in web content images folder no such images are created, nor they are >> created any where on my disk. >> >> Does this means that their is a bug in Struts 2 that it does not properly >> create images required for report for HTML format. >> >> Other formats like pdf, xls work perfectly fine. >> >> Generally where are these images stored??? In temp dir or in tomcat server >> or in project dir or somewhere else on disk. Can we change it. >> >> I am trying it very hard but not able to get any solution as images are >> created dynamically. >> >> >> >> On Sun, Jun 20, 2010 at 4:34 PM, Amol Ghotankar > >wrote: >> >> >> > Dear List members, >> > >> > I have successfully embedded jasper reports with struts 2, thanks to the >> >... >> > >
Re: Jasper Report Problem in HTML format
Yes it could be path issue, but the images point to the images folder in web content. No images are generated in my case as I have searched them everywhere. Where are the images generally kept when using jasper reports in html format using struts2. On Mon, Jun 21, 2010 at 5:55 PM, Rahul Mohan wrote: > Looks like its a path issue. Please see if the image tags in the generated > HTML point to the proper URL for images. > > > > > From: > Amol Ghotankar > To: > Struts Users Mailing List > Date: > 21-06-2010 17:21 > Subject: > Re: Jasper Report Problem in HTML format > > > > Dear List members, > > My problem is still not resolved. > > I am not able to show jasper reports in html format in struts 2. > > The images that are generated in html format are missing. > > Please help me on it. > > Regards, > > Amol ghotankar > > On Sun, Jun 20, 2010 at 11:56 PM, Amol Ghotankar > wrote: > > > As per my knowleadge they are not getting generated properly, as i tried > to > > search them on all possible folders, evern via searching in my computer. > > > > Has anyone tried jasper reports in html format before? > > > > PDF & XLS working perfectly fine and images are generated and displayed > > there with no problem. > > > > Please let me know if its problem in struts or jasper or my project, so > > that my efforts will get some direction. > > > > > > > > On Sun, Jun 20, 2010 at 6:59 PM, Brian Thompson > wrote: > > > >> Are the images saved as temp files and accessed as files through > tomcat, > >> or > >> are they generated on access by something like /getImage.action? > >> > >> On Jun 20, 2010 6:12 AM, "Amol Ghotankar" > >> wrote: > >> > >> Dear List members, > >> > >> When I try to see the HTML page it shows path of images as > >> src="/images/px" > >> > >> But in web content images folder no such images are created, nor they > are > >> created any where on my disk. > >> > >> Does this means that their is a bug in Struts 2 that it does not > properly > >> create images required for report for HTML format. > >> > >> Other formats like pdf, xls work perfectly fine. > >> > >> Generally where are these images stored??? In temp dir or in tomcat > server > >> or in project dir or somewhere else on disk. Can we change it. > >> > >> I am trying it very hard but not able to get any solution as images are > >> created dynamically. > >> > >> > >> > >> On Sun, Jun 20, 2010 at 4:34 PM, Amol Ghotankar > >> >wrote: > >> > >> > >> > Dear List members, > >> > > >> > I have successfully embedded jasper reports with struts 2, thanks to > the > >> >... > >> > > > > > > > =-=-= > 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 > > >
Re: Jasper Report Problem in HTML format
Dear List memebers, I tried it, but it was given error. Error is in struts 2.0.x as bug the work around is mentioned on the following link https://issues.apache.org/jira/browse/WW-2324?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel And IT WORKS. On Mon, Jun 21, 2010 at 11:55 PM, Celinio Fernandes wrote: > Hi, > I ran into the same problem a while ago. > > The JasperReports plugin works with a servlet to > display the images. > The attribute to add is imageServletUrl : > > > name="imageServletUrl">/servlets/image?image= > > Of > course you need to declare that servlet in your web.xml : > > > >ImageServlet > > > net.sf.jasperreports.j2ee.servlets.ImageServlet > > > > > ImageServlet > > /servlets/image > > > > HTH > Best regards, > Celinio > Fernandes > > --- On Mon, 6/21/10, Amol Ghotankar wrote: > > From: Amol Ghotankar > Subject: Re: Jasper Report Problem in HTML format > To: "Struts Users Mailing List" > Date: Monday, June 21, 2010, 9:25 AM > > Yes it could be path issue, but the images point to the images folder in > web > content. > > No images are generated in my case as I have searched them everywhere. > > Where are the images generally kept when using jasper reports in html > format > using struts2. > > On Mon, Jun 21, 2010 at 5:55 PM, Rahul Mohan wrote: > > > Looks like its a path issue. Please see if the image tags in the > generated > > HTML point to the proper URL for images. > > > > > > > > > > From: > > Amol Ghotankar > > To: > > Struts Users Mailing List > > Date: > > 21-06-2010 17:21 > > Subject: > > Re: Jasper Report Problem in HTML format > > > > > > > > Dear List members, > > > > My problem is still not resolved. > > > > I am not able to show jasper reports in html format in struts 2. > > > > The images that are generated in html format are missing. > > > > Please help me on it. > > > > Regards, > > > > Amol ghotankar > > > > On Sun, Jun 20, 2010 at 11:56 PM, Amol Ghotankar > > wrote: > > > > > As per my knowleadge they are not getting generated properly, as i > tried > > to > > > search them on all possible folders, evern via searching in my > computer. > > > > > > Has anyone tried jasper reports in html format before? > > > > > > PDF & XLS working perfectly fine and images are generated and displayed > > > there with no problem. > > > > > > Please let me know if its problem in struts or jasper or my project, so > > > that my efforts will get some direction. > > > > > > > > > > > > On Sun, Jun 20, 2010 at 6:59 PM, Brian Thompson > > wrote: > > > > > >> Are the images saved as temp files and accessed as files through > > tomcat, > > >> or > > >> are they generated on access by something like /getImage.action? > > >> > > >> On Jun 20, 2010 6:12 AM, "Amol Ghotankar" > > >> wrote: > > >> > > >> Dear List members, > > >> > > >> When I try to see the HTML page it shows path of images as > > >> src="/images/px" > > >> > > >> But in web content images folder no such images are created, nor they > > are > > >> created any where on my disk. > > >> > > >> Does this means that their is a bug in Struts 2 that it does not > > properly > > >> create images required for report for HTML format. > > >> > > >> Other formats like pdf, xls work perfectly fine. > > >> > > >> Generally where are these images stored??? In temp dir or in tomcat > > server > > >> or in project dir or somewhere else on disk. Can we change it. > > >> > > >> I am trying it very hard but not able to get any solution as images > are > > >> created dynamically. > > >> > > >> > > >> > > >> On Sun, Jun 20, 2010 at 4:34 PM, Amol Ghotankar > > > >> >wrote: > > >> > > >> > > >> > Dear List members, > > >> > > > >> > I have successfully embedded jasper reports with struts 2, thanks to > > the > > >> >... > > >> > > > > > > > > > > > > =-=-= > > 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 > > > > > > > > > > >
Creating Sub-Domains from Struts 2 application
Dear List member, I have a requirement in which when a user registers on the portal developed using struts 2, a sub-domain should be created for him. Like say Amol registers on cursivetech.com, then when he logs into his account it must look like amol.cursivetech.com How to make such arrangement and create such sub-domains directly from the application itself. Regards, Amol Ghotankar, cursivetech.com
Re: Creating Sub-Domains from Struts 2 application
Dear List member, I understand this is not a single struts issue. It is combination of many, What i want is the application to create sub-domain for each users automatically like the site https://username.tactilecrm.com/welcome/ or http://tactilecrm.com/ In this site you register for free and your username is created as a sub-domain. Regards, Amol Ghotankar On Tue, Jun 29, 2010 at 2:06 PM, Gustavo Felisberto < gustavo.felisbe...@wit-software.com> wrote: > Hello Amol, > > This does not seem to be 100% struts related. If you want > gustavo.domain.com > to exist you either have to create the sub-domain (and how you do that > really depends on the DNS server being used) or you can have a record like: > *.domain.com 192.168.1.1 > > In this case all requests will be sent to that server and you can have > logic > on your application that looks at the request and knows the username. > > Gustavo > > -Mensagem original- > De: Amol Ghotankar [mailto:ghotankaru...@gmail.com] > Enviada: terça-feira, 29 de Junho de 2010 05:26 > Para: Struts Users Mailing List > Assunto: Creating Sub-Domains from Struts 2 application > > Dear List member, > > I have a requirement in which when a user registers on the portal developed > using struts 2, a sub-domain should be created for him. > > Like say Amol registers on cursivetech.com, then when he logs into his > account it must look like amol.cursivetech.com > > How to make such arrangement and create such sub-domains directly from the > application itself. > > Regards, > > Amol Ghotankar, > cursivetech.com > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
set a list from getmodel()
Dear List memeber, I have a urgent requirement in which I will have to populate a list or set and this set / list will be getModel() for an struts action. How to write jsp code so that the set is populated directly here. Like say I have a list of address and from form address 1 address 2 address 3 is submitted and it goes directly into set which is part of user.addres user object is having set of address. What should be done on jsp so that when action is called this set is automatically populated.
Re: set a list from getmodel()
Dear List members, More over I don;t know how many address will the user enter, it can 0 or 10, need to generate jsp code dynamically Address [+] How are we going to achieve this type of functionality. What are best practices in setting multiple values of same object from FORM or how to set multiple objects of same type from FORMS. Help needed and appreciated. Regards, Amol Ghotankar. On Thu, Jul 1, 2010 at 1:03 PM, Amol Ghotankar wrote: > Dear List memeber, > > I have a urgent requirement in which I will have to populate a list or set > and this set / list will be getModel() for an struts action. > > How to write jsp code so that the set is populated directly here. > > Like say I have a list of address and from form > > address 1 > address 2 > address 3 > > is submitted > > and it goes directly into set which is part of user.addres > > user object is having set of address. > > What should be done on jsp so that when action is called this set is > automatically populated. >
Authorization Best Practices
Dear List members, Using Struts 2.x can we do authorization of client request, if yes what are the best practices for the same please discuss. Authorization will have two parts 1. decide which action are allowed and which are not, 2 . decide how much data to access. Means if I have a database which has 100 rows, then to show 100 or 10 or 50 based on the role of the user and this authorization permissions. Also how to handle unauthorized request and redirect to called action or some other page. There are several ways we can discuss all here. With Best Regards, Amol Ghotankar Cursive Technologies Pvt. Ltd. www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
Re: Authorization Best Practices
Dear List members, 1. decide which action are allowed and which are not, What I used was a spring AOP which intercepted Struts 2 actions, this was very simple and straight forward. 2 . decide how much data to access. This I am really working something where struts2 intercepter will read what role the user has and set some global role for that reqest which will be read by dao to use to fetch the data. 3. Regarding Notice I think somehow my firewall intercepted it and added to the mail, I am sorry for it. On Wed, Jul 7, 2010 at 7:52 PM, Brian Thompson wrote: > On Wed, Jul 7, 2010 at 8:31 AM, Dale Newfield wrote: > > Including a notice like this on a request for help sent to a public, > > archived mailing list is obnoxious. JSYK, I've been seriously > considering > > instituting a personal policy whereby I will never respond to such > messages. > > > > -Dale > > I think you mistyped "Including a notice like this in an email" ;) > > I really don't get where all these "OMG CONFIDENTIAL" notices come > from. One wouldn't use postcards to snail-mail confidential > information. > > As to authorization - I agree that Spring Security is a good way to go. > > -Brian > -- With Best Regards, Amol Ghotankar
Re: Authorization Best Practices
Dear List member, The issue we are discussing here is Authorization using Struts2x. Part 1. How to control access of actions i.e which actions can be accessed by which user role Part 2 . How to control access of data from back end database based on action/user-role. i.e how much data should be returned through called action, 10 rows, 100 rows or 1000 rows from database, based on user role and/or called action. Part 1 has been simple and several simple ways have solved this issue. Part 2 is the major concern of discussion as isn't it a concern of MVC's C - Controller to control the data also? My actions know what data to be fetched but business layer can over-write it where as the actual data is beneath the DAO layer. So where can we intercept or we need to intercept all the three layers and have a combined policy using them. Regards, Amol Ghotankar On Wed, Jul 7, 2010 at 11:41 PM, Ken wrote: > On Wed, 2010-07-07 at 13:34 -0400, Dale Newfield wrote: > > > On 7/7/10 1:28 PM, Amol Ghotankar wrote: > > > 2 . decide how much data to access. > > > > > > This I am really working something where struts2 intercepter will read > what > > > role the user has and set some global role for that reqest which will > be > > > read by dao to use to fetch the data. > > > > The interceptor cannot know independent of the action/business logic > > what data will need to be fetched. I don't think you can solve this > > problem within struts Even if you do, you've then built a toolset that > > doesn't include any of these access restrictions in otherwise exposed > > services. > > > > -Dale > > > This is a hand rolled solution I used: > Create an interceptor which checks if a User object exists when > accessing a secure package, if it does not exist redirect the user to a > login page and record the initial url (will redirect back to that page > after login). I use hibernate... so the user object contains a > connection to the database. If you're also using hibernate you'll > notice you can supply the specific "hibernate.cfg.xml" when establishing > the connection, by making this choice dependant on the particular user > you can supply different database connections or even restrict data > access. In this case I think xml files are better than annotations as > you don't need to change the POJO which the *.hbm.xml files refer to. > > Sorry I'm not sure I really understood the issue, but this helped me a > lot and was very easy to implement. > > > > > > > > > > -- With Best Regards, Amol Ghotankar Technical Director Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
Re: Emailing the contents of a Struts2 view?
If you just want to send mail after some action is executed then I think you can do it by using action-redirect You can redirect the action to send email action. Regards, Amol Ghotankar On Thu, Jul 8, 2010 at 1:08 AM, Chris Miles wrote: > Is it posible for me to render a view after an action and be able to access > the HTML for sending in an email rather than rendering to a browser? > > thanks > > Chris --
Re: Authorization Best Practices
Dear List Members, Lot of theory put here now lets talk with example. Lets assume there are three roles a user can have 1. user 2. manager 3, admin Lets assume a simple CRUD use case which has four actions 1. insert 2. update 3. delete 4. list Now A. Part 1. 1. users loged in with user & manager role can access all actions except delete. B. Part 2 1. users logged in with role user can -insert any record but -update only records which he has inserted before -and also list records which he has inserted. 2. users logged in with role manage can - insert any record and - update any record enter by him and users under his department - list all records inserted by him and users under his department 3. users logged in with role admin can - insert any record and - update only his records not other users - list all records by him and other users - delete any record by him and other users Now I think the discussion will be more focus and we can discuss what practises can be followed to implement this logic using struts2 and related framework. Regards, Amol Ghotankar. On Thu, Jul 8, 2010 at 2:12 AM, Dale Newfield wrote: > On 7/7/10 2:26 PM, Amol Ghotankar wrote: > >> Part 2 . How to control access of data from back end database based on >> action/user-role. >> >> i.e how much data should be returned through called action, 10 rows, 100 >> rows or 1000 rows from database, based on user role and/or called action. >> > > Whether data should be accessible and how much data should be accessible > sound like orthogonal questions to me. Whether is a business logic or dao > question. How much is just a parameter passed to business logic and/or dao, > but is really more a question that the web layer should determine, no? > > > -Dale > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > --
Re: Emailing the contents of a Struts2 view?
Hi, What you want is the content of the mail to have result of the called action right? i.e if my actions return list which is iterated on jsp and displayed on jsp. So instead of showing it on browser u want to show it in the content of mail??? On Thu, Jul 8, 2010 at 2:10 PM, wrote: > Hi. > > Thanks for the response but that is not what I mean. I want to email the > contents of a view - a JSP which has been rendered after an action - but > to the contents of an email rather than the contents of a browser request. > > Chris > > > If you just want to send mail after some action is executed then > > > > I think you can do it by using > > > > action-redirect > > > > You can redirect the action to send email action. > > > > Regards, > > > > Amol Ghotankar > > > > On Thu, Jul 8, 2010 at 1:08 AM, Chris Miles > wrote: > > > >> Is it posible for me to render a view after an action and be able to > >> access > >> the HTML for sending in an email rather than rendering to a browser? > >> > >> thanks > >> > >> Chris > > > > > > > > > > -- > > > > > ----- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- With Best Regards, Amol Ghotankar Technical Director Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
Re: Emailing the contents of a Struts2 view?
Hi, I am not exactly sure of such return type, but what you can try with is- Create a html output of the result and save it on server disk. Use this saved html file to embed in email, most email now support html/ rich text emails. This i think may serve your purpose. As we used to mail pdf files as a result of action. You have a good point struts team must consider this as enhancement in future version, in case not supported directly now. On Thu, Jul 8, 2010 at 6:36 PM, wrote: > Yeah that is right. > > I want to maintain the MVC pattern, but using it for sending HTML emails > to clients rather than browser requests. It has to be the HTML within the > email itself rather than embedding an iframe to the website or a link to a > page. > > Chris > > > Hi, > > > > What you want is the content of the mail to have result of the called > > action > > right? > > > > i.e if my actions return list which is iterated on jsp and displayed on > > jsp. > > > > So instead of showing it on browser u want to show it in the content of > > mail??? > > > > On Thu, Jul 8, 2010 at 2:10 PM, wrote: > > > >> Hi. > >> > >> Thanks for the response but that is not what I mean. I want to email the > >> contents of a view - a JSP which has been rendered after an action - but > >> to the contents of an email rather than the contents of a browser > >> request. > >> > >> Chris > >> > >> > If you just want to send mail after some action is executed then > >> > > >> > I think you can do it by using > >> > > >> > action-redirect > >> > > >> > You can redirect the action to send email action. > >> > > >> > Regards, > >> > > >> > Amol Ghotankar > >> > > >> > On Thu, Jul 8, 2010 at 1:08 AM, Chris Miles > >> wrote: > >> > > >> >> Is it posible for me to render a view after an action and be able to > >> >> access > >> >> the HTML for sending in an email rather than rendering to a browser? > >> >> > >> >> thanks > >> >> > >> >> Chris > >> > > >> > > >> > > >> > > >> > -- > >> > > >> > >> > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > >> > > > > > > -- > > > > > > With Best Regards, > > > > Amol Ghotankar > > Technical Director > > Cursive Technologies Pvt. Ltd. > > 104, A1 Wing, W Sector, > > Masulkar Colony, Ajmera, > > Pimpri, Pune-18 INDIA > > O: +91 2020 270 570 > > M: +91 9960 980 419 > > www.cursivetech.com > > > > > > CURSIVE TECHNOLOGIES EMAIL NOTICE > > The information contained in this email and any attachments is > > confidential > > and may be subject to copyright or other intellectual property > protection. > > If you are not the intended recipient, you are not authorized to use or > > disclose this information, and we request that you notify us by reply > mail > > or telephone and delete the original message from your mail system. > > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Model Driven & Preparable
Dear List members, I have implemented model driven & prepare able interface in S2, also included interceptor stack My method call flow is 1.prepare 2.getModel 3.getModel Why does getModel gets called twice. Is it to useful to call it twice or is my config setting wrong somewhere. Also I create a object in my prepare method, but this method creates new object every-time rather than using the created object in previous prepare. With Best Regards, Amol Ghotankar
Re: Model Driven & Preparable
My interceptor stack is as below Please guide. On Tue, Jul 13, 2010 at 4:27 PM, Amol Ghotankar wrote: > Dear List members, > > > I have implemented model driven & prepare able interface in S2, also > included interceptor stack > > My method call flow is > > 1.prepare 2.getModel 3.getModel > Why does getModel gets called twice. Is it to useful to call it twice or is > my config setting wrong somewhere. > > Also I create a object in my prepare method, but this method creates new > object every-time rather than using the created object in previous prepare. > > > > With Best Regards, > > Amol Ghotankar > > -- With Best Regards, Amol Ghotankar Technical Director Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
Absolute Path for result
Dear List member, How can I give absolute path to my result page. web content - |---x |:-y | :-z |--w Eg: My namespace is /x/y/z and I want my error page which is in w folder in web content then i have to give relative path of ../../../w/error.jsp Can't i directly give w/error.jsp If current i give this path the struts searches it in x/y/z/w/error.jsp With Best Regards, Amol Ghotankar www.cursivetech.com
Re: Absolute Path for result
Dear Dale, i have used relative path of ../../../w/error.jsp Can't i directly give w/error.jsp - if i give so I struts searches it in x/y/z/w/error.jsp i.e relative to the namespace. I will have to try with /w/error.jsp Regards, Amol On Thu, Jul 22, 2010 at 7:38 PM, Dale Newfield wrote: > On 7/22/10 3:40 AM, Amol Ghotankar wrote: > >> Can't i directly give w/error.jsp >> > > "w/error.jsp" is a relative path. What happens if you specify > "/w/error.jsp"? > > -Dale > -- With Best Regards, Amol Ghotankar www.cursivetech.com
Re: Absolute Path for result
Dear Dale, Yes it works perfectly, thanks. So I can conclude if we give w/error.jsp it takes path relative to namespace. If we give /w/error.jsp it take absolute path from web content folder. Regards, Amol On Thu, Jul 22, 2010 at 7:54 PM, Amol Ghotankar wrote: > Dear Dale, > > i have used relative path of ../../../w/error.jsp > > Can't i directly give w/error.jsp - if i give so I struts searches it in > x/y/z/w/error.jsp i.e relative to the namespace. > > I will have to try with /w/error.jsp > > Regards, > > Amol > > > On Thu, Jul 22, 2010 at 7:38 PM, Dale Newfield wrote: > >> On 7/22/10 3:40 AM, Amol Ghotankar wrote: >> >>> Can't i directly give w/error.jsp >>> >> >> "w/error.jsp" is a relative path. What happens if you specify >> "/w/error.jsp"? >> >> -Dale >> > > > > -- > > > With Best Regards, > > Amol Ghotankar > www.cursivetech.com > > -- With Best Regards, Amol Ghotankar www.cursivetech.com
Where to find variables added in context
Dear List members, I am debugging my jsp page. I have added few list in my action context from my action. Now where do I find these list on my jsp page while debugging under which object. I get these objects on my debug window, in which object and exactly under which map do I get the values added in context. thisedit_jsp (id=403) _jspx_th_s_005fif_005f9IfTag (id=500) _jspx_page_contextPageContextImpl (id=5102) -- With Best Regards, Amol Ghotankar
Re: JAX-RS or REST plugin
Not able to work with the link. Any problems with server or link??? On Wed, Sep 29, 2010 at 1:38 AM, Frans Thamura wrote: > hi all > > anyone work with REST, we now work hard to migrate all our projects to > REST plugins, and we successfully make all the old execute() style > become REST, > > u can get the code in our trunk at www.ugforge.net/gf/projects/cimande > > this is the SVN > > http://ugforge.net/gf/project/cimande/scmsvn/?action=browse&path=/trunk/ > > but we know there is JAX-RS, a Java API for Building RESTfull Apps > > any idea about the direction, so we wont lost in the roadmap > > thx > > Frans > Indonesia > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- With Best Regards, Amol Ghotankar
Re: Authorization/ Authentication
Hello, Even I am searching for some better way in which authentication can be done using struts2 or spring security toghether. No direct or simple example to explain it working together. Specially for these two cases where 1. which user can access which action, is stored in database -> authorization table 2. which user can access how much data from a table in database, is decided by authorization logic. How to implement this any example or references welcomed. On Mon, Dec 27, 2010 at 7:49 PM, Greg Akins wrote: > On Mon, Dec 27, 2010 at 8:36 AM, Jordi Fernandez > wrote: > > Have you considered Spring Security? > > http://static.springsource.org/spring-security/site/ > > No.. I'll have to read a bit more; but my first guess is that I'd have > to do some refactoring of some legacy code ( I need to use the same > underlying data / logic to perform AA in another sibling application. > > Basically I was wondering what was "built-in" to struts to handle this > and find out if I can adapt that to my current app > > I think all I need to do is write a LoginInterceptor to check for a > login, and redirect to the login page if the user isn't authenticated. > The security for this application is binary so I don't need anything > additional for Authorization. > > Thanks for pointing it out though.. I'll definitely do some research into > that. > > -- > Greg Akins > > http://insomnia-consulting.org > http://www.pghcodingdojo.org > http://pittjug.dev.java.net > http://twitter.com/akinsgre > http://www.linkedin.com/in/akinsgre > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- With Best Regards, Amol Ghotankar Cursive Technologies Pvt. Ltd. www.cursivetech.com
Re: Authorization/ Authentication
I can elaborate on the requirement as follows, Assume a simple action which is authorized to be called by sales dept people only. i.e showSales.action When a user from purchase dept tries to call this action then, an interceptors will check whether the user in role has the authorization to access or not and deny access to purchase dept user to access this action this is simple. I have implemented this using before advice of Spring AOP rather than interceptor. I hope i am not wrong? But the bigger problem is By how much, I mean for eg. if an *sales execute *logs in and clicks showSales.action then he must be get view of his own sales list, but when *sales manager* logs in and calls same action i.e showSales.action then he must get more* bigger n wider list, which can be union of data from all sales executives. Here authorization of some kind must be implemented which intercepts DAO's and automatically sets the "where clause" in the sql query. I tried before advice of spring for DAO's also but problem is if where clause is set somewhere within business logic then double where clause is set which gives error and because I am using hibernate criteria's to set restrictions on queries I have noticed this hibernate critera's are immutable* (Is there anyway to change them?) what should be the best way to solve this problem. Any Design Pattern or s*omething in struts that can help me here* or something other advice for it? On Tue, Dec 28, 2010 at 10:01 PM, Dave Newton wrote: > On Tue, Dec 28, 2010 at 11:10 AM, Amol Ghotankar >wrote: > > > Even I am searching for some better way in which authentication can be > done > > using struts2 or spring security toghether. > > > > No direct or simple example to explain it working together. > > > > Specially for these two cases where > > > > 1. which user can access which action, is stored in database -> > > authorization table > > 2. which user can access how much data from a table in database, is > > decided > > by authorization logic. > > > > How to implement this any example or references welcomed. > > > > There are essentially unlimited ways this can be implemented. > > It also depends what technology you want to use. I haven't used Spring > Security for some time, so I won't be much help there, but I *do* know it's > incredibly granular and flexible, occasionally a bit too much so for my > taste, but it can be made to look simple. > > "How much" data can be accessed has multiple meanings: do you mean > *quantity* of data? I've never even considered trying to implement that. > *Which* data would be handled the same way as everything else, however it's > being handled. > > When I've dealt with legacy authentication mechanisms I usually just do > something like a filter/interceptor that checks the action for an > annotation > (or a known action method naming convention to map action method => access > control). After the user logs in their user info is available in the > session, and if they're allowed access the interceptor just moves along, > and > if they're not, they're redirected somewhere reasonable. > > For Spring Security stuff I would refer you to the Spring documentation, > since it's not directly related to Struts 2. > > Dave > -- With Best Regards, Amol Ghotankar Cursive Technologies Pvt. Ltd. www.cursivetech.com
Re: How to save the valuestack when using the redirectaction result type
Hello, As Dave suggested one of your problem will be solved by keeping jsp's in web-inf. On Wed, Dec 29, 2010 at 6:19 PM, Dave Newton wrote: > JSP pages should be under WEB-INF to avoid direct access; this has been a > best practice for years. > > Dave > On Dec 29, 2010 1:14 AM, "maven apache" wrote: > > Hi: > > In my application I first use the chain result type for one > > action:"loginSub". > > > > If login success,user should be taken to the manager page. > > This is the core content in struts.xml: > > > > > > . > > > > > > manager > > /secure > > > > /jsp/login.jsp > > /jsp/login.jsp > > > > > > > > > > > > /jsp/secure/manager.jsp > > > > loginPage > > / > > > > > > > > > > It works,when user login,the page will show the content in the > > /jsp/secure/manager.jsp. > > > > However the value in the browser address bar is also something like: > > > > http://localhost:8080/Test/loginSub.action. > > > > So once user refresh this page,it will result in a relogin. > > > > After read the struts2 tutorial,I found the result type of > > "redirectAction",it will change the value of the Browser address bar. > > I change the "loginSub" action: > > > > > > <. the authentication interceptor>... > > > > manager > > /secure > > > > /jsp/login.jsp > > /jsp/login.jsp > > > > > > Now after login,the browser address bar will change to : > > > > *http://localhost:8080/Test/secure/manager.action* > > > > Now no matter how frequently user refresh the page,it will not cause a > > relogin. > > > > However I found that I can not get some properties in the LoginAction. > > > > I have a struts tag in the manager.jsp: > > > > ** > > > > Now using the redirectAction result type,I have no idea to get this > value. > > > > Any ideas? > You will have to push the bean on value stack again, if you want it to be made available in redirected action and also set for which variable in the parameter. ***This is a guess a issue with struts 2 that via such mechanism only int, string etc basic values can be accessed but the complex objects can not be accessed, Even I am looking for better solution. > > > > BWT: > > 1)what's the difference between "Dispatcher Result","Redirect > > Result","Redirect Action Result" and "Chain Result"? > > I read the contents at " > struts.apache.org/2.2.1/docs/result-types.html > ",but > > I am not exactly sure its meaning. > > > > 2)My action "manager" is a authentication required action,so I add a > > authentication interceptor for them. > > > > But how about user enter the url directly like this: > > * > > http://localhost:8080/Test/jsp/secure/manager.jsp?* > > > > If so ,I do not think the interceptor will work. > > > > How do you guys slove this problem? > -- With Best Regards, Amol Ghotankar Cursive Technologies Pvt. Ltd. www.cursivetech.com
Re: E-Commerce website using struts
This is a good tool but its difficult to intergrate as it has its own UI & many other components, isn't there any framework which just is like a api or something. On Mon, Dec 13, 2010 at 11:14 AM, aum strut wrote: > if taking about struts2 here it is > http://www.shopizer.com/ > > On Fri, Dec 10, 2010 at 11:40 AM, ashish chawre > wrote: > > > Hi, Is any body having any idea about the source/example of any ecommerce > > website implementation using struts? > > I am looking to implement a checkout using struts and I need to implement > > shopping cart as well. > > > > Any help will be greatly appreciated. > > > > Thanks! > > -- Ashish > > > -- With Best Regards, Amol Ghotankar Cursive Technologies Pvt. Ltd. www.cursivetech.com
Struts 2.2.3 Urls Not Working
Hello, The download or any other url on struts2's main site not working. Page not found error. Also in the struts2 archive version struts-2 2.2.1 is labbeld as struts2.2.2.1 which creates confusion that it is next release of 2.2.1.1 http://archive.apache.org/dist/struts/binaries/ The hyphen is missing in last few links which creates confusion. Please make correction as required On Fri, May 6, 2011 at 8:46 PM, Dave Newton wrote: > On Fri, May 6, 2011 at 11:10 AM, David Rocks > wrote: > > I have looked about the docs and cannot find away to [use my own > stylesheet] and > > the only way I can think to do that will be to decompile the jar file, > change code and re jar. > > > > Is that the case? As it is probably the last way I would like to go about > it. > > Serve your own Dojo; see > > http://struts.apache.org/2.x/docs/performance-tuning.html > > and > > http://struts.apache.org/2.x/docs/static-content.html > > Dave > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- With Best Regards, Amol Ghotankar Technical Lead Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
Re: RedirectAction Help!
Hi, My experience say not always just getter & setters works. So try to use ActionContext -> get context -> getvalue stack. set or ActionContext -> get context -> getvalue stack. push If only problem is formId not available to OGNL during redirect. There any be some other issue which needs more investigation . On Wed, May 11, 2011 at 4:31 AM, Teresa McGinley wrote: > I am trying to send an id from one action to another and it seems to be > sending a null. Please assist and I am really at my wits end with this. > How do I get the formId from the Listing to the QuestionListing? > > startInformation has a yourForm=41, when I click the Begin button I get the > redirect to Questions.action with a null formId as shown... > > http://localhost:8080/IUNSurvey/survey/Questions.action?formId= > > startInformation.jsp has a button that calls redirect: > > > ... > > > > struts.xml > > > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >"http://struts.apache.org/dtds/struts-2.0.dtd";> > > > > > > method="display"> >/views/survey/Listing.jsp > > > > name="success">/views/survey/startInformation.jsp > > > method="beginQuestions"> > >Questions >true >${yourForm} > > > > >/views/survey/Questions.jsp > > > > > > exerpt from Listing.java > >public String execute() { >selectedForm = services.getFormsById(yourForm); >return SUCCESS; >} > >public String display() { >forms = services.getForms(); >return NONE; >} > >public String beginQuestions() { >return "redirect"; >} > >/** > * @return the yourForm > */ >public Long getYourForm() { >return yourForm; >} > > > exerpt from QuestionListing.java > > I have a getter/setter for formId > >public String execute() { >currentQuestion = (services.getQuestionsByForm(getFormId())); >return SUCCESS; >} > >public String display() { >setCurrentQuestion(services.getQuestionsByForm(getFormId())); >return NONE; >} >public void setFormId(Long formId) { >this.formId = formId; >} > >public Long getFormId() { >return formId; >} > -- With Best Regards, Amol Ghotankar Technical Lead Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
Re: Pagination using Struts library
You have struts 2 jquery plugin for grid and full hibernate support plugin to do pagination. With Best Regards, Amol Ghotankar Technical Lead Cursive Technologies Pvt. Ltd. www.cursivetech.com
Issue: Action redirect do not include parameter as complex objects?
Hello, I have tried an example in which i have inserted a user using insert method of UserAction class. On insert I have redirected the success to loadAdd method of UserAction. During redirect I have passed the parameter as ${user} In struts 2.0.14 this gives an ognl exception. whereas when I pass ${user.id} it works. My observation says this is a bug in struts or ognl that it does parse composite objects while it parses simple data types. Any work-around please suggest. Or Is there any way by which I can forward the complete action context or value stack in the redirected action With Best Regards, Amol Ghotankar Technical Lead Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
Re: Issue: Action redirect do not include parameter as complex objects?
Ok. 1, Why I need to pass the object and not the id. --> I have just inserted it and do not want additional reads from database. 2. Can't image url & get request. --> Exactly. Why do we have just GET here, can't we have post also. 3. Old version. --> Applications can't be upgraded for every version released so best stable release of struts2 is used. i.e 2.0.14 4. Important. Can't we have a work around to forward the value stack to the redirected action without using action chaining, but having somewhat similar effect. ? 5. Why can't we post values through redirect action, any work around to do that? ?
Struts2 Date time picker problem in Firefox
I have a simple form that has s:datetimepicker name="studentAdmission.admissionDate" id="requiredString" cssClass="must" value="%{'today'}"/ When I submit this form from Firebox the object at backend does not get the date value. But when I submit this form from IE8, the object at backend gets the date value as entered. Any Idea what additional settings required for Firefox? Regards, Amol Ghotankar Cursive Technologies
Re: Struts2 Date time picker problem in Firefox
I checked the output on browsers and this was what i found IE FF Help is need to fix this part.
Re: Struts2 Date time picker problem in Firefox
@Maurizio: I have not changed anything, and the application is very simple do not use any dojo manipulation too. Yes the output is from the client browser retrieved via firebug & similar browser plug-ins where I can see that in FF the value is blank. Any quick fix for this. Regards, Amol
struts2.0.14's date time picker tag
A issue I am facing with struts2.0.14's date time picker tag The problem is that struts2 datetimepicker displayformat attribute must always be set to format of tomcat server date time format else the submitted values are null. *Change Date time setting by in Win 7:* 1. RightClick bottom right corner date. 2. Click on Change Date & Time Settings 3. Change calender settings 4. Change Regional Settings 5. Set Format as English(India) *Repro Steps* 1. Change the Regional Settings as mentioned above & restart the tomcat server. 2. Now do not use any displayformat or use display format other than "dd/mm/" in date time picker 3. Submit the struts2 form with date 21/12/2012 4. In Action submitted date is set to null 5. Now change the regional setting to English(US) and do not use any displayformat and restart the server. 6. Values in action are set as submitted through form. *Expected result* 1. Whatever is the system date time format then date must be parsed accordingly and made available in action. *Envi:* Java 6, Struts2.0.14, Firefix 12, tomcat 6. Any workarounds or fixes through properties or something? **Note: Do not answer if the answer is to use jquery or some other js lib or an upgrade.* stackoverflow.com/questions/10910026/struts2-datetime-picker-displayformat-issue -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Re: Any sample or example for Struts2 Google Ad-sense integration
Something very useful i found for using struts2 with Google analytics :) http://technomilk.wordpress.com/2010/12/05/tracking-events-with-google-analytics-in-struts-actions/ On Mon, Feb 4, 2013 at 1:22 AM, Amol Ghotankar wrote: > Hi, > > I was trying for integration Google ads inside struts2 application. > > Though I understand their is no interconnection between both, but it could > be great if anyone could point me to any sample or example of > > *How to integrate Google ads inside Struts2 application?* > > I wanted to know the best practices for using both together. > > If not any sample, just if anyone who has used both could share some > experience on how to proceed and what are dos and don't in it > > > -- > > > > *With Best Regards,* > > Amol Ghotankar > Technical Lead > M: +91 9960 980 419 <http://www.cursivetech.com> > -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Re: Question about Model Driven Interface
Hi Umesh, Both you mentioned are same. ModelDriven is best used to create new object if they do not exist. So your getModel method must be ProfileDTOModel md; public ProfileDTOModel getModel() { if(md != null)// Or Some other condition as required by your model. Typically check for Id { return md; } md = new ProfileDTOModel(); return md; } Here if you use modelDriven interceptor, model objects are cached in ValueStack (or autopushed) between your edits in one way. But you also need to use prepare and params interceptor to take full adavantage of this. Struts2 experts correct my langauge if required. On Tue, Oct 15, 2013 at 5:02 PM, Umesh Awasthi wrote: > Hi All, > > Have rarely used model driven interface and not sure about how exactly it > work. > Can any one point me what will be difference between > > ProfileDTOModel md = new ProfileDTOModel(); > > > publicProfileDTOModel getModel() > { > >return md; > } > > and > > public ProfileDTOModel getModel() > { > >return new ProfileDTOModel();; > } > > > -- > With Regards > Umesh Awasthi > http://www.travellingrants.com/ > -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Security Issues & Vulnerability
I have seen some sample app for testing which was developed using struts2. I saw some unknow files getting uploaded on test, I initially thought that my tomcat was hacked or my server was hacked but now after a close analysis it looks a struts2 webwork secuirty issue or vulenrability or may me my miss configurations or something not sure Can any one in struts2 team fix this gloabally and help me to get rid of this locally without version upgrades. Here are the tomcat logs which clearly says the story 60.15.137.72 - - [27/Jan/2014:17:51:48 +0530] "GET /common/test.action?redirect:$%7B%23a%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletRequest'),%23b%3d%23a.getRealPath(%22/%22),%23matt%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),%23matt.getWriter().println(%23b),%23matt.getWriter().flush(),%23matt.getWriter().close()%7D HTTP/1.0" 200 74 60.15.137.72 - - [27/Jan/2014:17:51:48 +0530] "GET /common/test2.action?redirect:$%7B%23a%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletRequest'),%23b%3d%23a.getRealPath(%22/%22),%23matt%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),%23matt.getWriter().println(%23b),%23matt.getWriter().flush(),%23matt.getWriter().close()%7D HTTP/1.0" 200 74 60.15.137.72 - - [27/Jan/2014:17:51:49 +0530] "GET /common/test3.action?redirect:$%7B%23a%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletRequest'),%23b%3d%23a.getRealPath(%22/%22),%23matt%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),%23matt.getWriter().println(%23b),%23matt.getWriter().flush(),%23matt.getWriter().close()%7D HTTP/1.0" 200 74 I hope my issue is clear and valid. Original issue on stackoverflow at http://stackoverflow.com/questions/21104956/tomcat-files-getting-uploaded-security-loophole -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Re: struts 2.3.17
t;>>>} > >>>>>>> > >>>>>>>public void setTest(DifferentComplexType test){ > >>>>>>>this.field.setTest(test); > >>>>>>>} > >>>>>>> > >>>>>>> and change the to use key="test" it works like a charm. > >>>>>>> > >>>>>>> Is that how its supposed to be? If so, why? > >>>>>>> > >>>>>>> Thank you for explaining! > >>>>>>> > >>>>>>> Best > >>>>>>> Fabian > >>>>>>> > >>>>>> > - > >>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>>>>> For additional commands, e-mail: user-h...@struts.apache.org > >>>>>> > >>>>> -- > >>>>> media transfer AG > >>>>> > >>>>> Fabian Richter, M.Sc. > >>>>> Softwareentwickler > >>>>> > >>>>> Mail:frich...@mtg.de > >>>>> Telefon: +49 6151 8193-24 > >>>>> Telefax: +49 6151 8193-43 > >>>>> Web: http://www.mtg.de > >>>>> > >>>>> Firmensitz: Dolivostraße 11, 64293 Darmstadt > >>>>> Registergericht: Amtsgericht Darmstadt, HRB 8901 > >>>>> Vorstand: Jürgen Ruf (Vors.), Tamer Kemeröz > >>>>> Aufsichtsratsvorsitzender: Dr. Thomas Milde > >>>>> > >>>> - > >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>>> For additional commands, e-mail: user-h...@struts.apache.org > >>>> > >>> -- > >>> media transfer AG > >>> > >>> Fabian Richter, M.Sc. > >>> Softwareentwickler > >>> > >>> Mail:frich...@mtg.de > >>> Telefon: +49 6151 8193-24 > >>> Telefax: +49 6151 8193-43 > >>> Web: http://www.mtg.de > >>> > >>> Firmensitz: Dolivostraße 11, 64293 Darmstadt > >>> Registergericht: Amtsgericht Darmstadt, HRB 8901 > >>> Vorstand: Jürgen Ruf (Vors.), Tamer Kemeröz > >>> Aufsichtsratsvorsitzender: Dr. Thomas Milde > >>> > >> - > >> 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 > > -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Struts2.3.18 Released?
Hi, Version notes taking about this released http://struts.apache.org/release/2.3.x/docs/migration-guide.html But in JIRA this shows unreleased. Just wanted to bring to group's notice. -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Re: Struts2.3.18 Released?
more specific - http://struts.apache.org/release/2.3.x/docs/version-notes-2318.html On Tue, May 6, 2014 at 8:06 PM, Amol Ghotankar wrote: > Hi, > > Version notes taking about this released > http://struts.apache.org/release/2.3.x/docs/migration-guide.html > > But in JIRA this shows unreleased. > > Just wanted to bring to group's notice. > > > -- > > > > *With Best Regards,* > > Amol Ghotankar > Technical Lead > M: +91 9960 980 419 <http://www.cursivetech.com> > -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Re: Call 4 Plugins
Hi, I found few interesting and day to day needed plugins - that needs developer support For google map integration in struts2 https://github.com/lalotech/struts2-map-plugin - Best one Awesome concept to render images as per size using transformation https://code.google.com/p/s2-image/wiki/GettingStarted - its outdated but I am willing to upgrade. Again must have plugin to decide http vs https actions https://code.google.com/p/struts2-ssl-plugin/ - not updated again :( Let me know how we (community) should take them ahead and make struts2 more easy to use. On Mon, Apr 7, 2014 at 12:15 PM, Lukasz Lenart wrote: > Hi, > > Can you post links to all the plugins you are using which aren't > included in Struts itself? > > Me: > http://jcaptcha4struts2.googlecode.com/ > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Loading static content from cdn instead of struts directoru
Hi, I have set all static resources to load form cdn. But when I add it tries to load static content from struts directory in webapp. Anyway where I can configure it to load struts static content from my-cdn? Can we have a feature to enable cdn option which when set to true uses the user given base url for cdn? Do not want my tomcat to serve static resources. -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Using Struts2 Rest Plugin with deep cascading actions
hi, I was trying out struts2 rest plugin and found it really cool. But was just wondering how will this work with action cascading ? i.e So When using http://localhost/company it goes to companyAction and executes respective mapped methods But how do we organize work when we http://localhost/company/1/locations/2/contact/2/ ??? Will these be methods in same class? Class will grow too big & if not how does it get mapped to contactAction and pass values their? How about more complex case where we have http://localhost/company/1/locations/2/contact/2/order/2/transaction/1/payment or something like this??? Domain objects are hibernate entities when company has locations has contacts has orders has transaction has payments? or should the rest url be something different and simplified? like http://localhost/order/2/transaction/1/payment but still has issues mapping things and reusing actions? Am I missing something in rest plugin? -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
ASM library issue when upgrading struts2.3.20 from struts2.3.16.3
Hi, I am using spring aop along with struts2 When using older version i.e struts2.3.16.3 my aop and project works properly Here is snapshot of my dependecy tree [INFO] +- org.apache.struts:struts2-convention-plugin:jar:2.3.16.3:compile [INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile [INFO] | \- org.apache.struts:struts2-core:jar:2.3.16.3:compile [INFO] | +- org.apache.struts.xwork:xwork-core:jar:2.3.16.3:compile [INFO] | | +- asm:asm:jar:3.3:compile [INFO] | | \- asm:asm-commons:jar:3.3:compile [INFO] | | \- asm:asm-tree:jar:3.3:compile [INFO] | +- org.freemarker:freemarker:jar:2.3.19:compile [INFO] | +- ognl:ognl:jar:3.0.6:compile [INFO] | | \- javassist:javassist:jar:3.11.0.GA:compile [INFO] | +- commons-fileupload:commons-fileupload:jar:1.3.1:compile [INFO] | \- commons-io:commons-io:jar:2.2:compile [INFO] +- org.apache.struts:struts2-spring-plugin:jar:2.3.16.3:compile [INFO] | +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile [INFO] | +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile [INFO] | | \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile [INFO] | +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile [INFO] | | +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile [INFO] | | \- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile [INFO] | \- org.springframework:spring-web:jar:3.0.5.RELEASE:compile [INFO] | \- aopalliance:aopalliance:jar:1.0:compile But same does not work when I update the struts2 to 2.3.20 [INFO] +- org.apache.struts:struts2-convention-plugin:jar:2.3.20:compile [INFO] | +- org.apache.commons:commons-lang3:jar:3.2:compile [INFO] | \- org.apache.struts:struts2-core:jar:2.3.20:compile [INFO] | +- org.apache.struts.xwork:xwork-core:jar:2.3.20:compile [INFO] | | +- org.ow2.asm:asm:jar:5.0.2:compile [INFO] | | \- org.ow2.asm:asm-commons:jar:5.0.2:compile [INFO] | | \- org.ow2.asm:asm-tree:jar:5.0.2:compile [INFO] | +- org.freemarker:freemarker:jar:2.3.19:compile [INFO] | +- ognl:ognl:jar:3.0.6:compile [INFO] | | \- javassist:javassist:jar:3.11.0.GA:compile [INFO] | +- commons-fileupload:commons-fileupload:jar:1.3.1:compile [INFO] | \- commons-io:commons-io:jar:2.2:compile [INFO] +- org.apache.struts:struts2-spring-plugin:jar:2.3.20:compile [INFO] | +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile [INFO] | +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile [INFO] | | \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile [INFO] | +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile [INFO] | | +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile [INFO] | | \- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile [INFO] | \- org.springframework:spring-web:jar:3.0.5.RELEASE:compile [INFO] | \- aopalliance:aopalliance:jar:1.0:compile As the asm library looks to be have updated to 5.0.2 *Error that I get is class net.sf.cglib.core.DebuggingClassWriter overrides final method visit* This only happens when I using aop feature of spring and error comes during runtime and not compile time. I know this should be simple library dependecy issue, but not able to solve it as cglib & asm are almost used everywhere else too. Any suggestions of how to fix this? -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Re: Using Struts2 Rest Plugin with deep cascading actions
Well after doing some research on designing rest api ***best practices*** I realized I was doing something wrong. For getting all companies, we must use http://localhost/company For getting all locations of that company we can use http://localhost/company/111/locations For anything else to get from any particular location we can use http://localhost/company/locations/111 - to get location details (/company/ only in namespacing ) http://localhost/company/locations/111/contacts - to get location contacts etc. Now question is how do we implement namespacing in struts2 rest api??? As by default all actions are @root right? can we have @namespace(value="/company/") annotation in Location Action But this does not work for me, it redirects to company action only and says no method available. Or we must not use such namespacing and its better to use http://localhost/location instead of http://localhost/company/location Please suggest. On Fri, Jan 23, 2015 at 4:20 PM, Amol Ghotankar wrote: > hi, > > I was trying out struts2 rest plugin and found it really cool. > > But was just wondering how will this work with action cascading ? i.e > > So When using http://localhost/company it goes to companyAction and > executes respective mapped methods > > But how do we organize work when we > http://localhost/company/1/locations/2/contact/2/ ??? > > Will these be methods in same class? Class will grow too big & if not how > does it get mapped to contactAction and pass values their? > > How about more complex case where we have > http://localhost/company/1/locations/2/contact/2/order/2/transaction/1/payment > or something like this??? > > Domain objects are hibernate entities when company has locations has > contacts has orders has transaction has payments? > > or should the rest url be something different and simplified? like > http://localhost/order/2/transaction/1/payment but still has issues > mapping things and reusing actions? > > Am I missing something in rest plugin? > > -- > > > > *With Best Regards,* > > Amol Ghotankar > Technical Lead > M: +91 9960 980 419 <http://www.cursivetech.com> > -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Sample Rest API example project on github
https://github.com/amolghotankar/struts2-rest-sample -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Adding custom interceptor in struts2 rest project
Hi All, I was trying to get more deep in struts2 rest plugin. To better understand things I have created a struts2-rest-sample on github https://github.com/amolghotankar/struts2-rest-sample Issues I see here are 1. If we add a customer interceptor then index action is not getting called. 2. We cannot update to struts2.3.20 - I guess this is known issue :( 3. How do we call http://localhost:8080/employee/111/projects.json something like cascading actions here? 4. How can we return customer json response as for eg http://localhost:8080/employee.json should return employeeId but http://localhost:8080/employee/111.json should not return employeeId There are more to come and I hope this github repo will help many other like me. Specially when these days we have angularjs being used heavily, people like me would love to see struts2 more of a restful mvc which will sit only on server side, but doing a little more for detached clients. -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>
Re: JSON + REST
I was looking for exactly same thing. Anyone knows how we can reduce the json result coming from Rest plugin with combination of conventions & JSON plugin? I understand one answer is create model per action but looks like its a little too big ask from design perspective. On Mon, Aug 12, 2013 at 5:05 PM, Felipe Lorenz < felipe.lor...@idealogic.com.br> wrote: > Hi, > > I'm working on a project using conventions with rest plugin and I am > looking for a way to restrict the output of the json results. Since the > Actions class has many attributes, like lists, and so on, would be good if > I could restrict the output. > > I know that json plugin can do it for me using the param "includeParams", > but the rest plugins already has json result, so I dont want to add another > plugin. > > Is there a way to limit the json output just using rest plugin with > annotations? > > Thanks, > > Felipe Lorenz > > -- *With Best Regards,* Amol Ghotankar Technical Lead M: +91 9960 980 419 <http://www.cursivetech.com>