RE: why my page can't redirect under Struts with Javascript?
Within my javascripts, when I want to post to a different action, I use this struts tidbit:
Re: why my page can't redirect under Struts with Javascript?
I'm sorry, but this is a Javascript issue. If you want to use Struts, use Struts. Create an ActionForm to get your value from the drop-down list and then redirect to any number of Actions from your Action. I believe that is the easiest way, and a LOT less time consuming then sending all of these emails. Gary >>> [EMAIL PROTECTED] 2/20/2006 9:53:33 PM >>> I try follows: function goURL(tmp){ document.forms[0].submit(); } I debug the Javascript,when running the statement document.forms[0].submit(); Javascript raise a error: Microsoft JScript running error:object can't support this attribute or method Why? On 2/21/06, Dave Newton <[EMAIL PROTECTED]> wrote: > > red phoenix wrote: > > I tried follows: > > function goURL(tmp){ > > document.forms[0].action=eval("/Log/log.do?action=First"); > > document.forms[0].submit(); > > } > > > > and > > function goURL(tmp){ > > document.forms[0].action=eval("/log.do?action=First"); > > document.forms[0].submit(); > > } > > > > My page also can't redirect! > > > Why are you eval-ing a string? Since "/log.do?action=First" is not a > valid JavaScript statement, this will fail. > > Pay attention to JavaScript errors. > > Dave > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > __ Confidentiality Statement: This email/fax, including attachments, may include confidential and/or proprietary information and may be used only by the person or entity to which it is addressed. If the reader of this email/fax is not the intended recipient or his or her agent, the reader is hereby notified that any dissemination, distribution or copying of this email/fax is prohibited. If you have received this email/fax in error, please notify the sender by replying to this message and deleting this email or destroying this facsimile immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: why my page can't redirect under Struts with Javascript?
I try follows: function goURL(tmp){ document.forms[0].submit(); } I debug the Javascript,when running the statement document.forms[0].submit(); Javascript raise a error: Microsoft JScript running error:object can't support this attribute or method Why? On 2/21/06, Dave Newton <[EMAIL PROTECTED]> wrote: > > red phoenix wrote: > > I tried follows: > > function goURL(tmp){ > > document.forms[0].action=eval("/Log/log.do?action=First"); > > document.forms[0].submit(); > > } > > > > and > > function goURL(tmp){ > > document.forms[0].action=eval("/log.do?action=First"); > > document.forms[0].submit(); > > } > > > > My page also can't redirect! > > > Why are you eval-ing a string? Since "/log.do?action=First" is not a > valid JavaScript statement, this will fail. > > Pay attention to JavaScript errors. > > Dave > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: why my page can't redirect under Struts with Javascript?
Martin Gainty wrote: > If you are looking for a way for JavaScript to dynamically change > targetting action based on Javascript code take a look at > http://husted.com/struts/tips/002.html Uh, no, I was answering the OP with regards to his hosed up JavaScript :) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: why my page can't redirect under Struts with Javascript?
Sorry, my bad, I didn't even think about that. Right, you don't need the "eval" here. Saul - Original Message - From: "Dave Newton" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Monday, February 20, 2006 7:17 PM Subject: Re: why my page can't redirect under Struts with Javascript? red phoenix wrote: I tried follows: function goURL(tmp){ document.forms[0].action=eval("/Log/log.do?action=First"); document.forms[0].submit(); } and function goURL(tmp){ document.forms[0].action=eval("/log.do?action=First"); document.forms[0].submit(); } My page also can't redirect! Why are you eval-ing a string? Since "/log.do?action=First" is not a valid JavaScript statement, this will fail. Pay attention to JavaScript errors. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: why my page can't redirect under Struts with Javascript?
Dave- If you are looking for a way for JavaScript to dynamically change targetting action based on Javascript code take a look at http://husted.com/struts/tips/002.html HTH, Martin - Original Message - From: "Dave Newton" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Monday, February 20, 2006 8:17 PM Subject: Re: why my page can't redirect under Struts with Javascript? red phoenix wrote: I tried follows: function goURL(tmp){ document.forms[0].action=eval("/Log/log.do?action=First"); document.forms[0].submit(); } and function goURL(tmp){ document.forms[0].action=eval("/log.do?action=First"); document.forms[0].submit(); } My page also can't redirect! Why are you eval-ing a string? Since "/log.do?action=First" is not a valid JavaScript statement, this will fail. Pay attention to JavaScript errors. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: why my page can't redirect under Struts with Javascript?
red phoenix wrote: > I tried follows: > function goURL(tmp){ > document.forms[0].action=eval("/Log/log.do?action=First"); > document.forms[0].submit(); > } > > and > function goURL(tmp){ > document.forms[0].action=eval("/log.do?action=First"); > document.forms[0].submit(); > } > > My page also can't redirect! > Why are you eval-ing a string? Since "/log.do?action=First" is not a valid JavaScript statement, this will fail. Pay attention to JavaScript errors. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: why my page can't redirect under Struts with Javascript?
I tried follows: function goURL(tmp){ document.forms[0].action=eval("/Log/log.do?action=First"); document.forms[0].submit(); } and function goURL(tmp){ document.forms[0].action=eval("/log.do?action=First"); document.forms[0].submit(); } My page also can't redirect! And I try function goURL(tmp){ document.forms[0].submit(); } I find my page still can't redirect!!! but I can use following statement to redirect page, why javascript can't redirect under Struts,and can redirect in the same page? It puzzled me for a very long time. It almost mad me mad. On 2/20/06, Jari Fredriksson <[EMAIL PROTECTED]> wrote: > > Swapnil Patil wrote: > > Hi, > > I modify my Javascript like follows: > > function goURL(tmp){ > > document.forms[0].action=eval("/Log/log.do?action=First"); > > document.forms[0].submit(); > > } > > > > Is eval really needed? . Check whether you really need /Log in > > contexet path? > > > > Try wih following function. > > function goURL(tmp){ > > document.forms[0].action="/log.do?action=First"; > > document.forms[0].submit(); > > } > > > > > Hmm. Why the "action" has to be inserted to the url in the first place? > > Can't the log.do retrieve in as getAction() in the execute? It's the value > of the combobox and should be readable from the form bean. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: why my page can't redirect under Struts with Javascript?
Swapnil Patil wrote: Hi, I modify my Javascript like follows: function goURL(tmp){ document.forms[0].action=eval("/Log/log.do?action=First"); document.forms[0].submit(); } Is eval really needed? . Check whether you really need /Log in contexet path? Try wih following function. function goURL(tmp){ document.forms[0].action="/log.do?action=First"; document.forms[0].submit(); } Hmm. Why the "action" has to be inserted to the url in the first place? Can't the log.do retrieve in as getAction() in the execute? It's the value of the combobox and should be readable from the form bean. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: why my page can't redirect under Struts with Javascript?
Hi, I modify my Javascript like follows: function goURL(tmp){ document.forms[0].action=eval("/Log/log.do?action=First"); document.forms[0].submit(); } Is eval really needed? . Check whether you really need /Log in contexet path? Try wih following function. function goURL(tmp){ document.forms[0].action="/log.do?action=First"; document.forms[0].submit(); } On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > I modify my Javascript like follows: > function goURL(tmp){ > document.forms[0].action=eval("/Log/log.do?action=First"); > document.forms[0].submit(); > } > > But when I change the value of ,it still can't redirect. I am > mad with it! > > > On 2/20/06, Swapnil Patil <[EMAIL PROTECTED]> wrote: > > > > Hi red, > > > > First Page > > this works with action parameter containing value= "First" NOT "0". > > > > Your 'tmp' variable in script function contains value 0,1 or 2. Your > > log.do action might be checking content of action parameter with values > > "First", "Second" or "Third" > > > > Try it again with following manner. > > > > > > First > > Second > > Third > > > > > > I hope it will work. > > > > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > > > I have try follows two method: > > > function goURL(tmp){ > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > alert(eval("/Log/log.do?action="+tmp)); > > > document.forms[0].submit(); > > > } > > > > > > and > > > > > > function goURL(tmp){ > > > var newAct = "/Log/log.do?action="+tmp; > > > document.forms[0].action = newAct; > > > alert(newAct) > > > document.forms[0].submit(); > > > } > > > > > > I find Javasript can alert right value,such as /Log/log.do?action=3 > > > but I find Javascript don't redirect any page,my action don't be > called! > > > Why? > > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > > > A few things here, > > > > > > > > 1) I think you need build the action like the following; > > > > > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > > > > > or do it in two steps: > > > > > > > > var newAct = "/Log/log.do?action="+tmp; > > > > document.forms[0].action = newAct; > > > > > > > > 2) how are you checking the action parameter in your Action class, > > > > checking > > > > action=First or action=0? > > > > the above will give you action=0, or action=1 etc, but not > > action=First, > > > > action=Second. The reason I ask the question is b/c you mentioned > > > > > > > page="/log.do?action=First">First Page works for you, > you > > > are > > > > passing a "First" to the action in this case. > > > > > > > > > > > > Saul > > > > > > > > - Original Message - > > > > From: "red phoenix" <[EMAIL PROTECTED]> > > > > To: "Struts Users Mailing List" > > > > Sent: Sunday, February 19, 2006 10:12 PM > > > > Subject: Re: why my page can't redirect under Struts with > Javascript? > > > > > > > > > > > > My web context is Log,so I add prefix before,like follows: > > > > > > > > document.forms[0].action="/Log/log.do?action="+eval(tmp); > > > > > > > > but when I change the value of ,it still can't > redirect,I > > > am > > > > puzzled it for several days.I don't know why it don't redirect!!! > > > > > > > > I want to use above code to make a pagination program,the > > > > > > shows all pages,such as 1st Page,2nd Page,3rd Page and so on,when > > > selected > > > > one of items of ,it will call Javascript and redirect > > page > > > to > > > > a > > > > action. > > > > > > > > Anybody can give me some adivce? > > > > > > > > > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > > > > > For the following: &g
Re: why my page can't redirect under Struts with Javascript?
I have tried function goURL(tmp){ var url = "<%=response.encodeURL("/Log/log.do")%>"; document.forms[0].action=url + "?action=" + tmp; alert(url + "?action=" + tmp); document.forms[0].submit(); } Javascript can alert the right information,such as "/Log/log.do?action=3" But the page still can't redirect! Why can't redirect? On 2/20/06, raja sekar <[EMAIL PROTECTED]> wrote: > > try this > > function goURL(tmp){ > var url = "<%=response.encodeURL("/Log/log.do")%>"; > document.forms[0].action=url + "?action=" + tmp; > document.forms[0].submit(); > } > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > when I Javascript execute > > var url = <%=response.encodeURL("/Log/log.do")%>; > > > > IE raise script error: > > Raise error during running period,debug or not > > Line:81 > > Error:missing ';' > > > > > > On 2/20/06, raja sekar <[EMAIL PROTECTED]> wrote: > > > > > > modify your javascript like this > > > > > > function goURL(tmp){ > > > var url = <%=response.encodeURL("/Log/log.do")%>; > > > document.forms[0].action=url + "?action=" + tmp; > > > document.forms[0].submit(); > > > } > > > > > > and try... > > > > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > > > > > I modify my Javascript like follows: > > > > function goURL(tmp){ > > > > document.forms[0].action=eval("/Log/log.do?action=First"); > > > > document.forms[0].submit(); > > > > } > > > > > > > > But when I change the value of ,it still can't > redirect. > > I > > > am > > > > mad with it! > > > > > > > > > > > > On 2/20/06, Swapnil Patil <[EMAIL PROTECTED]> wrote: > > > > > > > > > > Hi red, > > > > > > > > > > First Page > > > > > this works with action parameter containing value= "First" NOT > "0". > > > > > > > > > > Your 'tmp' variable in script function contains value 0,1 or > > 2. Your > > > > > log.do action might be checking content of action parameter with > > > values > > > > > "First", "Second" or "Third" > > > > > > > > > > Try it again with following manner. > > > > > > > > > > onchange="javascript:goURL( > > > > > this.options[this.selectedIndex].value)"> > > > > > First > > > > > Second > > > > > Third > > > > > > > > > > > > > > > I hope it will work. > > > > > > > > > > > > > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > I have try follows two method: > > > > > > function goURL(tmp){ > > > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > > > alert(eval("/Log/log.do?action="+tmp)); > > > > > > document.forms[0].submit(); > > > > > > } > > > > > > > > > > > > and > > > > > > > > > > > > function goURL(tmp){ > > > > > > var newAct = "/Log/log.do?action="+tmp; > > > > > > document.forms[0].action = newAct; > > > > > > alert(newAct) > > > > > > document.forms[0].submit(); > > > > > > } > > > > > > > > > > > > I find Javasript can alert right value,such as > > /Log/log.do?action=3 > > > > > > but I find Javascript don't redirect any page,my action don't be > > > > called! > > > > > > Why? > > > > > > > > > > > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > A few things here, > > > > > > > > > > > > > > 1) I think you need build the action like the following; > > > > > > > > > > > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > > > > > > > >
Re: why my page can't redirect under Struts with Javascript?
try this function goURL(tmp){ var url = "<%=response.encodeURL("/Log/log.do")%>"; document.forms[0].action=url + "?action=" + tmp; document.forms[0].submit(); } On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > when I Javascript execute > var url = <%=response.encodeURL("/Log/log.do")%>; > > IE raise script error: > Raise error during running period,debug or not > Line:81 > Error:missing ';' > > > On 2/20/06, raja sekar <[EMAIL PROTECTED]> wrote: > > > > modify your javascript like this > > > > function goURL(tmp){ > > var url = <%=response.encodeURL("/Log/log.do")%>; > > document.forms[0].action=url + "?action=" + tmp; > > document.forms[0].submit(); > > } > > > > and try... > > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > > > I modify my Javascript like follows: > > > function goURL(tmp){ > > > document.forms[0].action=eval("/Log/log.do?action=First"); > > > document.forms[0].submit(); > > > } > > > > > > But when I change the value of ,it still can't redirect. > I > > am > > > mad with it! > > > > > > > > > On 2/20/06, Swapnil Patil <[EMAIL PROTECTED]> wrote: > > > > > > > > Hi red, > > > > > > > > First Page > > > > this works with action parameter containing value= "First" NOT "0". > > > > > > > > Your 'tmp' variable in script function contains value 0,1 or > 2. Your > > > > log.do action might be checking content of action parameter with > > values > > > > "First", "Second" or "Third" > > > > > > > > Try it again with following manner. > > > > > > > > > > > > First > > > > Second > > > > Third > > > > > > > > > > > > I hope it will work. > > > > > > > > > > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > > > > > > > I have try follows two method: > > > > > function goURL(tmp){ > > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > > alert(eval("/Log/log.do?action="+tmp)); > > > > > document.forms[0].submit(); > > > > > } > > > > > > > > > > and > > > > > > > > > > function goURL(tmp){ > > > > > var newAct = "/Log/log.do?action="+tmp; > > > > > document.forms[0].action = newAct; > > > > > alert(newAct) > > > > > document.forms[0].submit(); > > > > > } > > > > > > > > > > I find Javasript can alert right value,such as > /Log/log.do?action=3 > > > > > but I find Javascript don't redirect any page,my action don't be > > > called! > > > > > Why? > > > > > > > > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > A few things here, > > > > > > > > > > > > 1) I think you need build the action like the following; > > > > > > > > > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > > > > > > > > > or do it in two steps: > > > > > > > > > > > > var newAct = "/Log/log.do?action="+tmp; > > > > > > document.forms[0].action = newAct; > > > > > > > > > > > > 2) how are you checking the action parameter in your Action > class, > > > > > > checking > > > > > > action=First or action=0? > > > > > > the above will give you action=0, or action=1 etc, but not > > > > action=First, > > > > > > action=Second. The reason I ask the question is b/c you > mentioned > > > > > > > > > > > page="/log.do?action=First">First Page works for > you, > > > you > > > > > are > > > > > > passing a "First" to the action in this case. > > > > > > > > > > > > > > > > > > Saul > > > > > > > > > > > > - Origina
Re: why my page can't redirect under Struts with Javascript?
when I Javascript execute var url = <%=response.encodeURL("/Log/log.do")%>; IE raise script error: Raise error during running period,debug or not Line:81 Error:missing ';' On 2/20/06, raja sekar <[EMAIL PROTECTED]> wrote: > > modify your javascript like this > > function goURL(tmp){ > var url = <%=response.encodeURL("/Log/log.do")%>; > document.forms[0].action=url + "?action=" + tmp; > document.forms[0].submit(); > } > > and try... > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > I modify my Javascript like follows: > > function goURL(tmp){ > > document.forms[0].action=eval("/Log/log.do?action=First"); > > document.forms[0].submit(); > > } > > > > But when I change the value of ,it still can't redirect. I > am > > mad with it! > > > > > > On 2/20/06, Swapnil Patil <[EMAIL PROTECTED]> wrote: > > > > > > Hi red, > > > > > > First Page > > > this works with action parameter containing value= "First" NOT "0". > > > > > > Your 'tmp' variable in script function contains value 0,1 or 2. Your > > > log.do action might be checking content of action parameter with > values > > > "First", "Second" or "Third" > > > > > > Try it again with following manner. > > > > > > > > > First > > > Second > > > Third > > > > > > > > > I hope it will work. > > > > > > > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > > > > > I have try follows two method: > > > > function goURL(tmp){ > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > alert(eval("/Log/log.do?action="+tmp)); > > > > document.forms[0].submit(); > > > > } > > > > > > > > and > > > > > > > > function goURL(tmp){ > > > > var newAct = "/Log/log.do?action="+tmp; > > > > document.forms[0].action = newAct; > > > > alert(newAct) > > > > document.forms[0].submit(); > > > > } > > > > > > > > I find Javasript can alert right value,such as /Log/log.do?action=3 > > > > but I find Javascript don't redirect any page,my action don't be > > called! > > > > Why? > > > > > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > > > > > A few things here, > > > > > > > > > > 1) I think you need build the action like the following; > > > > > > > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > > > > > > > or do it in two steps: > > > > > > > > > > var newAct = "/Log/log.do?action="+tmp; > > > > > document.forms[0].action = newAct; > > > > > > > > > > 2) how are you checking the action parameter in your Action class, > > > > > checking > > > > > action=First or action=0? > > > > > the above will give you action=0, or action=1 etc, but not > > > action=First, > > > > > action=Second. The reason I ask the question is b/c you mentioned > > > > > > > > > page="/log.do?action=First">First Page works for you, > > you > > > > are > > > > > passing a "First" to the action in this case. > > > > > > > > > > > > > > > Saul > > > > > > > > > > - Original Message - > > > > > From: "red phoenix" <[EMAIL PROTECTED]> > > > > > To: "Struts Users Mailing List" > > > > > Sent: Sunday, February 19, 2006 10:12 PM > > > > > Subject: Re: why my page can't redirect under Struts with > > Javascript? > > > > > > > > > > > > > > > My web context is Log,so I add prefix before,like follows: > > > > > > > > > > document.forms[0].action="/Log/log.do?action="+eval(tmp); > > > > > > > > > > but when I change the value of ,it still can't > > redirect,I > > > > am > > > > > puzzled it for several days.I don't know why it don't red
Re: why my page can't redirect under Struts with Javascript?
modify your javascript like this function goURL(tmp){ var url = <%=response.encodeURL("/Log/log.do")%>; document.forms[0].action=url + "?action=" + tmp; document.forms[0].submit(); } and try... On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > I modify my Javascript like follows: > function goURL(tmp){ > document.forms[0].action=eval("/Log/log.do?action=First"); > document.forms[0].submit(); > } > > But when I change the value of ,it still can't redirect. I am > mad with it! > > > On 2/20/06, Swapnil Patil <[EMAIL PROTECTED]> wrote: > > > > Hi red, > > > > First Page > > this works with action parameter containing value= "First" NOT "0". > > > > Your 'tmp' variable in script function contains value 0,1 or 2. Your > > log.do action might be checking content of action parameter with values > > "First", "Second" or "Third" > > > > Try it again with following manner. > > > > > > First > > Second > > Third > > > > > > I hope it will work. > > > > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > > > I have try follows two method: > > > function goURL(tmp){ > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > alert(eval("/Log/log.do?action="+tmp)); > > > document.forms[0].submit(); > > > } > > > > > > and > > > > > > function goURL(tmp){ > > > var newAct = "/Log/log.do?action="+tmp; > > > document.forms[0].action = newAct; > > > alert(newAct) > > > document.forms[0].submit(); > > > } > > > > > > I find Javasript can alert right value,such as /Log/log.do?action=3 > > > but I find Javascript don't redirect any page,my action don't be > called! > > > Why? > > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > > > A few things here, > > > > > > > > 1) I think you need build the action like the following; > > > > > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > > > > > or do it in two steps: > > > > > > > > var newAct = "/Log/log.do?action="+tmp; > > > > document.forms[0].action = newAct; > > > > > > > > 2) how are you checking the action parameter in your Action class, > > > > checking > > > > action=First or action=0? > > > > the above will give you action=0, or action=1 etc, but not > > action=First, > > > > action=Second. The reason I ask the question is b/c you mentioned > > > > > > > page="/log.do?action=First">First Page works for you, > you > > > are > > > > passing a "First" to the action in this case. > > > > > > > > > > > > Saul > > > > > > > > - Original Message - > > > > From: "red phoenix" <[EMAIL PROTECTED]> > > > > To: "Struts Users Mailing List" > > > > Sent: Sunday, February 19, 2006 10:12 PM > > > > Subject: Re: why my page can't redirect under Struts with > Javascript? > > > > > > > > > > > > My web context is Log,so I add prefix before,like follows: > > > > > > > > document.forms[0].action="/Log/log.do?action="+eval(tmp); > > > > > > > > but when I change the value of ,it still can't > redirect,I > > > am > > > > puzzled it for several days.I don't know why it don't redirect!!! > > > > > > > > I want to use above code to make a pagination program,the > > > > > > shows all pages,such as 1st Page,2nd Page,3rd Page and so on,when > > > selected > > > > one of items of ,it will call Javascript and redirect > > page > > > to > > > > a > > > > action. > > > > > > > > Anybody can give me some adivce? > > > > > > > > > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > > > > > For the following: > > > > > > > > > > document.forms[0].action="/log.do?action="+eval(tmp); > > > > > > > > > &g
Re: why my page can't redirect under Struts with Javascript?
I modify my Javascript like follows: function goURL(tmp){ document.forms[0].action=eval("/Log/log.do?action=First"); document.forms[0].submit(); } But when I change the value of ,it still can't redirect. I am mad with it! On 2/20/06, Swapnil Patil <[EMAIL PROTECTED]> wrote: > > Hi red, > > First Page > this works with action parameter containing value= "First" NOT "0". > > Your 'tmp' variable in script function contains value 0,1 or 2. Your > log.do action might be checking content of action parameter with values > "First", "Second" or "Third" > > Try it again with following manner. > > > First > Second > Third > > > I hope it will work. > > > On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > > > I have try follows two method: > > function goURL(tmp){ > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > alert(eval("/Log/log.do?action="+tmp)); > > document.forms[0].submit(); > > } > > > > and > > > > function goURL(tmp){ > > var newAct = "/Log/log.do?action="+tmp; > > document.forms[0].action = newAct; > > alert(newAct) > > document.forms[0].submit(); > > } > > > > I find Javasript can alert right value,such as /Log/log.do?action=3 > > but I find Javascript don't redirect any page,my action don't be called! > > Why? > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > A few things here, > > > > > > 1) I think you need build the action like the following; > > > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > > > or do it in two steps: > > > > > > var newAct = "/Log/log.do?action="+tmp; > > > document.forms[0].action = newAct; > > > > > > 2) how are you checking the action parameter in your Action class, > > > checking > > > action=First or action=0? > > > the above will give you action=0, or action=1 etc, but not > action=First, > > > action=Second. The reason I ask the question is b/c you mentioned > > > > > page="/log.do?action=First">First Page works for you, you > > are > > > passing a "First" to the action in this case. > > > > > > > > > Saul > > > > > > - Original Message - > > > From: "red phoenix" <[EMAIL PROTECTED]> > > > To: "Struts Users Mailing List" > > > Sent: Sunday, February 19, 2006 10:12 PM > > > Subject: Re: why my page can't redirect under Struts with Javascript? > > > > > > > > > My web context is Log,so I add prefix before,like follows: > > > > > > document.forms[0].action="/Log/log.do?action="+eval(tmp); > > > > > > but when I change the value of ,it still can't redirect,I > > am > > > puzzled it for several days.I don't know why it don't redirect!!! > > > > > > I want to use above code to make a pagination program,the > > > > shows all pages,such as 1st Page,2nd Page,3rd Page and so on,when > > selected > > > one of items of ,it will call Javascript and redirect > page > > to > > > a > > > action. > > > > > > Anybody can give me some adivce? > > > > > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > > > For the following: > > > > > > > > document.forms[0].action="/log.do?action="+eval(tmp); > > > > > > > > You'll need to prefix "/log.do" with your web context. Or you can > use: > > > > in place of /log.do above. > > > > > > > > hope it helps. > > > > Saul > > > > > > > > > > > > - Original Message - > > > > From: "red phoenix" <[EMAIL PROTECTED]> > > > > To: > > > > Sent: Sunday, February 19, 2006 6:48 PM > > > > Subject: why my page can't redirect under Struts with Javascript? > > > > > > > > > > > > I use Javascript in Struts,like follows: > > > > > > > > > > > > function goURL(tmp){ > > > > alert(tmp); > > > > document.forms[0].action="/log.do?action="+eval(tmp); > > > > document.forms[0].submit(); > > > > } > > > > > > > > > > > > > > > > First Page > > > > > > > > First > > > > Second > > > > Third > > > > > > > > > > > > > > > > when click "First Page",I can redirect my page to log.do page,but > when > > I > > > > change the value of select,and call goURL,I find my page don't > > redirect > > > to > > > > the log.do page,why? I am puzzled with it! Anybody can tell me how > to > > > > redirect my page with Javascript under Struts? > > > > > > > > Thanks > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > -- > Thanks & Regards > Swapnil Patil. > >
Re: why my page can't redirect under Struts with Javascript?
Hi red, First Page this works with action parameter containing value= "First" NOT "0". Your 'tmp' variable in script function contains value 0,1 or 2. Your log.do action might be checking content of action parameter with values "First", "Second" or "Third" Try it again with following manner. First Second Third I hope it will work. On 2/20/06, red phoenix <[EMAIL PROTECTED]> wrote: > > I have try follows two method: > function goURL(tmp){ > document.forms[0].action=eval("/Log/log.do?action="+tmp); > alert(eval("/Log/log.do?action="+tmp)); > document.forms[0].submit(); > } > > and > > function goURL(tmp){ > var newAct = "/Log/log.do?action="+tmp; > document.forms[0].action = newAct; > alert(newAct) > document.forms[0].submit(); > } > > I find Javasript can alert right value,such as /Log/log.do?action=3 > but I find Javascript don't redirect any page,my action don't be called! > Why? > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > A few things here, > > > > 1) I think you need build the action like the following; > > > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > > > or do it in two steps: > > > > var newAct = "/Log/log.do?action="+tmp; > > document.forms[0].action = newAct; > > > > 2) how are you checking the action parameter in your Action class, > > checking > > action=First or action=0? > > the above will give you action=0, or action=1 etc, but not action=First, > > action=Second. The reason I ask the question is b/c you mentioned > > > page="/log.do?action=First">First Page works for you, you > are > > passing a "First" to the action in this case. > > > > > > Saul > > > > - Original Message - > > From: "red phoenix" <[EMAIL PROTECTED]> > > To: "Struts Users Mailing List" > > Sent: Sunday, February 19, 2006 10:12 PM > > Subject: Re: why my page can't redirect under Struts with Javascript? > > > > > > My web context is Log,so I add prefix before,like follows: > > > > document.forms[0].action="/Log/log.do?action="+eval(tmp); > > > > but when I change the value of ,it still can't redirect,I > am > > puzzled it for several days.I don't know why it don't redirect!!! > > > > I want to use above code to make a pagination program,the > > shows all pages,such as 1st Page,2nd Page,3rd Page and so on,when > selected > > one of items of ,it will call Javascript and redirect page > to > > a > > action. > > > > Anybody can give me some adivce? > > > > > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > > > For the following: > > > > > > document.forms[0].action="/log.do?action="+eval(tmp); > > > > > > You'll need to prefix "/log.do" with your web context. Or you can use: > > > in place of /log.do above. > > > > > > hope it helps. > > > Saul > > > > > > > > > - Original Message - > > > From: "red phoenix" <[EMAIL PROTECTED]> > > > To: > > > Sent: Sunday, February 19, 2006 6:48 PM > > > Subject: why my page can't redirect under Struts with Javascript? > > > > > > > > > I use Javascript in Struts,like follows: > > > > > > > > > function goURL(tmp){ > > > alert(tmp); > > > document.forms[0].action="/log.do?action="+eval(tmp); > > > document.forms[0].submit(); > > > } > > > > > > > > > > > > First Page > > > > > > First > > > Second > > > Third > > > > > > > > > > > > when click "First Page",I can redirect my page to log.do page,but when > I > > > change the value of select,and call goURL,I find my page don't > redirect > > to > > > the log.do page,why? I am puzzled with it! Anybody can tell me how to > > > redirect my page with Javascript under Struts? > > > > > > Thanks > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- Thanks & Regards Swapnil Patil.
Re: why my page can't redirect under Struts with Javascript?
I have try follows two method: function goURL(tmp){ document.forms[0].action=eval("/Log/log.do?action="+tmp); alert(eval("/Log/log.do?action="+tmp)); document.forms[0].submit(); } and function goURL(tmp){ var newAct = "/Log/log.do?action="+tmp; document.forms[0].action = newAct; alert(newAct) document.forms[0].submit(); } I find Javasript can alert right value,such as /Log/log.do?action=3 but I find Javascript don't redirect any page,my action don't be called! Why? On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > A few things here, > > 1) I think you need build the action like the following; > > document.forms[0].action=eval("/Log/log.do?action="+tmp); > > or do it in two steps: > > var newAct = "/Log/log.do?action="+tmp; > document.forms[0].action = newAct; > > 2) how are you checking the action parameter in your Action class, > checking > action=First or action=0? > the above will give you action=0, or action=1 etc, but not action=First, > action=Second. The reason I ask the question is b/c you mentioned > page="/log.do?action=First">First Page works for you, you are > passing a "First" to the action in this case. > > > Saul > > ----- Original Message - > From: "red phoenix" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Sunday, February 19, 2006 10:12 PM > Subject: Re: why my page can't redirect under Struts with Javascript? > > > My web context is Log,so I add prefix before,like follows: > > document.forms[0].action="/Log/log.do?action="+eval(tmp); > > but when I change the value of ,it still can't redirect,I am > puzzled it for several days.I don't know why it don't redirect!!! > > I want to use above code to make a pagination program,the > shows all pages,such as 1st Page,2nd Page,3rd Page and so on,when selected > one of items of ,it will call Javascript and redirect page to > a > action. > > Anybody can give me some adivce? > > > > On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > > > For the following: > > > > document.forms[0].action="/log.do?action="+eval(tmp); > > > > You'll need to prefix "/log.do" with your web context. Or you can use: > > in place of /log.do above. > > > > hope it helps. > > Saul > > > > > > - Original Message - > > From: "red phoenix" <[EMAIL PROTECTED]> > > To: > > Sent: Sunday, February 19, 2006 6:48 PM > > Subject: why my page can't redirect under Struts with Javascript? > > > > > > I use Javascript in Struts,like follows: > > > > > > function goURL(tmp){ > > alert(tmp); > > document.forms[0].action="/log.do?action="+eval(tmp); > > document.forms[0].submit(); > > } > > > > > > > > First Page > > > > First > > Second > > Third > > > > > > > > when click "First Page",I can redirect my page to log.do page,but when I > > change the value of select,and call goURL,I find my page don't redirect > to > > the log.do page,why? I am puzzled with it! Anybody can tell me how to > > redirect my page with Javascript under Struts? > > > > Thanks > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: why my page can't redirect under Struts with Javascript?
A few things here, 1) I think you need build the action like the following; document.forms[0].action=eval("/Log/log.do?action="+tmp); or do it in two steps: var newAct = "/Log/log.do?action="+tmp; document.forms[0].action = newAct; 2) how are you checking the action parameter in your Action class, checking action=First or action=0? the above will give you action=0, or action=1 etc, but not action=First, action=Second. The reason I ask the question is b/c you mentioned page="/log.do?action=First">First Page works for you, you are passing a "First" to the action in this case. Saul - Original Message - From: "red phoenix" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Sunday, February 19, 2006 10:12 PM Subject: Re: why my page can't redirect under Struts with Javascript? My web context is Log,so I add prefix before,like follows: document.forms[0].action="/Log/log.do?action="+eval(tmp); but when I change the value of ,it still can't redirect,I am puzzled it for several days.I don't know why it don't redirect!!! I want to use above code to make a pagination program,the shows all pages,such as 1st Page,2nd Page,3rd Page and so on,when selected one of items of ,it will call Javascript and redirect page to a action. Anybody can give me some adivce? On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: For the following: document.forms[0].action="/log.do?action="+eval(tmp); You'll need to prefix "/log.do" with your web context. Or you can use: in place of /log.do above. hope it helps. Saul - Original Message ----- From: "red phoenix" <[EMAIL PROTECTED]> To: Sent: Sunday, February 19, 2006 6:48 PM Subject: why my page can't redirect under Struts with Javascript? I use Javascript in Struts,like follows: function goURL(tmp){ alert(tmp); document.forms[0].action="/log.do?action="+eval(tmp); document.forms[0].submit(); } First Page First Second Third when click "First Page",I can redirect my page to log.do page,but when I change the value of select,and call goURL,I find my page don't redirect to the log.do page,why? I am puzzled with it! Anybody can tell me how to redirect my page with Javascript under Struts? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: why my page can't redirect under Struts with Javascript?
My web context is Log,so I add prefix before,like follows: document.forms[0].action="/Log/log.do?action="+eval(tmp); but when I change the value of ,it still can't redirect,I am puzzled it for several days.I don't know why it don't redirect!!! I want to use above code to make a pagination program,the shows all pages,such as 1st Page,2nd Page,3rd Page and so on,when selected one of items of ,it will call Javascript and redirect page to a action. Anybody can give me some adivce? On 2/20/06, Saul Qunming Yuan <[EMAIL PROTECTED]> wrote: > > For the following: > > document.forms[0].action="/log.do?action="+eval(tmp); > > You'll need to prefix "/log.do" with your web context. Or you can use: > in place of /log.do above. > > hope it helps. > Saul > > > - Original Message - > From: "red phoenix" <[EMAIL PROTECTED]> > To: > Sent: Sunday, February 19, 2006 6:48 PM > Subject: why my page can't redirect under Struts with Javascript? > > > I use Javascript in Struts,like follows: > > > function goURL(tmp){ > alert(tmp); > document.forms[0].action="/log.do?action="+eval(tmp); > document.forms[0].submit(); > } > > > > First Page > > First > Second > Third > > > > when click "First Page",I can redirect my page to log.do page,but when I > change the value of select,and call goURL,I find my page don't redirect to > the log.do page,why? I am puzzled with it! Anybody can tell me how to > redirect my page with Javascript under Struts? > > Thanks > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: why my page can't redirect under Struts with Javascript?
For the following: document.forms[0].action="/log.do?action="+eval(tmp); You'll need to prefix "/log.do" with your web context. Or you can use: in place of /log.do above. hope it helps. Saul - Original Message - From: "red phoenix" <[EMAIL PROTECTED]> To: Sent: Sunday, February 19, 2006 6:48 PM Subject: why my page can't redirect under Struts with Javascript? I use Javascript in Struts,like follows: function goURL(tmp){ alert(tmp); document.forms[0].action="/log.do?action="+eval(tmp); document.forms[0].submit(); } First Page First Second Third when click "First Page",I can redirect my page to log.do page,but when I change the value of select,and call goURL,I find my page don't redirect to the log.do page,why? I am puzzled with it! Anybody can tell me how to redirect my page with Javascript under Struts? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
why my page can't redirect under Struts with Javascript?
I use Javascript in Struts,like follows: function goURL(tmp){ alert(tmp); document.forms[0].action="/log.do?action="+eval(tmp); document.forms[0].submit(); } First Page First Second Third when click "First Page",I can redirect my page to log.do page,but when I change the value of select,and call goURL,I find my page don't redirect to the log.do page,why? I am puzzled with it! Anybody can tell me how to redirect my page with Javascript under Struts? Thanks