Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
Why the .action extension in required in struts2?
sarada bokka
Ranch Hand
Posts: 80
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all,
I have been observed that for the
very first request
.action is required (ex: <META HTTP-EQUIV="Refresh" CONTENT="0;URL=sampleAction
.action
">)
Can anyone explain me why only for the first request .action extension is required?
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
"shasha ch", please check your private messages for an important administrative matter.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Because in that example the request is being made from an HTML page, outside of the
Struts
2 application. Without the extension (by default, anyway) the container wouldn't know it was a Struts 2 action request.
Johannes Geppert
Ranch Hand
Posts: 67
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You dont need to use action, you can edit your extension in the struts2.xml
Default is
<constant name="struts.action.extension" value="action" />
But you can use anything
<constant name="struts.action.extension" value="html" />
With the rest plugin you can use Struts2 with rest based URLs
without an extension.
Best Regards
Johannes Geppert
My Java and Webprogramming Blog
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
You don't actually need the REST plugin for extension-less actions, though.
The default extension mapping in Struts 2.1+ is "action,,", meaning extensionless actions are supported out-of-the-box.
sarada bokka
Ranch Hand
Posts: 80
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
My question is about why only for the
first request
.action is required?
I guess David gave the answer
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It doesn't have anything to do with it being the *first* request, though.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Errr: requested resource xxxx.action is not available
Action.saveMessages
JSP source
Action.getLocale( HttpServletRequest)
New to struts
More...