my dog learned polymorphism
The moose likes Struts and the fly likes Form action attribute is set to root folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Form action attribute is set to root folder" Watch "Form action attribute is set to root folder" New topic
Author

Form action attribute is set to root folder

Trivikram Kamat
Ranch Hand

Joined: Sep 26, 2010
Posts: 155
Root folder is struts.

web.xml:


struts-config.xml:


strutsForm.jsp


The above code sets form as:
<form name="sayHiForm" method="POST" action="/struts">
and not
<form name="sayHiForm" method="POST" action="StrutsSayHi.do">

Which field needs to be changed? Please help.


OCPJP6
Trivikram Kamat
Ranch Hand

Joined: Sep 26, 2010
Posts: 155
Oh, I totally forgot that I'd asked this question in this forum.

Line 19 from web.xml should be:


So that all files ending with .do extension can be forwarded to ActionServlet.
I wonder why it doesn't work with <url-pattern>/StrutsSayHi.do</url-pattern>
 
Consider Paul's rocket mass heater.
 
subject: Form action attribute is set to root folder
 
It's not a secret anymore!