Hi, 

You are correct, I have index.jelly in resources folder.
Delete the index.jelly makes doIndex executed

Thanks

On Friday, September 2, 2016 at 2:20:27 AM UTC-7, Robert Sandell wrote:
>
> That looks to be correct, unless you have added a view called index.jelly 
> or index.groovy because I think those are evaluated before doIndex.
>
> /B
>
> On Thu, Sep 1, 2016 at 6:12 PM, Cheng Bao <[email protected] <javascript:>> 
> wrote:
>
>>
>>
>> I create my own implementation of RootAction in Jenkins, instead of 
>> default behavior that just render and display index.jelly, I want to do 
>> some operations. as states from http://stapler.kohsuke.org/reference.html
>>
>> Index Action Method This is a slight variation of above. If there's no 
>> remaining URL and there's an action method called "doIndex", this method 
>> will be invoked. Formally, evaluate(node,[]) := node.doIndex(...)
>>
>> my code is
>>
>> @Extension
>> public class MyRootAction implements RootAction {
>>    public void doIndex(StaplerRequest req, StaplerResponse rsp) {
>>         // doing my work when user type /MyRootAction in browser bar
>>         // this method never executed
>>    }
>>
>>    public void doOtherWork(StaplerRequest req, StaplerResponse rsp) {
>>         // doing my work when user type /MyRootAction/otherWork in 
>> browser bar
>>         // this method works as intended
>>    }
>>    //...
>> }
>>
>>
>> Any one can help me to point what I did wrong?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/bfa2a630-6407-4e77-9e3c-68e47ad96b0a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/bfa2a630-6407-4e77-9e3c-68e47ad96b0a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Robert Sandell
> *Software Engineer*
> *CloudBees Inc.*
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/510e18f8-ed7b-42f5-bb5e-e4e3ee993dc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to