473,412 Members | 2,304 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,412 software developers and data experts.

HttpServletResponse in a div of a webpage

Hello everyone!
I have a webpage with a form with two text boxes and the action of the form
it's a servlet. I know how to get the HttpServletResponse response from a servlet like this:

Expand|Select|Wrap|Line Numbers
  1. ....
  2. PrintWriter out = response.getWriter();
  3.                 try 
  4.                 {            
  5.                     out.println("<html>");
  6.                     out.println("<head>");
  7.                     ...
  8.                     out.println("</head>");
  9.                     out.println("<body>");
  10.                     ...
  11.                     out.println("</body>");
  12.                     out.println("</html>"); 
  13.                 }
  14.  
My question is if I want this take the results not in a web page but in the current one i have the form, let's say in a <div id="here"></div>, how can i do that? I am looking for this for 4 hours and more and can't find anything..
I tried the XMLHttpRequest but in the open("GET",url,true), it needs a url (the servlet) but I want to use the form post way i write above.
Any ideas?
Thanks in advance!
Oct 3 '08 #1
2 2011
pronerd
392 Expert 256MB
I want this take the results not in a web page but in the current one i have the form, let's say in a <div id="here"></div>, how can i do that?
Can you re-word your question? I have no idea what is being asked. Information from DIV tags can not be passed back to the server in an HTTPRequest. On information if forms can be.
Oct 3 '08 #2
pronerd thanks a lot for the reply! You are right about my question.

I don't want to print "<html>" and "<head>" and the others.. because that will lead to create a new webpage as the response, right?
I just want to print for example a table "<table>" ..... "</table" into a certain <div> section in my webpage. (The same webpage that I use to request the servlet). I hope you understand what I mean..

Thanks again!
Oct 3 '08 #3

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

Similar topics

4
by: Eric West | last post by:
Greetings- I have a web application that has a form that triggers a server process that I would like to provide a "Searching..." page for. My strategy was to send the browser the "top half" of...
0
by: Naresh Agarwal | last post by:
Hi I want HTTPServletResponse to *close* the socket after sending the response. For this I'm closing the OutputStream after writing the data. But still socket is not closed and client keeps on...
1
by: Java script Dude | last post by:
I am investigating a solution to build all pages sent from my application servlet in UTF-8 encoding. From what I understand, I should be using HttpServletResponse.setCharacterEncoding("UTF-8"). The...
12
by: David Walker | last post by:
Hi I have a program which I need to interface with a webpage - the webpage will accept an input (probably a 'post' string from the program) and then will process it and needs to return a value. ...
22
by: Ruslan Kogan | last post by:
Hi, I have a webpage with a table that has 4 cells (2x2). In one of those cells, I wish to load a webpage stored on a different server (say...www.webpage.com/abc.htm). Does HTML allow for this...
1
by: teknowbabble | last post by:
I would like to know how to convert HTML code that users input into a TEXTAREA box on a HTML FORM into a separate WEBPAGE. I have something like the diagram below on my webpage. The user is...
5
by: sifar | last post by:
Hi, This is my first post to this Group. A] I am trying to create a escalation page which will mail an escalation report of a faulty product. Items needed on Page: -----------------------
3
by: Ole Hanson | last post by:
Hi I am trying to pass a credentials object to a webpage programmatically. I have a winApp (C#) that I want to be able to open a webpage (by starting IE), but the credentials required by IIS...
14
by: jim | last post by:
OK...Don't ask why - it'll just make ya mad. It makes me mad just thinking about it. I swear....if I didn't need this job, I'd tell 'em where to embed their webbrowser control. But, since I do...
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: 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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.