• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Default Action In Struts2

 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
Can we do this(I tried it at my end but no success)

By entering,
http://localhost:8080/teststruts/

the default action name InitializeAction(for some initialization) should get called and then from its execute method i will show the result (i.e login.jsp)

I dont want to use struts.xml and will use Annotation


Regards,
Arpit

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there's any non-XML way to set the default action (but could be wrong). It'd be pretty inefficient at startup if there was, too; not a big deal, but still.
 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks

I have one query

I am using Annotation and declared it in web.xml where to find annoted action class this way
web.xml snippet


Everything is working fine if action classes are in mypackage.action

but if move existing or create a new action class

in com.mycompany.mypackage.action.otheraction

i am getting this
HTTP Status 404

Can you explain this to me?

Thanks in advance






 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic