Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Default Action In Struts2

 
Ranch Hand
Posts: 69
MySQL Database Linux
  • 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

 
Author
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
MySQL Database Linux
  • 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






 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!