Source code of a web browser
Does any one knows how to get a example source code of a web browser?
Or the source code of the HotJava browser???
Hello,
If you seeing a sample code. Please refer to java.sun.com's Java Tutorial
Topic :: How to use JEditorPane.
These Java Packages can help you.
Javax.swing for JEditorPane
javax.swing.text for Document class
Javax.swing.event for HTML Listener(to open hyperlink and pictures)
For a Complete Solution please go to any S/W Company and make your own browser.
Similar Messages
-
How can I get HTML source code of dynamic Web page ?
Hi,
I would like to write a program that can get HTML source code of some Web pages, but there are some dynamic Web pages that I can't do it with URL class. For example: http://www.europlex.ch/web/3schedule/showAll.jsp?context=schedule.
Thank you very much for any solution.Thank you for your attention. I'm sorry because I could't describe it clearly. If you don't mind, please follow this step to understand my problem:
In the browser, enter URL: http://www.europlex.ch/web/main.jsp?locale=_english
Click on Schedule, you will see the page with Cinema name, Film, Time... I would like to write Java Program to get HTML code of only this Page (Not frame page).
Do you have any idea ?
Thanhks, -
How to get the HTML Source code from the active browser ?
Hi All,
I need to get the HTML Source code from the active browser (IE). I tried with the below code, but I am not able to get the Source code all the time, with respect to the different applications (http or https) and the user authentication has to be changes in few applications (_I dont know or not able to given that in the below code_). More over there is also a dependence of the URL to get the HTML Source code.
Therefore what I feel is getting the HTML Source code from the given or active browser will be consistent than the URL. Since the Source code is available in the browser (IE) . Please help me with a sample code to achieve this . . . !
HTMLDocument doc=(HTMLDocument) kit.createDefaultDocument();
doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
URL url = new URL(strURL);
Reader HTMLReader = new InputStreamReader(url.openConnection().getInputStream());
kit.read(HTMLReader, doc, 0);Thanks in advance,
Regards,
Jothi Venkatachalam
Edited by: j0o on May 7, 2009 3:11 AMThe simple answer is: you don't.
Not only is it simply not possible, but the entire concept of "the active browser" doesn't exist.
You were on the right track with your code to retrieve the page directly from the server, but as you noticed that code will only work for regular http connections.
For https and other protocols you will need to use appropriate libraries for each protocol. Something like Apache Commons can help you with that. There are networking libraries in there for a lot of commonly used protocols. -
Retrieving HTML source code of a web page
Hi,
I want to take the HTML source code of a web page. How can I take?
Thanks and regards,
Venkat.You can do that with the class "cl_http_client".
Sample code:
DATA: http_client TYPE REF TO if_http_client .
DATA: w_string TYPE string ,
w_result TYPE string ,
r_str TYPE string .
DATA: result_tab TYPE TABLE OF string.
START-OF-SELECTION .
CLEAR w_string .
w_string = 'http://urlhost/Logs/main.asmx/SetLog'.
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = w_string
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = '~request_method'
VALUE = 'POST'.
CALL METHOD http_client->REQUEST->SET_FORM_FIELD
EXPORTING
NAME = 'title'
VALUE = 'Mail sistema'.
CALL METHOD http_client->REQUEST->SET_FORM_FIELD
EXPORTING
NAME = 'details'
VALUE = 'Funcion 1234'.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR w_result .
w_result = http_client->response->get_cdata( ).
REFRESH result_tab .
SPLIT w_result AT cl_abap_char_utilities=>cr_lf INTO TABLE
result_tab .
READ TABLE result_tab INTO r_str INDEX 2. -
Read Source code of a Web Page
Hi,
Could anyone suggest an ABAP Function module which when given a web page URL as input downloads the source code of the web page into an internal table. Thanks.
Regards,
Prabaharan.Hi,
Chek this link:
Extracting data from a HTML / XML web page
Hope it helps you.
Pleae reward helpful answers.
Best Regards,
Anjali -
Html code(source code) for a web page
hi all
i want to get the source code for a web page throgh
my java program .please can you tell me how to do it.
thanksgive this a try.
import java.awt.*;
import javax.swing.*;
import java.net.*;
import java.io.*;
public class JApplet1 extends JApplet
public void init()
getContentPane().setLayout(null);
setSize(470,391);
JButton1.setText("google.com");
getContentPane().add(JButton1);
JButton1.setBounds(12,12,120,24);
getContentPane().add(JScrollPane1);
JScrollPane1.setBounds(12,48,444,336);
JScrollPane1.getViewport().add(JTextArea1);
JTextArea1.setBounds(0,0,440,332);
SymMouse aSymMouse = new SymMouse();
JButton1.addMouseListener(aSymMouse);
javax.swing.JButton JButton1 = new javax.swing.JButton();
javax.swing.JScrollPane JScrollPane1 = new javax.swing.JScrollPane();
javax.swing.JTextArea JTextArea1 = new javax.swing.JTextArea();
class SymMouse extends java.awt.event.MouseAdapter
public void mouseClicked(java.awt.event.MouseEvent event)
Object object = event.getSource();
if (object == JButton1)
JButton1_mouseClicked(event);
URL u;
URLConnection conn;
InputStreamReader in;
BufferedReader data;
String line;
StringBuffer buf = new StringBuffer();
void JButton1_mouseClicked(java.awt.event.MouseEvent event)
try{
u = new URL("http://www.google.com");
conn = u.openConnection();
in = new InputStreamReader(conn.getInputStream());
data = new BufferedReader(in);
while((line = data.readLine()) != null)
buf.append(line + "\n");
JTextArea1.setText(buf.toString());
}catch(Exception e){}
} -
Retrieving The source code of a web.
Hi,
Sorry if this is not the place fro this post but I didn�t know where to put it.
I need to connect to a web page and get the page source code to retrieve the text it has to preprocess it and insert in my BD. Is there any way to do this in java?.
Thanks in advance,
HexDump.Sure.
http://java.sun.com/docs/books/tutorial/networking/urls/readingURL.html -
Which t-codes will start web-browser in SCM7.0?
I am new to SCM7.0 but I have experience at PI7.1/PI7.0.
On PI7.0 there are some t-codes such as sxmb_ifr, sldcheck, etc which will start a web-browser.
Could you list the SCM tcode that will launch web-browser as well?
Thank you!Hi Christy Kelly,
Some of the following t-codes uses web-browser
/N/SAPAPO/CLPISDP
/SAPAPO/CLPIPCAL
/SCA/ICH - SNC
/SCA/ICH_S - SNC - Supplier View
/SCA/ICH_C - SNC - Customer View
/SCA/ICH_G - SNC - Goods Recipient View
/SCA/ICH_RR_NA - Responsive Replenishment
/SCA/ICH_RET - Returns Processing - Customer View
/SCA/ICH_RETV - Returns Processing - Supplier View
/SCA/ICH_RETG - Returns Processing - Goods Recipient View
Hope this helps you. Please confirm.
Regards
R. Senthil Mareeswaran. -
Where can I find the source code of Java web start demos program?
When I watch these demos, I think this program is very good to start to learn Java. Is there anywhere to find the source code?
By trawling the approprite forum
http://forum.java.sun.com/forum.jsp?forum=38 -
Good Day! I'm just having a hard time of thinking how to encrypt the source code of a given web page(html, jsp, etc.) without affecting how it is previewed in an Internet Browser. What I plan is to disable the capabilities of some malicious Internet users of copying the source codes of my web pages by using the "View Source" option of Internet Explorer and the equivalent function in Netscape Navigator. Please somebody help me in this matter (I'm planning to use an IDEA algorithm using JCE)....
It would be big help if a running code is supplied.
Thank you very much in advance.
God Bless!!!
- Jonathan Untalan([email protected])don't know theses softs. What i know about encrypted web pages, is that you need a secure socket connection (https).
Your web page will be ciphered, send to the user, and decipher by the browser with the signature file associated to your https connexion.
It isn't possible to encrypt your page directly, and then decrypt them when requested.
For the download time, only the server is responsible for this.
if it is overloaded, then it will slow down its upload.
Maybe you use some encryption method that require a lot of CPU time.
For summary : you can only cipher the pipe transport, but not the transported pages.
Good luck in your search. -
Debugging source code in Web-Inf
Dear All Java Expert,
I'm using Forte 3.0 and debugging source code for different web application folder. example ..\webapps\APPS1 and ..\webapps\APP2.
Ok, my problem is i was unable to 'share and debug' same servlet file over 2 web application.
Example, a.java located at ..\webapps\APPS1\Web-INF\Classes\a.java and shared by APP2. The problem is when APP2 having problem i need to copy the java file frm APPS1 to APPS2 web-inf folder for debugging.
I'm still new using the IDE debugging features, any eXperience people pls don't be hesitate to reply.What exactly is the problem?
You want APPS1 and APPS2 to share the same Servlet code?
If so, you need to think through what you are doing. Consider this scenario; I point my web browser to www.wikey.com/APPS1 and the servlet in \webapps\APPS1 returns a response. I point my web browser to www.wikey.com/APPS2 and APPS2 returns a response.
That's what we pretty much expect to happen.
Now let's say you put the code in a file called BOTH. If I point my web browser to www.wikey.com/BOTH, then it launches the servlet named BOTH. That's reasonable. However, if BOTH consists of code from APPS1 and APPS2 in the same class, then the web server has absolutely no idea which block of code to call.
However, you can make it www.wikey.com/BOTH?doRoutine=APPS1 where it will launch the APPS1 specific code. But why bother? Why not just launch APPS1 directly?
So to answer your question, there's no real advantage to having two different URLs point to the same Servlet. Consequently, there's no real advantage to having a debug URL point to to a production URL's Servlet, i.e., no point in sharing code for debugging purposes.
So the question you want to ask is, "Is there a macro in Forte 3.0 that will allow people to make copies of all the source files in one folder, place those copies in another folder AND set up the URL and environments correctly?"
The answer is - not that I'm aware of. If you want such a capability, you should code it yourself. But even in Microsoft Windows, it only takes a few seconds to select the folder and do a cut-and-paste copy, then rename the files.
Incidently, this is totally different than putting common class files in a common directory, modifying the class path, and allowing two separate servlets to import those classes. -
Safari showing source code in browser
This morning one of my users machines started rendering all web pages with the source code showing in the browser. It seems to be code in the head tags like javascript and css. here is an example of how safari is rendering the apple home page http://www.aloftgroup.com/safari.jpg
According to the user they didn't change any settings or install anything new. I can't figure it out. I have checked it against other machines running the same set up and everything looks fine on there machines and all the settings are the same.
I dumped the safari preference file com.apple.safari.plist
Thanks in advanceI experienced this too, and I'm not alone.
Every now and then, this page: http://ace.dse.nl/ace_jubileum.html shows up in Safari as html code.
I had a look at the code and changed it so that it now validates as "Valid HTML 4.01 Transitional" code in the http://validator.w3.org/ - but this doesn't seem to make any difference.
The weird thing is that this error happens randomly. If you reload the page 20 times, it happens one or two times.
I read on www.antipixel.com that this behaviour was reported more than a year ago, and seems to be a Safari bug.
Any work-arounds? -
Dynamic-side Box? Can't read source code with java
Hi all,
I am trying to read a source code of a web page with a java program. I can connect to the page and read a part of the source code without any problems however after a while when it comes to a part where mozilla and opera identifies as "dynamic-side box" my java program fails to read the source code and stops reading the rest of the page.
Here is the part of the output I get from mozilla:
<body id="city">
<script type="text/javascript" src="/js/wz_tooltip.js"></script>
<div id="container">
<div id="container2">
<div id="header">
<h1>Ikariam</h1>
<h2>Antik �ağı Yaşa!</h2>
</div>
<div id="breadcrumbs"><h3>Bulunduğun nokta:</h3><a href="?view=worldmap_iso&islandX=78&islandY=80" title="D�nya haritasına d�n"><img src="skin/layout/icon-world.gif" alt="D�nya" /></a> > <a href="?view=island&id=2444" class="island" title="Adaya d�n">Sterios[78:80]</a> > <span class="city">ProPolis</span></div><!-- -------------------------------------------------------------------------------------
///////////////////////////// dynamic side-boxes. //////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////// -->
<div id="information" class="dynamic">
<h3 class="header">Info</h3>
<div class="content">And here is the corresponding part in java console output:
<div id="breadcrumbs">
<h3>Bulunduğun nokta:</h3>
<span class="textLabel">Hata!</span>
</div>
<div id="information" class="dynamic"></div>
<div id="mainview">
<div class="buildingDescription">
<h1>Hata!</h1>
</div>
<div class="contentBox01h">
<h3 class="header"><span class="textLabel">Hata mesajı</span></h3>
<div class="content">
<ul class="h�bsch">
<li><a href="http://ikariam.net"></a></li> </ul>
</div><!-- end #content -->
<div class="footer"></div>
</div><!-- end #contentbox -->
</div><!-- end #mainview -->Is there a way to skip this dynamic-side boxes in java. Because I need to read an information that is located at the near end of the source code however since it stops when it hits to a dynamic-side box I can't.
Thanks in advance, regards...Hi,
That is what I was trying in deed! I was trying with a Scanner but I also tried with the link you have given. That also failed. Somehow java stops reading the source when it hits "dynamic-side box". However there has to be a way to skip this. If mozilla can do that, I know that java also can. I wonder how....
Cheers... -
Does Contribute allow Admins to paste in (apply) source code
to various Web pages? I've got a source code from Google Analytics
I want to use for tracking and can't find how to apply it using
Contribute.Use Insert--> HTML Snippet and insert the Google Analytics
code at the end of the page. I tried in one of my site, it worked
fine.
When viewed the page source the GA code was insert here
<GA code comes here>
</p>
<!-- #EndEditable --></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
Thanks -
Unable to edit WebDynpro source code after import from NWDI Track
Hi !
I am facing an odd issue when trying to modify the source code in a web dynpro that is in a Track.
This is what happens:
I create the project from Inactive DCs
I double click in the component controller (for example) and try to enter a line of code
A pop ups appears saying that in order to modify the file I have to check it out and to create an activity
The window to create a new activity appears, and I create the new activity
I am informed that the file to be edited will be included in the activity
--- Until now everything is normal ---
A try again to type something inside the source code.. and NOTHING happens, is as if my keyboard was broken.
After trying 1000 things I found a workaround that is:
Open the DTR perspective in NWDS, go to inactive -- <project>.. gen_wdp , ( and in gen_wdp right click, edit --> subfolder tree).
After doing that I am able to edit the source code... this is very strange! I mean, I never had this problem before..
somebody has a hint ?
Best regards!
Marco.hi,
I am able to edit the code is one of the DCs in the same track and I am unable to do so in the other. The error that I see in a popup while trying to edit the code is :
The operation can only be performed if the following objects are writable:The project is not in the repository, but there are some read-only files
Component Controller com.aramco.sao.had.hmd.dcsa.newagrcomp.NewAgrComp
Read-only: D:\Users\bohramx\Desktop\nwds-extsoa-7.3-SP02-PAT0001-win32\eclipse\workspace.jdi\1\DCs\aramco.com\it\ca\esales\web\newagrmnt\_comp\src\packages\com\aramco\sao\had\hmd\dcsa\newagrcomp\NewAgrComp.wdcontroller
Please suggest how to checkout files for edit.
Thanks!
seventyros
Maybe you are looking for
-
Time Machine problems with MBP 2011
I've been having problems trying to back up my computer data to a hard drive using Time Machine. I've already set Time Machine up, connect my 500 GB Seagate hard drive (which says is specifically designed for Time Machine on the Mac) and press Start
-
Hi, I have been having some glitches on my MBP. I downloaded OnyX a long time ago and ran it once every month or so. I have missed a few months and wanted to run the program to see if these glitches could be fixed. However, OnyX now won't launch. I c
-
How to use URL class to execute a java class/app on a remote machine?
I am a beginner in Java networking and have a question about URL programming. How do I pass parameters to a java class/application over the web and then cause it to execute ? I then want to get the result back from the clas/app. The class/app resides
-
How to isolate web applications at URL level with Oracle HTTP Server?
We have 2 machines each for oracle web cache, oracle http server and oracle application server (oc4j). We would like to host many web applications on this infrastructure. We have an issue with application/web site isolation for maintenance purposes.
-
HT204053 I seem to have forgotten my iCloud password, how can I change it?
How can I retrieve or change my password for iCloud?