Please help me... Its urgent
Hi guys
I am writing a program which will download the HTML source code of pages. Before downloading, I am checking whether that URL exists or not. But my program seems to hang when I use the function getPage of WebGrabber many times.
My code is as follows :
urlExists.java
import java.net.*;
import java.io.*;
import java.util.*;
public class urlExists
urlExists()
public int exists(String urlname) throws IOException
URL url=null;
try
url=new URL(urlname);
catch(Exception e)
HttpURLConnection connexion = (HttpURLConnection)(url.openConnection());
if(connexion.getResponseCode()==HttpURLConnection.HTTP_NOT_FOUND)
connexion.disconnect();
return(0);
else
connexion.disconnect();
return(1);
WebGrabber.java
import java.net.*;
import javax.net.*;
import java.io.*;
import java.util.Date;
public class WebGrabber
private String content;
private URL url;
private Date lastModified;
private InputStream input;
private int c=0;
private urlExists urlE;
WebGrabber()
This method expects the user to give the url to it and
returns the contents of the page in the String format.
public String getPage(String urlWanted)
StringBuffer buf = new StringBuffer();
InputStreamReader in;
BufferedReader data;
String line;
content = "URL";
int status = 1;
url = null;
try
url = new URL("http://" + urlWanted);
catch (Exception e) {}
try
urlE = new urlExists();
status = urlE.exists("http://" + urlWanted);
System.out.println("status : " + status);
catch (IOException e)
content = "";
try
if (!content.equals("") && status==1)
content = "";
HttpURLConnection u = (HttpURLConnection)(url.openConnection());
u.connect();
// if(u.getResponseCode()==HttpURLConnection.HTTP_NOT_FOUND)
// content = "";
// else
in = new InputStreamReader(u.getInputStream());
data = new BufferedReader(in);
while ((line = data.readLine()) != null)
System.out.println(line);
content += line + "\n";
// buf.append(line + "\n");
// content = buf.toString();
data.close();
in.close();
u.disconnect();
else content = "";
catch (Exception e)
System.out.println("HEREEEE : " + e);
return content;
return content;
public static void main(String[] args)
WebGrabber w = new WebGrabber();
String u;
String cont;
u = "www.google.co.in";
cont = w.getPage(u);
System.out.println("CONTENT : " + cont);
u = "www.yahoo.com";
cont = w.getPage(u);
System.out.println("CONTENT : " + cont);
u = "www.google.com";
cont = w.getPage(u);
System.out.println("CONTENT : " + cont);
u = "www.google.co.in";
cont = w.getPage(u);
System.out.println("CONTENT : " + cont);
u = "www.yahoo.com";
cont = w.getPage(u);
System.out.println("CONTENT : " + cont);
u = "www.google.co.in/options/index.html";
cont = w.getPage(u);
System.out.println("CONTENT : " + cont);
}I have tried a lot to debug including closing the InputStream and BufferedReader. Could you guys please help me out. I need to do this very soon ...
Regards
kbhatia
There was a recent posting which suggested two things
to say if you want to be ignored are put "please help
me" or "urgent" in you subject. You put both. :)
It is likely that you program is throwing an
exception as an error, but you are ignoring all
errors so you have know way of knowing what the
problem is.
Try printing out your exceptions, they may tell you
what the error is e.g.
e.printStackTrace();Hi
I am getting the following exception :
status : 1
HEREEEE : java.net.SocketException: Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
at sun.net.www.http.ChunkedInputStream.fastRead(ChunkedInputStream.java
221)
at sun.net.www.http.ChunkedInputStream.read(ChunkedInputStream.java:662
at java.io.FilterInputStream.read(FilterInputStream.java:111)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:406)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:446)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:180)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at WebGrabber.getPage(WebGrabber.java:111)
at WebGrabber.main(WebGrabber.java:161)
What doessun.net.www.http.ChunkedInputStream.read mean? Also for the SocketException : Connection reset, what solution could you suggest?
Regards
kbhatia
Similar Messages
-
Hi: please help me its urgent
hi all,
i am getting the values of netwr and amount in the outout.
but unable to find the values of matnr, arktx.i am sending the code please suggest.
loop at it_vbrp.
LOOP AT it_konv WHERE kposn = it_vbrp-posnr and
kschl = 'ZP01' OR
kschl = 'ZP02' OR
kschl = 'ZP03' OR
kschl = 'ZP05' OR
kschl = 'ZP06' OR
kschl = 'ZP51'.
it_item-netwr = it_konv-kwert.
it_item-amount = it_konv-kwert * it_vbrp-fkimg.
append it_item.
endloop.
endloop.
LOOP AT it_vbrp.
*is = sy-tabix.
it_item-matnr = it_vbrp-matnr.
it_item-arktx = it_vbrp-arktx.
it_item-fkimg = it_vbrp-fkimg.
it_item-meins = it_vbrp-meins.
MODIFY it_item TRANSPORTING matnr arktx fkimg meins WHERE
matnr = it_vbrp-matnr.
ENDLOOP.
regards
akmalHi akmal ,
Your this part code is wrong .How can you modify it_item when you have looped it_item table.Follow the bold part of the code.So you don't have to start the it_vbrp loop again.
Loop at it_vbrp.
it_item-matnr = it_vbrp-matnr.
it_item-arktx = it_vbrp-arktx.
it_item-fkimg = it_vbrp-fkimg.
it_item-meins = it_vbrp-meins.
MODIFY it_item TRANSPORTING matnr arktx fkimg meins WHERE
matnr = it_vbrp-matnr.
loop at it_vbrp.
LOOP AT it_konv WHERE kposn = it_vbrp-posnr and
kschl = 'ZP01' OR
kschl = 'ZP02' OR
kschl = 'ZP03' OR
kschl = 'ZP05' OR
kschl = 'ZP06' OR
kschl = 'ZP51'.
it_item-netwr = it_konv-kwert.
it_item-amount = it_konv-kwert * it_vbrp-fkimg.
<b>it_item-matnr = it_vbrp-matnr.
it_item-arktx = it_vbrp-arktx.
it_item-fkimg = it_vbrp-fkimg.
it_item-meins = it_vbrp-meins.</b>
append it_item.
endloop.
endloop.
Please reward if useful. -
Please help me its urgent - restrict field update against a condition
Dear Friends,
I'm new to the oracle forms .. i want to restrict a filed update against a condition in my form.
I am using multi record block. I want to disable few fields in a row e.g. there are 10 records in the record block i want to disable three items of 2nd record on the basis of some condition. How can i do it??HI,
you can use the form-built in procedure SET_ITEM_INSTANCE_PROPERTY and the appropriate property....(UPDATE_ALLOWED = PROPERTY_FALSE).
For example:
begin
if <your_condition>
then
set_item_instance_property('<your_item1>',<record_number/CURRENT_RECORD>,UPDATE_ALLOWED ,PROPERTY_FALSE);
set_item_instance_property('<your_item2>',<record_number/CURRENT_RECORD>,UPDATE_ALLOWED ,PROPERTY_FALSE);
else
set_item_instance_property('<your_item1>',<record_number/CURRENT_RECORD>,UPDATE_ALLOWED ,PROPERTY_TRUE);
set_item_instance_property('<your_item2>',<record_number/CURRENT_RECORD>,UPDATE_ALLOWED ,PROPERTY_TRUE);
end if;
end;
For more info , take a look at the on-line help....
Greetings,
Sim -
hi experts'
i have to generate asset utilization report in webdynpro
inputs for report are some rfcs
i get result from rfcs
i need to float report i used bussinessgraphic object
its not interactive
if i go for tables
how to create tables with drill down inside table
how to set color for each cell of table depending on condition
please help me
its urgent
and send me code n linkHi Vani,
Your requirement has many things
1. How to call RFCs
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#15 [original link is broken]
2. Once you have data, how to work with BusinessGraphics ?
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ba2db0e5-0601-0010-9790-e271902f2c38
(This docs contatins all the required info on webDynpro UIElements)
3.Tables
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#46 [original link is broken]
Regards,Anilkumar -
Is it possible to export contacts from Outlook 2011 for Mac and importing this file back into Mac Address Book.? please reply me its urgent
Is it possible to export contacts from Outlook 2011 for Mac and importing this file back into Mac Address Book.? please reply me its urgent
-
problem with connecting ipad 2 with crestron cp2e...help plss its urgent...
I hv a ipad 2 with mobile pro g connected with cp2e. when i pressed any button in ipad its connet with cp2e but after 4-5 sec one error comes (warning wifi was powered off while the device was in auto -lock(sleep)press connect to reconnect) when i pressed again its connected with cp2e. i am using netgear wireless access point . i also has been changed access point as well as updated ipad firmware bt problem is as it is .. pls help.Hi have you solved the issue ?
Cause I have the same problem.
Tnx -
last night i have used my ipod and in morning i found it dead please help me its not responding at all i have tried evry thing
Charge the battery.
If necessary, restore the iPod > iTunes: Backing up, updating, and restoring your iPhone, iPad, or iPod touch software -
i want to delete my data from iphone while i doesnot have the access but i know my apple id so plz help me its urgent, i want to delete my data from iphone while i doesnot have the access but i know my apple id so plz help me its urgent
Welcome to the Apple Community.
You can only wipe your device when it is logged into iCloud and 'Find My Phone' is enabled, additionally the device will need to be switched on and connected to a wifi or cellular network.
Unfortunately, you cannot activate iCloud or 'Find My Phone' remotely. -
Plz help me its urgent i have iphone i dnt want my deleted texts my phone was jailbroken if i do restore widout backup should i jailbreak again ,should i unlock again,will the data of texts premantly erased plz answr me
Jailbroken phones cannot be discussed in an Apple forum. If you synced your phone with your computer the texts will be in the backup, so if you restore the backup you may get them back, but with a jailbroken phone it's anybody's guess what will happen.
-
I have downloaded iOS 6 to my iTunes but I have clicked "Download Only" not "Download and Update" how do i install/sync it to my iPad. Please help me, its taken me hours to download it i don't want to do it again
PLEASE HELP ME!!!Hook your iPad into your computer and open iTunes. GIve it a couple of minutes to get going, then click on the name of your device, then the main summary page. In the middle you'll see a software update button/area. Click on check on updates and update and follow the prompts.
it SHOULDN"T redownload but if you've already got it should just install.
I'd suggest that you first do a complete sync before you update, that way you have a good backup to restore your device from if the upgrade doesn't go perfect. -
i can't download the apple ios 5 for the ipad. after downloading around 10 % an error no. 3259 occurs. it's a network error. please help . it's urgent. i am having apple ipad 2 3G wifi.
i switched off all the security settings and all the firewalls.
i m unable to install any of the app on the ipad
so i saw the apple support and it said to update the older version of my ipad.
and niether am i able to download the update nor am i able to download any app and install it in my ipad2
i also tried to download an .ipsw file (ios5 update) from torrentz bt i am also unable to install from that as itunes rjects that file and gives an error. and also tries to delete that file. plz anyone help urgently. -
hi all,
i have a problem in my bsp page.
in my bsp page, there is a button which is clicked, a new pop up window will appear. after the pop up window closed the caller window will be submitted.
after submitted, the server side script ( ABAP Code in event OnInputProcessing & OnInitiallization will be run ).
in order to be able to do this, i used java script. and it's already works well.
the problem is : there is 1 record that the ABAP code in event OnInputProcessing is not run. I have set break points on one of code in event OnInputProcessing, but it seems event OnInputProcessing is not triggered. if i also put the break point in event OnInitialization, it will stop in the break point in event OnInitialization.
is there any clue why this happened ?
please help, it's urgent because it's happened in my production system
many thanks in advance
regards
eddhiehi Raja,
thanks for the respond.
the code is already works for 2 years and just 1 record of ... perhaps thousands record that used the same code.
for other record, it go to event OnInputProcessing
but just this 1 record it won't go to event OnInputProcessing.
any clue ?
please help
regards -
Hello All,
Please refer to the below code:
package com.sap.NewOrderAssignment;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.GregorianCalendar;
import com.sapportals.htmlb.*;
import com.sapportals.htmlb.enum.TableColumnType;
import com.sapportals.htmlb.table.DefaultTableViewModel;
import com.sapportals.htmlb.table.TableColumn;
public class BeanOrderDetails implements Serializable
{ public Date toDay, orderDate;
public String toDayAsString;
public IListModel deliveryAddress;
public TextEdit address;
public DefaultTableViewModel orderLines;
public Locale locale;
public String poNumber, model, qty;
public Object colTitle[] = {"Model","Description","Qty (pcs)","AD Price","Net Price","Total amount","Indication ETA","12 NC","Part Del","GIM","# A-box","Pcd/A-box"};
public BeanOrderDetails()
{ Calendar cal = new GregorianCalendar();
toDay = cal.getTime();
String year = String.valueOf(cal.get(Calendar.YEAR));
String month = String.valueOf(cal.get(Calendar.MONTH)+1);
String day = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
toDayAsString = year"-"month"-"day;
deliveryAddress = new DefaultListModel();
deliveryAddress.setSingleSelection(true);
deliveryAddress.addItem("1", "Delivery Address1");
deliveryAddress.addItem("2", "Delivery Address2");
deliveryAddress.addItem("3", "Delivery Address3");
//company address
address = new TextEdit("Company Address");
address.setRows(4);
address.setCols(40);
String line1 = "KPIT Cummins Infosystems Ltd.";
String line2 = "MIDC, Hinjewadi";
String line3 = "Pune, India";
address.setText(line1line2line3);
address.setEnabled(true);
//Table creation
Object data[][] = {{"HQ8894","Sensotec Dry Rota Shaver","500","1,512.00","1,498.00","749.00","08-08-2005","885889401710","N","Y","","50"}};
orderLines = new DefaultTableViewModel(data, colTitle);
TableColumn columnModel = orderLines.getColumnAt(1);
TableColumn columnDesciption = orderLines.getColumnAt(2);
TableColumn columnQty = orderLines.getColumnAt(3);
TableColumn columnADPrice = orderLines.getColumnAt(4);
TableColumn columnNetPrice = orderLines.getColumnAt(5);
TableColumn columnTotalAmunt = orderLines.getColumnAt(6);
TableColumn columnETA = orderLines.getColumnAt(7);
TableColumn column12NC = orderLines.getColumnAt(8);
TableColumn columnPartDel = orderLines.getColumnAt(9);
TableColumn columnGIM = orderLines.getColumnAt(10);
TableColumn columnABox = orderLines.getColumnAt(11);
TableColumn columnAmountInBox = orderLines.getColumnAt(11);
TableColumn columnPcsBox = orderLines.getColumnAt(12);
columnModel.setType(TableColumnType.INPUT);
columnModel.setWidth("150");
columnQty.setType(TableColumnType.INPUT);
columnDesciption.setWidth("300");
public void setLocale(Locale l)
{ locale = l;
public Locale getLocale()
{ return locale;
public void setOrderDate(Date od)
{ orderDate = od;
public Date getOrderDate()
{ return orderDate;
public void setOrderLines(DefaultTableViewModel mm)
{ orderLines = mm;
public DefaultTableViewModel getOrderLines()
{ return orderLines;
public void setAddress(String adr)
{ address.setText(adr);
public void setTextEditAddress(TextEdit adr)
{ address = adr;
public TextEdit getTextEditAddress()
{ return address;
public String getAddress()
{ return address.getText();
public void setDeliveryAdresses(IListModel model)
{ deliveryAddress = model;
public IListModel getdeliveryAddresses()
{ return deliveryAddress;
public void setPoNumber(String pon)
{ this.poNumber = pon;
public String getPoNumber()
{ return this.poNumber;
public void setModel(String m)
{ this.model = m;
public void setQty(String quantity)
{ this.qty = quantity;
public void getNewRow()
{ Object data[][] = { {"","Sensotec Dry Rota Shaver ABC","","1,512.00","1,498.00","749.00","08-08-2005","885889401710","N","Y","","50"}};
this.setQty("");
this.setModel("");
TableColumn columnModel = orderLines.getColumnAt(1);
TableColumn columnDesciption = orderLines.getColumnAt(2);
TableColumn columnQty = orderLines.getColumnAt(3);
TableColumn columnADPrice = orderLines.getColumnAt(4);
TableColumn columnNetPrice = orderLines.getColumnAt(5);
TableColumn columnTotalAmunt = orderLines.getColumnAt(6);
TableColumn columnETA = orderLines.getColumnAt(7);
TableColumn column12NC = orderLines.getColumnAt(8);
TableColumn columnPartDel = orderLines.getColumnAt(9);
TableColumn columnGIM = orderLines.getColumnAt(10);
TableColumn columnABox = orderLines.getColumnAt(11);
TableColumn columnAmountInBox = orderLines.getColumnAt(11);
TableColumn columnPcsBox = orderLines.getColumnAt(12);
columnModel.setType(TableColumnType.INPUT);
columnModel.setWidth("150");
columnQty.setType(TableColumnType.INPUT);
columnDesciption.setWidth("300");
The above code creates a table. It actually maps the various fields as the TableColumn.
<b><u>Question:</u></b>
I have added a button which appears below this table.
Name of button = AddNewLine
Now, when this button is clicked, a new empy row should appear in the table.
<i><b>My stmts in method - getNewRow() are not working.</b></i>
Please help me do so.
Please help...its kinda urgent.
Thanks and Warm Regards,
Ritu R HunjanHi Ritu,
First up all I don't see any code where exactly you have added a button in the table.
Secondly as a general thing,looking on to ur scenario you have initialize the table on the event of clicking the button ie)in ur getNewRow() just initialize your code for building an empty row of the table.
Regards,
guru -
How to get rid of Apple Support Community notices? my box is full as I receive thousand of messages a day. I cannot handle it anymore, please it is urgent. Help! I have Mac OS X 10.7.5 and unable to find the "notification tab" in my "preferences" I need a image if possible to better understand. Thanks a lot.
Thank you, but I just tried everything you said, my apple id account (icloud) continues and still is receiving the email from ASC each second. My i phone and macpro (i cloud account) is full of messages that I have difficult to erase at once. I have to do it one by one which can take me the whole day. How can i unsucribe from ASC, just get ride of my account, I mean cancel the ASC account, so I will not get any messages. Please help. Thanks.
-
Please help, this is urgent
Hi
I have created a grid using JSP and HTML which has three columns and multiple rows. The cells are actually the text boxes and their names are EmpNo, Value1, and value2.
And every row's column's control name is same.
They display like this
EmpNo Value1 Value2
EmpNo Value1 Value2
EmpNo Value1 Value2
EmpNo Value1 Value2
EmpNo Value1 Value2
EmpNo Value1 Value2
Can anybody guide me how can I access a value from a specific row and specific control. I am having problem because each column control name is same.
I know its possible in ASP using count method, because in ASP when you create a control with a same name, the ASP generates an array and it keeps the array name as control name, so that you can access the value through its subscript number. I was trying to do the same thing in JSP but couldn't do that.
Please help me, I will really appreciate that.
ThanksCan anybody guide me how can I access a value from a
specific row and specific control. I am having
problem because each column control name is same.
I know its possible in ASP using count method,
because in ASP when you create a control with a same
name, the ASP generates an array and it keeps the
array name as control name, so that you can access
the value through its subscript number. I was trying
to do the same thing in JSP but couldn't do that.HTML creates the array, so it works the same in JSP. Need to see your code to suggest why this might not be working for you. -
My swf file doesn't sees flv format video, what can i do? Please help, it's urgent
I made an video animation presentation in Flash CS6. I have a video part into this animation (flv format), but when i export the animation in swf, the video doesn't appear (i see only white screen. On my computer i can see it good, but from another computers it appears white screen.). I need to export the animation in video format, but i can't. Please help me, it's urgent for a project. Thank you!
you can export the fla as a .mov. file>export> export video. from here you can elect to open in Adobe Media Encoder and then choose your file extension type you want.
if you cannot see the animation in the .swf my guess everything your doing is on a local computer and not on a site/server somewhere.
Maybe you are looking for
-
I had to install a new hard drive on my computer, when I downloaded Itunes, all my music was gone. How do i get my music back? I do not have an Icloud.
-
What do I have to do if almost all my apps crashes?
I have an iPod Touch 4G, 32GB and iOS 5 installed. I have 118 apps installed right now on my iPod and got 9 GB free memory space. Almost every application crashes when starting or open. My little brother has the same device, but the same apps aren't
-
Error code 13019 after upgrade
Updated to 3 on my 3G and phone no longer had ipod tunes available. Put it in to resync and it took forever to back up, then, eventually it crapped out with an error code 13019. Checked these posts and tried the suggestion of unchecking all syncs; sy
-
Exception when trying to manipulate Data in an ADAM server
Hi all, I'm having problems with trying to manipulate data in the ADAM instance on my machine. Currently I can bind to the ADAM instance (took me a while to figure out that ADAM isn't like other normal LDAP servers... you need to bind as a user which
-
Recently my very old PowerBook G4 died, and before I replaced it with a new iMac the store offered to have my hard drive ghosted onto an external hard drive so I wouldn't lose my data and have to reinstall all my programs, which I accepted. The old l