Fast display of ResultSet to web browser
I am working on refactoring my companies search engine, and a critical component of the search is that the results be displayed very quickly. We have done enourmous work on making the queries fast (under 1 second), but the bottleneck always seems to be how we process the results into HTML and send them to the users web browser.
Running Tomcat, we currently use a JSP page to pass the search parameters to a Java class that queries the database and generates HTML based on the ResultSet object. The method we use to generate the HTML is very low tech, we simply generate a String that contains HTML along with the data from the ResultSet and print the String out to the users web browser via the PrintWriter object obtained from the session.
I would like to solicit ideas as to how this process can be improved. What's the absolute fastest way to get ResultSet data transformed into HTML and displayed in the users browser? I'm exploring maybe using the XML, but I haven't found much information about the speed of that technology. One caveat is that the data has to be processed before display,in the sense that if certain flags are set in a row of the ResultSet, that row data should be displayed accordingly.
We currently do something like this many times:
String html = "<table>";
if(resultSet.getInt(3) == SOME_FLAG) {
html += "<tr><td><font color='red'>resultSet.getString(6)</font></td></tr>";
html += "</table>";It would be nice if the suggestions would fit into our current Oracle/Solaris/Tomcat/JSP/Servlet architecture, but not a requirement.
Thank you very much!
P.S. Sorry if this isn't the right category for this. I labored long and hard deciding which category to post this question under, and this one seemed to be the best fit.
Check out the FormattedDataSet. It does things similar to what your code does, but is much more flexible AND monitored for performance in with JAMon. Out of the box it can create html tables, list boxes, drop downs, multi selects and html. As a developer you can generate dynamic text to appear any way you dream up.
Here is some sample code
FormattedDataSet fds=FormattedDataSet.createInstance();
// same query vary the formatting. note other types of tabular data are also accepted
String html=fds.getFormattedDataSet("select * from table", "htmlTable");
String xml=fds.getFormattedDataSet("select * from table", "xml");
String csv=fds.getFormattedDataSet("select * from table", "csv");Check out a live demo at http://www.fdsapi.com. Within the next week I hope to have a live demo that allows you to type in queries. You can already download a demo war that has this capability.
steve - http://www.fdsapi.com - the easiest way to generate dynamic content.
Similar Messages
-
Display HTML Tags on web browser
My problem is display Html code in web browser.
i try TextArea.htmlText, Label.htmlText... but they don't
work...
i'm searching in google.com and i know Html Component can do
that, but it not well because i don't have money for that.
Some body help me for my problem.
Thanks so much. !
nice day every body.The htmlText property should work however only a few basic
html tags are supported as far as I know. -
Display the reports in web browser?
I need advise.. Here is my requirements.
we are using Oracle9i database. We have data warehouse Schema. We wanted to display some of the reports in the browser. What are the possible solutions to display the reports in web browser with out using any reporting tools(cognos, business objects etc).
ThanksWell your requirement is a little bit odd, displaying data in database without using tools or application. What's form of these reports you are talking about? Are they just bunch of queries?
If you don't want to use heavy duty software like cognos or business objects, then consider use Oracle Application Express APEX
http://www.oracle.com/technology/products/database/application_express/index.html
by the way cognos and business objects are OLAP tools, does that mean your reports are OLAP report? -
Display PDF document in web browser
Hi,
I have a smartform which is being triggered from Web UI. I got the data and converted it to PDF format.
I need to display this PDF data in a web browser Pop up.
Please let me know how can I do that.
Thanks
AbhishekAbhishek,
If you are using the business transaction types, you can setup a default "print" action which then when you click on the "print preview" in the webUI you will get an PDF output view of the print output.
If that doesn't work, then look at the business partner factsheet code delivered by SAP which will show how to display a PDF.
Look at component/view BP_HEAD/BPHEADOverview
Class CL_BP_HEAD_BPHEADOVERVIEW_IMPL
method IF_BSP_WD_TOOLBARR_CALLBACK~GET_BUTTONS
and this section of code
IF lr_partner IS BOUND AND lv_enabled = abap_true.
lr_partner->get_property_as_value( EXPORTING iv_attr_name = 'BP_GUID'"#EC NOTEXT
IMPORTING ev_result = lv_partner_guid ).
IF lv_partner_guid IS NOT INITIAL.
* ICF handler class prepares java script
CALL METHOD cl_crm_afs_print=>get_url
EXPORTING
iv_object = lv_object
iv_key = lv_partner_guid
iv_role = lv_business_role
iv_language = sy-langu
iv_form = ' ' "read from customizing
iv_format = lv_format
IMPORTING
ev_url = lv_url.
IF lv_url IS INITIAL.
lv_enabled = abap_false.
ELSE.
lr_cuco_head ?= get_custom_controller( 'BP_HEAD/Lifecycle' )."#EC NOTEXT
IF lr_cuco_head IS BOUND.
* CONCATENATE '"' lv_url '"' INTO lr_cuco_head->gv_preview_url.
lr_cuco_head->gv_preview_url = lv_url.
ENDIF.
ENDIF.
ENDIF.
ls_button-text = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BP/BP_PDF' )."#EC NOTEXT
ls_button-tooltip = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BP/BP_FS_PREVIEW' )."#EC NOTEXT
* ls_button-on_click = 'PREVIEW'.
ls_button-on_client_click = 'OpenPopUp()'. "#EC NOTEXT
ls_button-page_id = me->component_id.
ls_button-enabled = lv_enabled.
ls_button-icon_src = '/sap/bc/bsp/sap/crm_ppm/w_pdf__s.gif' ."#EC NOTEXT
APPEND ls_button TO rt_buttons.
CLEAR ls_button.
ENDIF.
ENDIF.
ENDIF.
Good luck,
Stephen -
Box with rounded corners displays as rectangle in Web Browser
I am using the box control (IBoxObject) in my Crystal Reports with rounded corners. However the box displays as a rectangle with square corners when viewed in a web browser. I have tried this in IE 7.0.5730.13, Firefox 3.0.3 and Chrome 0.2.149.30 all give the same problem.
The interesting thing is that the boxes display correctly at design time and when exported to PDF, but they wonu2019t display correctly in IE/Firefox/Chrome. Here are the specific settings for the box:
CornerEllipseHieght = 375
CornerEllipseWidth = 375
Crystal Reports Version 10.5.3700.0
I have also attached an image to try and clarify the problem.
[Picture showing Box at design time, in a Web browser and when exported to PDF|http://i38.tinypic.com/10p6k1v.jpg]
Thanks in advance for any help with this issue.
-JohnThank you Ted, this was my take on the problem but it is good to have a confirmation.
There are CSS (HTML) solutions for creating boxes with rounded corners, such as [SpiffyBox|http://www.spiffybox.com/] and [CSS Rounded Box Generator|http://www.neuroticweb.com/recursos/css-rounded-box/index.php?idioma=en] and many more that can be found using [Google|http://www.google.com/search?hl=en&q=cssboxeswithroundedcorners&btnG=Google+Search&meta=].
Do you know of any plans to support rounded corners in the future?
Thanks for your help!
John -
39L4333DG - cannot display Flash content in web browser
Hello,
When I try to access Flash sites the web browser shows 'Missing plugin' in the frame where flash player should display the content.
Am I omitting anything?
I have installed the latest firmware: 7.1.90.34.01.1.
For a 2013 TV it is annoying not to have a full featured web browser on a SMART TV.
Is there any chance to have a full web browser in the next firmware version?
Thank you.When I had similar problems the response from Toshiba was that the browser is only intended for limited use. My problem was not being able to access any site which required a password. Not rocket science you would think!
-
SRM 4.0-- Blank Page displayed without Errors through Web Browser
Hi All,
Can any one help me in the following ....
We are trying to give access through the Web Browser instead of Sap GUI.
we have started all the services through SICF.
when we tried test service through WEB GUI it is showing a blank page.
It is not giving any errors on the page.
there is no problem in the URL..
Can any one help me by giving option of errors and where to check.....
Bye
SureshHi
Read this ->
<u>The entries in table TWPURLSVR should be as follows:
e.g.</u>
LOGSYS : MRDCLNT100
WEB SERVER : SAPDEV14.XEROX.COM:8001
WEB PROTCL:HTTP
WIN SERVER:SAPDEV14.XEROX.COM:8001
WIN PROTCL:HTTP
BSP SERVER:SAPDEV14.XEROX.COM:8001
BSP PROTCL:HTTP
<u>Also, refer to OSS Note 790727 describes the details for publishing all the services</u>
Refer
<b>why can I not find Service BBPGLOBAL in TA SICF?
for details.
Regards
- Atul -
Displaying text in local web browser
Hi,
Been looking at a web forwarding program that accepts a GET request from a browser and goes off and gets the page from the remote server and then needs to feed that page back to the browser. I've got as far as getting the page back from the remote site but was wondering how to post it back on the web page.
import java.io.*;
import java.net.*;
public class WebFwd{
private int fwdPort;
private ServerSocket listener = null;
private Socket socket;
private String remoteURL;
private int browserPort;
public WebFwd(int i){ //Constructor to create an instance
fwdPort = i;
listenSocket();
public void listenSocket(){
try{
listener = new ServerSocket(fwdPort);
System.out.println("Server socket up and running on port " + fwdPort);
catch (IOException e){
System.out.println("Could not listen on port "+ fwdPort + ".");
System.exit(-1);
while(true){
try{
//listener.accept returns a client connection.
socket = listener.accept();
browserPort = socket.getPort();
DataInputStream dis = new DataInputStream(socket.getInputStream());
byte [] data = new byte[1024];
dis.read(data, 0, data.length); //read in the data from the browser to the socket
String byteStr = new String(data); //convert the byte array to a string
System.out.println(byteStr.trim()); //print out the contents of the GET request trimming the whitespace
parseString(byteStr); //cut up the GET request to obtain destination
catch (IOException e){
System.out.println("Accept failed: "+ fwdPort + ".");
System.exit(-1);
* Get the remote location of web page
private void parseString(String get){
String [] getArr = get.split("/");
String [] getArr2 = getArr[1].split(" ");
remoteURL = "http://" + getArr2[0];
forwardRequest();
* Forwards request to the remote location
private void forwardRequest(){
try{
URL u = new URL(remoteURL); //create a new URL to remote location
InputStream is = u.openStream(); //open a stream on that url
//create new dis to read the data from the remote server
DataInputStream di = new DataInputStream(new BufferedInputStream(is));
String s;
//while there is stil something to read, read it
while ((s = di.readLine()) != null){
System.out.println(s); //prints contents of remote URL here
//Need to find way of redirecting it to the browser
// Send data
URL url = new URL("http://localhost:" + browserPort);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(s);
wr.flush();
catch(MalformedURLException mue){
mue.printStackTrace();
catch(IOException ioe){
ioe.printStackTrace();
public static void main (String args[]){
WebFwd wbfwd = new WebFwd(30280);
}I keep getting a connection refused exception in the while loop of forwardRequest(). There is obviously a "correct" way to do it but before I start mucking around with my firewall I thought I would check that I'm in the right ballpark.
Kind regards,
ChrisUh, when your proxy (as a web forwarding program is called) receives a GET request, it should reply with the contents of the URL requested.
So
1) read request from socket
2) obtain URL stream
3) write stream contents back to socket
Catfish? -
How to display applet in the web browser?
Hi Just want to ask help. Im making an application and i want to display applet in JSP. The problem is when i run my application there's no display in the browser. I already try to put the JSP and the Java Class with the same folder but still not working. Kindly help me with this one..
Code:
<jsp:plugin code="appletImage.class" codebase="applet" type="applet">
</jsp:plugin>
With this one i put my class in a packageI think (correct me if im wrong) that that is the old way to do it i.e. it is now deprecated and that the recommended way now is to use the object tag
Old deprecated way example
<APPLET code="Bubbles.class" width="500" height="500">
Java applet that draws animated bubbles.
</APPLET>New recommended way example
<OBJECT codetype="application/java"
classid="java:Bubbles.class"
width="500" height="500">
Java applet that draws animated bubbles.
</OBJECT> -
Displaying .ICO images in web browser
I have a need to display .ICO icon images within the browser. I'm finding that in MSIE they don't always work and in Firefox they display but they are very blurred. I'm wondering if anybody is aware of anything built into CF that might fix this problem? Possibly a flash component?
CF never ceases to amaze me, it always has a tag or component for every issue, but this one might be a problem!
Thanks
MarkACS LLC wrote:
CF never ceases to amaze me, it always has a tag or component for every issue, but this one might be a problem!
Thanks
Mark
Yeah, since CF is a server technology and "I have a need to display .ICO icon images within the browser." kind of indicates that you are dealing with a client issue.
I am fairly confidant that the <cfimage...> tag is not going to do anything with the .ico format. At least I have never heard about it doing so. It is possible that there is java code out there that could do something with the ico format that will make it work better. If so, it should be pretty easy to inovke the java from within your CFML. -
Display PDF in Web Browser Setting
Good Morning,
We recently encountered some issues with Adobe 9.0.0 on Citrix servers. We updated to Version 9.3.4, since we had not fully tested Reader X yet.
The issue is that we have an application that calls to Adobe and opens PDF files within the application. When I log on to the citrix server locally, the setting Display in PDF Browser is selected. My account is an admin of our domain. When I log in to the server with a standard account, the setting is not selected.
I found the bBrowsing Integration key in HKCU\Software\Adobe\Acrobate Reader\9.0\Originals and when I am logged in with admin account it is set to 1, when I login with the non-admin account it is set to 0.
The same key also appears in HKEY_Users\.Default\Software\Adobe\Acrobat Reader\9.0\Originals. My question is this, can I set this globally on my Citrix servers so that the Display PDF is Browser is selected. when users login to Citrix Presentation Server, launch the applications that call to Adobe, that the pdf open in a web browsers of the applications. Currently, if you hit the link the PDF file will open in its own window.
Sorry if this is a bit wordy, but I figure it is best to give too much info as opposed to not enough.
Thank You
Brian DoughertyYes the pdf is opening in adobe. But I don't want to open a new adobe browser to open.
I want to display in the current web browser where my application is running.
eg. if u are embedding pdf file like this.
<EMBED src="temp1.pdf" width ="750" height="550"></EMBED>
It won't open the new window. It displays the result in the current window.
I have my pdf content in byte array. To wirte the above code i need a file. I even writes the byte array to a temporary pdf file. But I can't able to import that file dynamically to the WSAD workspace.
Is there any other way to embed the (byte array)pdf file in the current window.
Please advice me.
Thanks in advance. -
I am setting up a web application where a person can open a PDF in their browser and sign a signature field in a PDF form. Once they sign it they can click a submit button in the PDF form and it submits the form data via HTTP (not FDF or XFDF).
They can sign it, but when the form is submitted back to the web server the signature data is not part of the form data.
Is there any way to get the signature data in the form data that the PDF is sending?
Thanks!Yes the pdf is opening in adobe. But I don't want to open a new adobe browser to open.
I want to display in the current web browser where my application is running.
eg. if u are embedding pdf file like this.
<EMBED src="temp1.pdf" width ="750" height="550"></EMBED>
It won't open the new window. It displays the result in the current window.
I have my pdf content in byte array. To wirte the above code i need a file. I even writes the byte array to a temporary pdf file. But I can't able to import that file dynamically to the WSAD workspace.
Is there any other way to embed the (byte array)pdf file in the current window.
Please advice me.
Thanks in advance. -
Hi
can anybody tell me how to display a pdf file in a current web browser where my code is running.
my pdf file is in byte array format.
i already tried <embd>
Thanks in Advance.Yes the pdf is opening in adobe. But I don't want to open a new adobe browser to open.
I want to display in the current web browser where my application is running.
eg. if u are embedding pdf file like this.
<EMBED src="temp1.pdf" width ="750" height="550"></EMBED>
It won't open the new window. It displays the result in the current window.
I have my pdf content in byte array. To wirte the above code i need a file. I even writes the byte array to a temporary pdf file. But I can't able to import that file dynamically to the WSAD workspace.
Is there any other way to embed the (byte array)pdf file in the current window.
Please advice me.
Thanks in advance. -
Solar Learning Map in web browser issue
Hi
I have assigned Learning material and end users in SOLAR02, after i created a learning map in SOLAR_LEARNING_MAP.
the problem is when is display learning map in web browser it is only showing the structure with all the units, but the documents assigned to it are not visible nor it is opening the units by the "OPEN" option in the extreme right corner of the Unit in web brwoser??
I have serached the problem and found note 775050 , but it is "Cant be implemented" state and by doing the steps manual its not resolving the problem.
Please helpHi
I have the following Issue, it is the same or it is different?
https://websmp230.sap-ag.de/sap(bD1lcyZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361…
Regards.
Juan. -
Safari updated the other day and now my emails are not being displayed properly and the web browser will only go onto google. When I click on a link from google or type in a web address the screen goes blank.
Might be a cookies and cache issue ..
From your Safari menu bar click Safari > Preferences then select the Privacy tab.
Click: Remove All Website Data
Now empty the cache.
Safari > Preferences > Advanced tab.
Select: Show Develop menu in menu bar
Now click Develop from the menu bar. From the drop down menu click Empty Caches.
Quit then relaunch Safari
Maybe you are looking for
-
I force shutdown my MacBook Pro by pressing the shutdown button for a long time and when I reopened my laptop, my files and apps are all gone. When I reopened my laptop, it said that some files have been deleted or hidden (I don't know if it said hid
-
Satellite M70-131: Is a PA3396E-1ACA AC-adapter compatible
Hi! My brand new M70-131 , model PSM70E-01500QG3 came with AC Adapter with Part Number : PA3396E-1ACA. I read on the support site, the AC Adapter should be: PA3468E-1AC3 This AC Adapter works fine and the battery gets charged ok. I just want to ask i
-
Final Cut Pro X quits working...
After I import a clip and try and play it the spinning ball comes up and I'm unable to do anything. Or if I try to create a project the spinning ball comes up. I haven't done anything different to my computer and I'm not doing anything different then
-
Firewall configuration in OSX 10.8
Dear all, In order to add custom firewall rules to my Mac, I was looking for an easy way to configure the built-in firewall. Many posts point to IceFloor, which seems to be a nice frontend. However, although I've enable SSH and it is listed as an exc
-
Can not open .wmv file attachment.
I am using an iPad 2 with OS6. I have an email message with an attached .wmv file. When double taping the file a window opens with a list of 6 different apps to be selected to open the file. Dropbox, Box, Evernote, Printer Pro, Mail, and Good Reader