Javascript and struts submit action Lookup Dispatcher Problem

Discussion in 'Javascript' started by sancha, Jan 17, 2005.

  1. sancha

    sancha Guest

    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
    sancha, Jan 17, 2005
    #1
    1. Advertising

  2. sancha

    Erwin Moller Guest

    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
    Erwin Moller, Jan 17, 2005
    #2
    1. Advertising

  3. sancha

    Erwin Moller Guest

    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
    Erwin Moller, Jan 18, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Bloggs
    Replies:
    1
    Views:
    722
    Sudsy
    Aug 3, 2003
  2. rjweytens
    Replies:
    6
    Views:
    16,049
    rjweytens
    Jun 25, 2004
  3. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,806
    runescience
    Feb 7, 2006
  4. vyshu
    Replies:
    1
    Views:
    2,525
    Richard Senior
    Apr 27, 2007
  5. John
    Replies:
    0
    Views:
    846
Loading...

Share This Page