This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Hyperlink not calling the method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Hyperlink not calling the method" Watch "Hyperlink not calling the method" New topic
Author

Hyperlink not calling the method

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Hi List[],

I am using strut2.0.My problem is that i want on click of hyperlink my action method name save should call and new window
should open.
I did like this but its only opens the window not calling the method .
Please help me how to do this.

i did like this.

<s:a href="customerscreenlist!save.action" onclick="window.open('allocationlist.action','allocate','width=650,height=400,menubar=no,status=no, location=no,toolbar=no,scrollbars=yes'); return false;">Submit</s:a>
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 684



Hi,

Just put your struts.xml code for map your action.


Still we are not get any idea about this why it is not call with this information.


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Its calling the action but showing this message

to display the webpage again,Internet Explorer needs to resend
the information you've previously submitted.

How to avoid this message.
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
pankaj semwal wrote:Its calling the action but showing this message

to display the webpage again,Internet Explorer needs to resend
the information you've previously submitted.

How to avoid this message.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

pankaj semwal wrote:
to display the webpage again,Internet Explorer needs to resend
the information you've previously submitted.



When did you found this message, when you click URL and window appear with this message OR when you try to refresh that new window you opened?

And is this message comes as a alert message box, with two options like, "Resend" and "Cancel" ?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
then how to stop this message.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

pankaj semwal wrote:then how to stop this message.

I think this is not the answer what I asked in my previous post !

But still,, usually I got such error when I refresh the page and FF alerts me like, "This is POST action, do you want to resend it ?" or something like that ..
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Hi,

i get this message when i select check boxes and then press submit button .After this the message come

To display the webpage again,Intenet Explorere needs to resend the information you've previosusly submitted.
If you were making a purchase ,you shuld click cancel to avoid a duplicate transaction.Othwerise ,click retry to
display the webpage agin.


Please help me how to stop this one.And one more probelm i am facing is that

when popwindow opens its does not display the records which i currently selected.
When i refesh the page then its show my all the current records.

Please help me.

Thanks

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

pankaj semwal wrote:

i get this message when i select check boxes and then press submit button .After this the message come

To display the webpage again,Intenet Explorere needs to resend the information you've previosusly submitted.
If you were making a purchase ,you shuld click cancel to avoid a duplicate transaction.Othwerise ,click retry to
display the webpage agin.



This is something weird, a normal SUBMIT action doesn't display such message, if it really do, then there is something wrong you written in your JSP/HTML pages, post the code here..

pankaj semwal wrote:And one more probelm i am facing is that

when popwindow opens its does not display the records which i currently selected.
When i refesh the page then its show my all the current records.


The quick remady will be, just add META tag, which refresh the pages as soon as it loads,

Or you can try another TAG
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Hi,

i used <meta http-equiv="refresh" content="600"> now that message is not coming.But still i am
not getting the records which i currently selected.I get records when i have to refresh the page.

Thanks
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

I'm not getting right now,
You have to post the code of, which page has submit action, which page is popuped with action mapping..
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Hi,

This my jsp page



and this my java script file.


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

O_o

- You're not actually submitting the form to the popup window; is that your intention?
- Ideally, form onsubmit handlers should return true (process the submission) or false (cancel the submission). You're returning a window--IIRC this means the form submission will still occur (could be wrong about that though).

I'm not convinced you're having a Struts issue.
pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Hi,

One more problem is i am facing is that in jsp page if i have only one check box then it does not
open the new window.

Please help me why this.

Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That seems like a JavaScript issue, not Struts. Try debugging with Firebug.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hyperlink not calling the method