You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ujulu <ki...@misys.com> on 2008/10/04 16:17:35 UTC
Struts 1.2.8: Submit-Button and HTML-Link on the same page problem
Hi All,
I am new to Struts, and need your help!
I am experiencing the following problem:
1. I have a simple JSP page similar to the following:
<html:form method="POST" action="/someaction.do">
<p>
<html:rewrite page= " target="_blank">get PDF doc here
</p>
<br />
<html:submit property="__action__backButton">lastPage</html:submit>
</html:form>
2. The corresponding struts-config.xml entry:
<action path="/someaction"
type="test.SomeAction"
name="beanName"
scope="session"
validate="false"
parameter="backButton">
<forward name="success" path="/backPage.jsp"/>
</action>
3. Everything works fine until the user is directed to the above JSP page.
When the user is in this page
and clicks on the submit button the user will be taken to the last page
without any problem. But if
the link is clicked first a new popup window will be opened where a PDF
document will be generated and
displayed to the user. Till now everything is OK! Now comes the problem:
Now I close the popup window and click the submit button that is
pointing to the page in the
<forward> tag, the previously generated PDF document is displayed
without even consulting the
ActionServlet (I set breakpoints on both the doGet() and doPost()
methods, and they are not reached)
If I click on the submit button, I thought that the form will be submitted
and the action will be intercepted by the ActionServlet and finally by the
corresponding Action object which is supposed to forward the response to the
"/backPage.jsp". This problem happens only if I first click on the link, and
then on the submit button. I have even defined a <forward> in the
<global-forwards> area as well as an <action> for the link and used the
'action' and 'forward' attributes of the <html:link> tag. The same effect.
Any hint will be very appreciated!
Ujulu
--
View this message in context: http://www.nabble.com/Struts-1.2.8%3A-Submit-Button-and-HTML-Link-on-the-same-page-problem-tp19812419p19812419.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 1.2.8: Submit-Button and HTML-Link on the same page
problem
Posted by ujulu <ki...@misys.com>.
Sorry Antonio,
this was my first post and didn't know why it is formatting the tag even
though it is not supposed to be an HTML message. I corrected the original
message using <html:link> instead of .
Thx!
Antonio Petrelli-3 wrote:
>
> 2008/10/4 ujulu <ki...@misys.com>:
>> <html:form method="POST" action="/someaction.do">
>> <p>
>> <html:rewrite page= " target="_blank">get PDF doc here
>> </p>
>> <br />
>> <html:submit property="__action__backButton">lastPage</html:submit>
>> </html:form>
>
> Can you post the correct code? There is obviously a typo in your
> cut'n'paste.
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Struts-1.2.8%3A-Submit-Button-and-HTML-Link-on-the-same-page-problem-tp19812419p19812684.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 1.2.8: Submit-Button and HTML-Link on the same page problem
Posted by Antonio Petrelli <an...@gmail.com>.
2008/10/4 ujulu <ki...@misys.com>:
> <html:form method="POST" action="/someaction.do">
> <p>
> <html:rewrite page= " target="_blank">get PDF doc here
> </p>
> <br />
> <html:submit property="__action__backButton">lastPage</html:submit>
> </html:form>
Can you post the correct code? There is obviously a typo in your cut'n'paste.
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 1.2.8: Submit-Button and HTML-Link on the same page problem
Posted by Antonio Petrelli <an...@gmail.com>.
2008/10/4 ujulu <ki...@misys.com>:
> hopefully this one displays correctly; the html is parsed even if I haven't
> checked it. (Preview shows me correctly; but the output is wrong ;-)
Sorry I have not been clear.
Your code is formatted correctly, it is the code itself that is wrong.
<html:rewrite> is not closed, and it does not have any "target" attribute.
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 1.2.8: Submit-Button and HTML-Link on the same page
problem
Posted by ujulu <ki...@misys.com>.
Thanks Antonio,
hopefully this one displays correctly; the html is parsed even if I haven't
checked it. (Preview shows me correctly; but the output is wrong ;-)
<blockquote>
<html:form method="POST" action="/someaction.do">
<p>
<html:rewrite page= " target="_blank">get PDF doc here
</p>
<br />
<html:submit property="__action__backButton">lastPage</html:submit>
</html:form>
</blockquote>
regards,
ujulu
Antonio Petrelli-3 wrote:
>
> 2008/10/4 ujulu <ki...@misys.com>:
>>
>> Sorry, it is automatically formatted; here is it again:
>
> So it is wrong on purpose, so what exactly is this?
>
>> <html:rewrite page= " target="_blank">get PDF doc here
>
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Struts-1.2.8%3A-Submit-Button-and-HTML-Link-on-the-same-page-problem-tp19812419p19812571.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 1.2.8: Submit-Button and HTML-Link on the same page
problem
Posted by ujulu <ki...@misys.com>.
Thanks Antonio,
still another try:
Sorry, it is automatically formatted; here is it again:
<blockquote>
<html:form method="POST" action="/someaction.do">
<p>
<html:link href="<html:rewrite page=" /servlet/uPDF.pdf" />"
target="_blank">
get PDF doc here
</html:link>
</p>
<br />
<html:submit property="__action__backButton">lastPage</html:submit>
</html:form>
</blockquote>
regards,
ujulu
Antonio Petrelli-3 wrote:
>
> 2008/10/4 ujulu <ki...@misys.com>:
>>
>> Sorry, it is automatically formatted; here is it again:
>
> So it is wrong on purpose, so what exactly is this?
>
>> <html:rewrite page= " target="_blank">get PDF doc here
>
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Struts-1.2.8%3A-Submit-Button-and-HTML-Link-on-the-same-page-problem-tp19812419p19812598.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 1.2.8: Submit-Button and HTML-Link on the same page problem
Posted by Antonio Petrelli <an...@gmail.com>.
2008/10/4 ujulu <ki...@misys.com>:
>
> Sorry, it is automatically formatted; here is it again:
So it is wrong on purpose, so what exactly is this?
> <html:rewrite page= " target="_blank">get PDF doc here
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 1.2.8: Submit-Button and HTML-Link on the same page
problem
Posted by ujulu <ki...@misys.com>.
Sorry, it is automatically formatted; here is it again:
<html:form method="POST" action="/someaction.do">
<p>
<p>
<html:rewrite page= " target="_blank">get PDF doc here
</p>
<br />
<html:submit property="__action__backButton">lastPage</html:submit>
</html:form>
regards,
ujulu
ujulu wrote:
>
> Hi All,
>
> I am new to Struts, and need your help!
>
> I am experiencing the following problem:
>
> 1. I have a simple JSP page similar to the following:
> <html:form method="POST" action="/someaction.do">
> <p>
> <html:rewrite page= " target="_blank">get PDF doc here
> </p>
> <br />
> <html:submit property="__action__backButton">lastPage</html:submit>
> </html:form>
>
> 2. The corresponding struts-config.xml entry:
> <action path="/someaction"
> type="test.SomeAction"
> name="beanName"
> scope="session"
> validate="false"
> parameter="backButton">
> <forward name="success" path="/backPage.jsp"/>
> </action>
> 3. Everything works fine until the user is directed to the above JSP page.
> When the user is in this page
> and clicks on the submit button the user will be taken to the last page
> without any problem. But if
> the link is clicked first a new popup window will be opened where a PDF
> document will be generated and
> displayed to the user. Till now everything is OK! Now comes the
> problem:
> Now I close the popup window and click the submit button that is
> pointing to the page in the
> <forward> tag, the previously generated PDF document is displayed
> without even consulting the
> ActionServlet (I set breakpoints on both the doGet() and doPost()
> methods, and they are not reached)
>
> If I click on the submit button, I thought that the form will be submitted
> and the action will be intercepted by the ActionServlet and finally by the
> corresponding Action object which is supposed to forward the response to
> the "/backPage.jsp". This problem happens only if I first click on the
> link, and then on the submit button. I have even defined a <forward> in
> the <global-forwards> area as well as an <action> for the link and used
> the 'action' and 'forward' attributes of the <html:link> tag. The same
> effect.
>
> Any hint will be very appreciated!
>
> Ujulu
>
--
View this message in context: http://www.nabble.com/Struts-1.2.8%3A-Submit-Button-and-HTML-Link-on-the-same-page-problem-tp19812419p19812512.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org