Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript and struts submit action Lookup Dispatcher Problem

Reply
Thread Tools

Javascript and struts submit action Lookup Dispatcher Problem

 
 
sancha
Guest
Posts: n/a
 
      01-17-2005
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

 
Reply With Quote
 
 
 
 
Erwin Moller
Guest
Posts: n/a
 
      01-17-2005
sancha wrote:

> 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


 
Reply With Quote
 
 
 
 
Erwin Moller
Guest
Posts: n/a
 
      01-18-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts: 1 action, 1 Form, several views handled by 1 only action. Any idea for better design? John Java 0 06-26-2007 11:22 PM
Can we call an Action from another Action in struts??? vyshu Java 1 04-27-2007 09:19 AM
Struts mapping action to action??? runescience Java 3 02-07-2006 04:07 PM
Struts Forward to an Action from an to Action and URLs rjweytens Java 6 06-25-2004 01:49 PM
Struts Static Action Form vs Dyanamic Action Form Joe Bloggs Java 1 08-03-2003 02:30 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57