Meaningless Drivel is fun!*
The moose likes Struts and the fly likes customizing RequestProcessor. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "customizing RequestProcessor." Watch "customizing RequestProcessor." New topic
Author

customizing RequestProcessor.

Rohit Sharad Sharma
Greenhorn

Joined: Jan 14, 2010
Posts: 6
Hello to the members of JavaRanch. I am new to this forum and in case anyone finds me not adhering to the rules please inform me.
Although I am trying hard to not break any rules
I had a query can we override the RequestProcessor in such a way that instead of invoking the execute() method of the action class it invokes any other method of the class
say for example MyMethod().

Please help me out on this. Thanks in advance for your support and suggestions.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Sure, but why would you want to?
Rohit Sharad Sharma
Greenhorn

Joined: Jan 14, 2010
Posts: 6
Thanks for replying David.
David my team is working on a new design and we all were stuck at this point. Nothing is been finalized yet, but just to overcome my curiosity I posted the issue on the forum. Because I was sure that i'll get the answer only here.
Thanks for your support, if you could please help me out in this.
Patrick Kok
Ranch Hand

Joined: Nov 12, 2009
Posts: 42
Rohit Sharad Sharma wrote:Hello to the members of JavaRanch. I am new to this forum and in case anyone finds me not adhering to the rules please inform me.
Although I am trying hard to not break any rules
I had a query can we override the RequestProcessor in such a way that instead of invoking the execute() method of the action class it invokes any other method of the class
say for example MyMethod().

Please help me out on this. Thanks in advance for your support and suggestions.


Didn't realize much about your requirement, but I thought you're asking somethings like this:

In your action form:
action="myAction_myMethod"
...
struts.xml
<action name="myAction_*" class="MyActionClass" method="{1}">
...
MyActionClass.java
...
public void myMethod(){
...
}

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Wrong version of Struts, if the OP is asking about customizing a request processor.

Don't know about 1.3, but in 1.2 it seems like this is something you should be able to figure out on your own, no? Have you looked at the Javadocs for RequestProcessor? Hopefully once you have it'll be obvious where to look in the source code (which you'll want to do if you're trying to duplicate its functionality, even if you're adding behavior).
 
 
subject: customizing RequestProcessor.