RE: SubClass RequestProcessor or Action class
Hi, If you want to use your custom RequestProcessor subclass, for security issues or any other preProcess() needs, all you need to do is define it in the struts-config.xml "controller " definition, which is the last definition before the closing tag. Then your class would be called for every request. for example, my custom RequestProcessor which is used to process roles is defined as It worked for me. Noam -Original Message- From: Kommineni, Sateesh (IndSys) [mailto:[EMAIL PROTECTED] Sent: Monday, September 01, 2003 9:17 AM To: Struts Users Mailing List Subject: RE: SubClass RequestProcessor or Action class Hi, If you want each request to your app needs to do some security related stuff then you can have an Action class which does this and store the details in a session for that User . If sessions are not allowed for your app and if you have to execute the security related stuff for each request then create a Base Action class which does the security related stuff and extend all Action classes from it .. Hope this is helpful... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 01, 2003 12:17 PM To: Struts Users Mailing List Subject: RE: SubClass RequestProcessor or Action class Actually I would like to extend the RequestProcessor class (let's say MyOwnRequestProcessor inheriting from RequestProcessor) and override the preProcess() method to embed some security related code. I was wondering how would I let STRUTS framework know that MyOwnRequestProcessor should be called instead of the standard STRUTS RequestProcessor. My ultimate aim is to guarantee that the piece of code I embed in the preProcess() method should definitely be executed for every request. Please bear with me if I am making no sense as I am still in the process of getting good idea on STRUTS. Regards Sreekant G "Andrew Hill" <[EMAIL PROTECTED]To: "Struts Users Mailing List" <[EMAIL PROTECTED]> idnode.com> cc: Subject: RE: SubClass RequestProcessor or Action class 09/01/2003 11:30 AM Please respond to "Struts Users Mailing List" This is a joke right? ...Friday is well and truly over mate. Its Monday now. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, 1 September 2003 12:03 To: [EMAIL PROTECTED] Subject: SubClass RequestProcessor or Action class HI All, As a general practice all the application action classes are inherited from org.apache.struts.action.Action class. What are the Pro's and Con's of inheriting the application action classes from org.apache.struts.action.RequestProcessor class instead ? Regards Sreekant G - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SubClass RequestProcessor or Action class
Ah. I see that makes it much clearer. :-) Now you probably know that you can define your own RequestProcessor and set it to be used in struts-config.xml but Im guessing what you want is to use different RequestProcessors for different actions? (If this isnt the case and you want to use the same one for all then just set the processorClass attribute in the controller element in your struts-config to the name of your RequestProcessor subclass.) Hmmm. Tricky. You would perhaps to do better to implement just one that delegates to helper classes. You could perhaps create your own ActionMapping type and give it an attribute that your requestProcessor could check to see what to do. One thing to note is that the request processor will only process requests that are mapped through the ActionServlet (your jsps wont be but you should only be accessing them via an action anyway). Another alternative if your container supports servlet api 2.3 is to define a filter. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, 1 September 2003 14:47 To: Struts Users Mailing List Subject: RE: SubClass RequestProcessor or Action class Actually I would like to extend the RequestProcessor class (let's say MyOwnRequestProcessor inheriting from RequestProcessor) and override the preProcess() method to embed some security related code. I was wondering how would I let STRUTS framework know that MyOwnRequestProcessor should be called instead of the standard STRUTS RequestProcessor. My ultimate aim is to guarantee that the piece of code I embed in the preProcess() method should definitely be executed for every request. Please bear with me if I am making no sense as I am still in the process of getting good idea on STRUTS. Regards Sreekant G "Andrew Hill" <[EMAIL PROTECTED]To: "Struts Users Mailing List" <[EMAIL PROTECTED]> idnode.com> cc: Subject: RE: SubClass RequestProcessor or Action class 09/01/2003 11:30 AM Please respond to "Struts Users Mailing List" This is a joke right? ...Friday is well and truly over mate. Its Monday now. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, 1 September 2003 12:03 To: [EMAIL PROTECTED] Subject: SubClass RequestProcessor or Action class HI All, As a general practice all the application action classes are inherited from org.apache.struts.action.Action class. What are the Pro's and Con's of inheriting the application action classes from org.apache.struts.action.RequestProcessor class instead ? Regards Sreekant G - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SubClass RequestProcessor or Action class
you can specify some property for you action in config.xml. In yur MyOwnRequestprocessor, just check whether that prooperty exists or not, call the method if yes. Please see the archives. This is one of the Qs that has been asked time to time and lots of guys have done this well. One of the guys has posted some XML that he would use in config.xml. regards Navjot Singh |-Original Message- |From: [EMAIL PROTECTED] |[mailto:[EMAIL PROTECTED] |Sent: Monday, September 01, 2003 12:17 PM |To: Struts Users Mailing List |Subject: RE: SubClass RequestProcessor or Action class | | | |Actually I would like to extend the RequestProcessor class (let's say |MyOwnRequestProcessor inheriting from RequestProcessor) and override the |preProcess() method to embed some security related code. I was wondering |how would I let STRUTS framework know that MyOwnRequestProcessor should be |called instead of the standard STRUTS RequestProcessor. My ultimate aim is |to guarantee that the piece of code I embed in the preProcess() method |should definitely be executed for every request. Please bear with me if I |am making no sense as I am still in the process of getting good idea on |STRUTS. | |Regards |Sreekant G | | | | | "Andrew Hill" | | <[EMAIL PROTECTED]To: |"Struts Users Mailing List" <[EMAIL PROTECTED]> | | idnode.com> cc: | | Subject: RE: |SubClass RequestProcessor or Action class | 09/01/2003 11:30 AM | | Please respond to | | "Struts Users Mailing | | List" | | | | | | | | | |This is a joke right? | |...Friday is well and truly over mate. Its Monday now. | |-Original Message- |From: [EMAIL PROTECTED] |[mailto:[EMAIL PROTECTED] |Sent: Monday, 1 September 2003 12:03 |To: [EMAIL PROTECTED] |Subject: SubClass RequestProcessor or Action class | | |HI All, | |As a general practice all the application action classes are inherited from |org.apache.struts.action.Action class. What are the Pro's and Con's of |inheriting the application action classes from |org.apache.struts.action.RequestProcessor class instead ? | |Regards |Sreekant G | | | | |- |To unsubscribe, e-mail: [EMAIL PROTECTED] |For additional commands, e-mail: [EMAIL PROTECTED] | | | | | | | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SubClass RequestProcessor or Action class
Hi, If you want each request to your app needs to do some security related stuff then you can have an Action class which does this and store the details in a session for that User . If sessions are not allowed for your app and if you have to execute the security related stuff for each request then create a Base Action class which does the security related stuff and extend all Action classes from it .. Hope this is helpful... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 01, 2003 12:17 PM To: Struts Users Mailing List Subject: RE: SubClass RequestProcessor or Action class Actually I would like to extend the RequestProcessor class (let's say MyOwnRequestProcessor inheriting from RequestProcessor) and override the preProcess() method to embed some security related code. I was wondering how would I let STRUTS framework know that MyOwnRequestProcessor should be called instead of the standard STRUTS RequestProcessor. My ultimate aim is to guarantee that the piece of code I embed in the preProcess() method should definitely be executed for every request. Please bear with me if I am making no sense as I am still in the process of getting good idea on STRUTS. Regards Sreekant G "Andrew Hill" <[EMAIL PROTECTED]To: "Struts Users Mailing List" <[EMAIL PROTECTED]> idnode.com> cc: Subject: RE: SubClass RequestProcessor or Action class 09/01/2003 11:30 AM Please respond to "Struts Users Mailing List" This is a joke right? ...Friday is well and truly over mate. Its Monday now. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, 1 September 2003 12:03 To: [EMAIL PROTECTED] Subject: SubClass RequestProcessor or Action class HI All, As a general practice all the application action classes are inherited from org.apache.struts.action.Action class. What are the Pro's and Con's of inheriting the application action classes from org.apache.struts.action.RequestProcessor class instead ? Regards Sreekant G - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SubClass RequestProcessor or Action class
Actually I would like to extend the RequestProcessor class (let's say MyOwnRequestProcessor inheriting from RequestProcessor) and override the preProcess() method to embed some security related code. I was wondering how would I let STRUTS framework know that MyOwnRequestProcessor should be called instead of the standard STRUTS RequestProcessor. My ultimate aim is to guarantee that the piece of code I embed in the preProcess() method should definitely be executed for every request. Please bear with me if I am making no sense as I am still in the process of getting good idea on STRUTS. Regards Sreekant G "Andrew Hill" <[EMAIL PROTECTED]To: "Struts Users Mailing List" <[EMAIL PROTECTED]> idnode.com> cc: Subject: RE: SubClass RequestProcessor or Action class 09/01/2003 11:30 AM Please respond to "Struts Users Mailing List" This is a joke right? ...Friday is well and truly over mate. Its Monday now. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, 1 September 2003 12:03 To: [EMAIL PROTECTED] Subject: SubClass RequestProcessor or Action class HI All, As a general practice all the application action classes are inherited from org.apache.struts.action.Action class. What are the Pro's and Con's of inheriting the application action classes from org.apache.struts.action.RequestProcessor class instead ? Regards Sreekant G - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This mail was scanned by Interscan Virus Wall of Mailserver at Cathedral Road TCS Chennai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SubClass RequestProcessor or Action class
This is a joke right? ...Friday is well and truly over mate. Its Monday now. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, 1 September 2003 12:03 To: [EMAIL PROTECTED] Subject: SubClass RequestProcessor or Action class HI All, As a general practice all the application action classes are inherited from org.apache.struts.action.Action class. What are the Pro's and Con's of inheriting the application action classes from org.apache.struts.action.RequestProcessor class instead ? Regards Sreekant G - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]