Two Laptop Bag*
The moose likes Struts and the fly likes is it possible to have multiple actions in a single page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "is it possible to have multiple actions in a single page?" Watch "is it possible to have multiple actions in a single page?" New topic
Author

is it possible to have multiple actions in a single page?

Lovely Reyes
Greenhorn

Joined: Jul 11, 2010
Posts: 3
i have a combo box that needs to call a specific action and i used the javascript onchange event handler.

my code goes like this


in my jsp page:


my JavaScript function:


my sturts configuration:


im hetting an HTTP error Status 404
The requested resource (/selectrcp) is not available.

Can you please help me find where i went wrong or is this possible??



--Lovely--
Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

yes , you can have multiple Actions in a single page.

But i guess the problem is something else.

I suppose struts action mapping.


Thanks
raza!


Good luck!!
A small leak can sink a Gigantic ship.>
Mamata Chaudhari
Greenhorn

Joined: Apr 26, 2009
Posts: 23
hi,

i think you must write HTML method name while submiiting your form like....



and remove / from

document.forms[0].action="/selectrcp";

may this will help you...
Karthik Jayachandran
Ranch Hand

Joined: Feb 18, 2009
Posts: 88



I guess you need to add a
.do
with the action like
selectrcp.do


Lovely Reyes
Greenhorn

Joined: Jul 11, 2010
Posts: 3
Guys, thank you for your suggestions my application is now working
my code goes like this
function selectrcp() {
document.forms[0].method="post";
document.forms[0].action="selectrcp.do";
document.forms[0].submit();
}


Thank you very much for the help
 
Consider Paul's rocket mass heater.
 
subject: is it possible to have multiple actions in a single page?