473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

<jsp:include>

2
I have a xyz.jsp page has a submit button
This page is included in another jsp file by <jsp:include page="/../xyz.jsp"/> tag.
when i click that button the whole main page get submit where i only want to submit only the xyz.jsp page only.So how to achieve this thing?
Sep 7 '09 #1
5 5310
sumittyagi
202 Expert 100+
You can achieve this by using ajax.
Sep 8 '09 #2
lalia
2
Hi Sumit Tyagi
I have heard that using ajax this problem can be solved.But i don't want to use ajax.So how can it be possible?Have you any idea?


Thanks
Sep 8 '09 #3
r035198x
13,262 8TB
@lalia
Why?


@lalia
Use Ajax.
Sep 9 '09 #4
sumittyagi
202 Expert 100+
You must understand two things for developing web applications:-
1. Client side programming (scripting).
2. Server side programming.

When client submits the request then(and only then) server gets the control.
Now you want to control how client submits the request, so that needs client side scripting (server can't help you in this as he is sitting miles away from your computer).

Now what is AJAX!
AJAX is an architecture, that combines client side technologies and teaches you to control client side programming in a well organized manner.

There are many frameworks that do the ajax part for you, and you don't need to worry much about AJAX in that. (But even in that case you must have an understanding of AJAX).

If you have more queries about AJAX, then go to javascript forum and put your question, and you will get advice from Javascript and AJAX specialists.

~Cheers~
Sumit
Sep 9 '09 #5
Frinavale
9,735 Expert Mod 8TB
While Ajax is a great suggestion, I can understand why you would want to avoid Ajax at this time. I don't think that the experts here know how much time it takes to learn a whole new concept/language...I mean, they already know how to use it so it seems quite simple to them. You should take the time to learn Ajax though, it's very cool stuff that is easy to use once you understand it... but to understand it you have to have a firm understanding of JavaScript and client-server interactions which takes a while to learn.

So instead I'm going to recommend that you try using an iframe.

In this recommendation you don't actually use the <jsp:include> to include the xyz.jsp page into your page.

An iframe lets you show more than one page on the same page.

The iframe is another "window" within the page so make sure that you understand how these work before attempting to use it....

It will let you have the xyz.jsp page on the same page as your main.jsp page, however anything within the iframe will only submit to the xyz.jsp page.

Your main page would look something like:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head id="Head1" runat="server">
  4.     <title>Some page</title>    
  5. </head>
  6. <body>
  7.   <form id="mainForm"action="MainPage.jsp" method="post" name="mainForm">
  8.     <!-- .... Main Page Content ...  -->
  9.      <iframe id="xyziframe src="xyz.jsp"></iframe>
  10.     <!-- ... More Main Page Content ... -->
  11.   </form>
  12. </body>
  13.  

Or, you could have 2 <form>s on the same page but you have to be careful that they are not inside one another.

Using my second idea involves your main page looking like:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head id="Head1" runat="server">
  4.     <title>Some page</title>    
  5. </head>
  6. <body>
  7.   <form id="mainForm"action="MainPage.jsp" method="post" name="mainForm">
  8.     <!-- .... Main Page Content ...  -->
  9.   </form>
  10.   <form id="xyzForm"action="xyz.jsp" method="post" name="xyzForm">
  11.     <!-- .... XYZ Page Content ... -->
  12.   </form>
  13. </body>
  14.  

This would mean that your xyz.jsp page would only print out <form>...content...</form> and wouldn't be a full page (by full page I mean includes the <html></html> tag)

Hope this helps

-Frinny
Sep 21 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jonathan Taub | last post by:
This may seem a stupid question. I've got a <textarea> element: .... <td> List of items: <textarea> 1. Apple 2. Orange 3. Box
5
by: David Thielen | last post by:
Hi; Almost all of the Quick Starts show the code in the .aspx file inside a <script> instead of in a seperate .aspx.cs file. My instinct is that the code should be in a seperate file to keep the...
0
ak1dnar
by: ak1dnar | last post by:
There is a Error getting while i am entering records using this jsp file. <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> <%@ include...
2
by: gaya3 | last post by:
Hi All, is it possible to include jsp page in jspx file? I'm having as follows... in jspx file JSPX file: <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.