aspose file tools*
The moose likes Struts and the fly likes Navigation problem in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Navigation problem in struts" Watch "Navigation problem in struts" New topic
Author

Navigation problem in struts

Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
Hello All,

I have a input form with an action .do, i donno why the .do is opening another window, i want to close the window onsubmit and refresh the parent window.

can i control anything from struts-config or do i need to control from javascript, if javascript i donno on which event i should write the function because the framework is calling the .do

Help Me please...

Thanks in Advance,
Srilakshmi
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
Perhaps in your Action class code you are forwarding the request to some other form rather than parent form.

Can you post your struts-config file and Action class code.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

The target is specified in the html/javascript and should have nothing to do with Struts specifically.


A good workman is known by his tools.
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
Hi Kaur,

Thanks for your reply.

Corresponding actions are..

<action path="/SubmitContact"
type="org.fdny.cts.actions.SubmitContact"
name="contactForm"
scope="request"
validate="true"
input="/jsp/AddCall.jsp">
<forward name="success" path="/DisplayCallStatus"/>
</action>

<action path="/DisplayCallStatus"
type="org.fdny.cts.actions.CallStatus"
name="contactForm"
scope="request" validate="false">
<forward name="success" path="/jsp/CallStatus.jsp"/>
</action>

Action class is pretty much plain one
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
First of all, are you using target attribute in html:form tag.

<action path="/SubmitContact"
type="org.fdny.cts.actions.SubmitContact"
name="contactForm"
scope="request"
validate="true"
input="/jsp/AddCall.jsp">
<forward name="success" path="/DisplayCallStatus"/>
</action>

<action path="/DisplayCallStatus"
type="org.fdny.cts.actions.CallStatus"
name="contactForm"
scope="request" validate="false">
<forward name="success" path="/jsp/CallStatus.jsp"/>
</action>


From the struts-config file I can't make out much about the real flow of actions except that first you have some window for SubmitContact and onsubmit of this page, if error then you have AddCall.jsp page otherwise in your action class you might be forwarding to DisplayCallStatus action(another jsp form). On this form submit, your action class is forwarding the request to another page CallStatus.jsp

I don't know if the above analysis will help you much.
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
Thanks!!!

Let me explain my problem!!

I have a page1, which displays set of values, page2 is an input form this is called in a popup window from page1. when page2 submit is hit, submit action is opening in another popup window.
instead i want submit action of page1 should come in the same window and after it should refresh the page1

i.e., on submit of page2 i want to refresh page1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Navigation problem in struts