0

I have a jsp form

<form action="../sup/Processor.jsp" method="POST" name="ProjectKey" id="Proje">

I want to send this from in to another jsp page. How can i do that

Petar Minchev
  • 46,889
  • 11
  • 103
  • 119
Alex
  • 27
  • 1
  • 6
  • You want to send to `sup/Processor.jsp` ? – Jacob Sep 04 '12 at 06:34
  • I send to sup/Processor.jsp qustion is how i send it to another page like sup/Name.jsp – Alex Sep 04 '12 at 06:36
  • @MaVRoSCy Because it contain same information it's useless to put same page twice. – Alex Sep 04 '12 at 06:38
  • 3
    i think you should reconsider your design – MaVRoSCy Sep 04 '12 at 06:45
  • 1
    You cannot make this with submiting form, because each HTTP request generates one HTTP response. How browser can determine which one of two responses you want use to display data? If you simple need to make two or more requests then you can use AJAX or use one request with additional processing on server. – Andrew D. Sep 04 '12 at 06:50
  • @user1619188 - You can forward data from one page page (chain of requests) via `` action. – KV Prajapati Sep 04 '12 at 07:40
  • I think he is just trying to run his code. – jddsantaella Sep 04 '12 at 08:18

1 Answers1

0

What I understand from your question is you want to re-use the <form> snippet in your other JSPs.

Please correct me if this is not what you want, I would suggest providing more information in your question about what you exactly want to do and why. Thanks

So you can have your form in a JSP, say my_form.jsp and then reuse the my_form.jsp by using any of the following:

  1. Using the include directive i.e. static include

    <%@ include file="my_form.jsp" %>
    
  2. Using the jsp:include standard action, this will include the form in my_form.jsp in any page at run-time.

    <jsp:include page="my_form.jsp" />
    

In addition here are some more links which can help you understand this better:

  1. include directive and <jsp:include>
  2. Difference between include directive and standard action

I would suggest you go through some good tutorial regarding the concepts of and using and . Our tags on stackoverflow have good information regarding what to read and how to dive deep in the topic.

Hope this helps.

Community
  • 1
  • 1
Prakash K
  • 11,669
  • 6
  • 51
  • 109