0

I have a namespace in struts.xml

<package name="mobile" namespace="/mobile" extends="mainApp">
    <action name="abc" class="x.y.Abc"
        method="abc">
        <result name="input">/blank.html</result>
            <result name="success">/blank.html</result>
        </action>
</package>

I want to map localhost/myApp/mobile/ with the action abc

I don't mind localhost/myApp/mobile/* getting mapped with the action abc

is there any way to meet this requirement?

Govinda Sakhare
  • 5,009
  • 6
  • 33
  • 74

2 Answers2

1

I want to fire an action on localhost:8080/appname/namespace/ i.e. namespace slash

After slash should be action name and if it's empty you should configure empty action name.

<package name="mobile" namespace="/mobile" extends="mainApp">
    <action name="" class="x.y.Abc"
        method="abc">
        <result name="input">/blank.html</result>
            <result name="success">/blank.html</result>
        </action>
</package>
Roman C
  • 49,761
  • 33
  • 66
  • 176
0

try <default-action-ref/>:

<package name="mobile" namespace="/mobile" extends="mainApp">

<default-action-ref name="abc"/> <!-- I added this -->

    <action name="abc" class="x.y.Abc"
        method="abc">
        <result name="input">/blank.html</result>
            <result name="success">/blank.html</result>
        </action>
</package>
Yasser Zamani
  • 2,380
  • 21
  • 18