Javascript and struts submit action Lookup Dispatcher Problem

S

sancha

Hi,
i am in a bit of a delima here.
I need to submit an action through javascript
so i used

document.forms[0].action='/search.do?&submitaction=Add Minus'
document.forms[0].submit();


since i am working on struts then submitaction maps to through the
action dispatcher.

so where the action is mapperd as Add Minus
it goes as Add%20%Minus because of the way i submitted. Is there any
way i can make it go as Add Minus Please help

Thanx in advance
Sandip
 
E

Erwin Moller

sancha said:
Hi,
i am in a bit of a delima here.
I need to submit an action through javascript
so i used

document.forms[0].action='/search.do?&submitaction=Add Minus'
document.forms[0].submit();


since i am working on struts then submitaction maps to through the
action dispatcher.

so where the action is mapperd as Add Minus
it goes as Add%20%Minus because of the way i submitted. Is there any
way i can make it go as Add Minus Please help

Thanx in advance
Sandip

Hi,

FIrstly:
document.forms[0].action='/search.do?&submitaction=Add Minus'
is wrong.

document.forms[0].action='/search.do?&submitaction=Add+Minus'
would be better.

But i would suggest another field in your form, call it submitaction, and
make it hidden.
Set the value for the hdeen field submitaction, and then just submit.

You are sending information by BOTH the Querystring and the POST.
Very confusing, at least for me, and probably for a few webservers too.

Regards,
Erwin Moller
 
E

Erwin Moller

sandip chaudhuri wrote:

The problem lies in my ignorance in struts.
We have the LookupDispatcher which maps certain words ro the action to
be performed.

Hi,

Why don't you repost your question in a Java newsgroup, since Javascript is
not the problem?

This is a Javascriptnewsgroup.
Try comp.lang.java.help
or
comp.lang.java.programmer

Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top