How to manipulate URLS?
I am trying to run two files so that I can invoke the webpage from an applet.
Here is my code:
1. SiteSelector.html
<HTML>
<HEAD><TITLE> New Document </TITLE></HEAD>
<BODY>
<APPLET CODE="SiteSelector.class" WIDTH=300 HEIGHT=200>
<PARAM NAME ="title0" VALUE="Java Home Page">
<PARAM NAME="location0" VALUE="http://java.sun.com/">
<PARAM NAME="title1" VALUE="Dietel">
<PARAM NAME="location1" VALUE="http://www.deitel.com/">
<PARAM NAME="title2" VALUE="JavaWorld">
<PARAM NAME="location2" VALUE="http://www.javaworld.com/">
<PARAM NAME="title3" VALUE="Gamelan">
<PARAM NAME="location3" VALUE="http://www.gamelan.com/">
</APPLET>
</BODY>
</HTML>
2. SiteSelector.java
import java.net.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.applet.AppletContext;
public class SiteSelector extends JApplet {
private Hashtable sites;
private Vector siteNames;
public void init()
sites= new Hashtable(); //sites have two parameters: title, url
siteNames = new Vector();
getSitesFromHTMLParameters();
Container c = getContentPane();
c.add(new JLabel("Choose a site to browse"),BorderLayout.NORTH);
final JList siteChooser = new JList(siteNames);
siteChooser.addListSelectionListener(
new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e)
Object d = siteChooser.getSelectedValue();
URL newDocument = (URL)sites.get(d);
AppletContext browser = getAppletContext();
browser.showDocument(newDocument);
c.add(new JScrollPane(siteChooser), BorderLayout.CENTER);
private void getSitesFromHTMLParameters()
String title, location;
URL url;
int counter=0;
while(true){
title = getParameter("title"+counter);
if(title != null){
location = getParameter("location"+counter);
try{
url = new URL(location);
sites.put(title, url);
siteNames.addElement(title);
}catch(MalformedURLException e1){
e1.printStackTrace();
else
break;
++counter;
I use JDK1.3, and tried the following two ways to run
this, compiling is fine, but none works.
1. I use appletviewer.
2. I type C:\SiteSelector.html in InternetExplorer5
browser.
Do I still need to install Java plug-in to make it
works?
Thanks,
Nope, it's not the sandbox. Viewing web pages is not a (major)security issue. Since it's not giving any compiling error the code is right at least. What error message is it giving in browser or appletviewer. If none, you're on your own.
Similar Messages
-
Hi guys
I have this XML returned to my app:
<menu>
<categoria nome="cat1">
<item>item 1</item>
<item>item 2</item>
<item>item 3</item>
</categoria>
<categoria nome="cat2">
<item>item 1b</item>
<item>item 2b</item>
<item>item 3b</item>
</categoria>
<categoria nome="cat3">
<item>item 1c</item>
<item>item 2c</item>
<item>item 3c</item>
</categoria>
</menu>
this is retrieved by an HTTPService
<mx:HTTPService id="xmlMenu" url="data/menu.xml"
method="POST" useProxy="false" result="handler()"
resultFormat="e4x" />
How to manipulate the XML data in then result handler using
action script?
- show nodes length
- get the atribute of node categoria
- get to the values of node item
i've tried
xmlMenu.lastResult.menu.length.toString()
xmlMenu.lastResult.menu.categoria[0].length.toString()
xmlMenu.lastResult.menu.categoria[0].@nome
xmlMenu.lastResult.menu.categoria[0].item[0]
nothing happensA better way to get the result is:
<mx:HTTPService ..result="handler(event)"
and in the handler:
private function handler(oEvent:ResultEvent):void //might
need to import ResultEvent
var xmlMenu:XML = oEvent.result;
trace(xmlMenu.toXMLString())
Now you can use the e4x expressions;
trace(xmlMenu.categoria[0].item[0]); //ashould trace "item 1"
Tracy -
How to delete URL Maintenance in peoplesoft
how to delete URL Maintenance in peoplesoft , Please any one suggest to me how to delete identifier.
Navigation : Main menu -->Peopletools --> Utilities --> Administration --> URL
in this url page have URL maintenance.I added one identifier .
URL Identifier:
*Description:
*URL:
Comments:
Regards,
lokeswarMain Menu>PeopleTools>Portal>Structure and Content>Traverse to the URL by clicking on the links(Peopletools --> Utilities --> Administration --> URL)>Click on Edit Link
Check the box for "Hide...." -
How does the URL of DataSocket constitute?And how to use it in LabWindows/CVI ?
Hi !
There's a problem puzzled me some days.How does the URL of DataSocket constitute ? And how to use it in LabWindow/CVI ?
For example.I have downloaded a code in http://zone.ni.com/devzone/cda/epd/p/id/3787.I want to make it work properly.So I configure my DataSocket Server Manger according to the URL of this statement.
DS_Open ("dstp://weather.natinst.com/weather/current",
DSConst_ReadAutoUpdate, DSCurrentCallback, NULL,
&dsCurrentHandle);
My DateSockket Server Manger is configured as:
However,it could not work properly when I debug it.
There's a introduction at the top of the code."You may need to replace the references to weather.natinst.com to 130.164.140.10 if the DNS isn't working properly."So,I modified the statement into
DS_Open ("dstp://130.164.140.10/weather/current",
DSConst_ReadAutoUpdate, DSCurrentCallback, NULL,
&dsCurrentHandle);
but,it did work properly.
We want to communicate with other computers via the URL of DataSocket in LabWindows/CVI.Whereas,how could we make it ia the URL ?
If anyone could help me solve this problem,I would appreciate it very much !
Best regards.
xiepei
I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.Hi !
Thank you very much for your reply! I will accept your advice.
Besides,I have another question.If I want to visit other computers or other websites,how does the URL of DataSocket I constitute ? Does the URL has any relation with the DataSocket Server Manger ?If does,how to configure the DataSocket Server Manager to let them connected.If they have no relation,how to use the DataSocket Server Manger ?
After all,I want to know how to use it in LabWinows/CVI ?
Thank you very much !
Best regards!
I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance. -
How to specify URL in server.xml of Tomcat
Hi Everybody,
I need help.How to specify url in the server.xml.
I developed one application in the Tomcat 3.3.I want to access the by entering uri(like:http:test.com).
What are tags to enter in the server.xml.
Right now i am accessing like:http://localhost:8080/Test/Login.jsp
I want replace this with (www.test.com).
This site will access from anywhere means it is going to live.
So what are things have to do in the server.xml
Please provide the solution.
Regards
SridharHi Raktim:
I looked around on SDN and it seems that i have found what you have been looking for.
Kindly look at page number 24 and 25 of this page
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4d46fb8a-0b01-0010-9fbe-e4b96533b222
P.S: Kindly assign points if your query is resolved, also close the question to assist other users narrow the search and find solutions -
How to call url from abap in background
Hi,
I could open url but it opens browser window
i saw several threads on how to cal url in background but no good answer
kindly help
thanks
BHi,
Try the following (primitive) example, it calls an url and display the result on screen.
Hope this will help you.
<pre>
REPORT test.
CLASS lcx_http_client DEFINITION
Minimal Error Handling
CLASS lcx_http_client DEFINITION INHERITING FROM cx_static_check.
PUBLIC SECTION.
INTERFACES:
if_t100_message.
DATA:
mv_method TYPE string, "#EC NEEDED
mv_subrc TYPE i. "#EC NEEDED
METHODS:
constructor
IMPORTING iv_method TYPE string OPTIONAL
iv_subrc TYPE i OPTIONAL
iv_msgid TYPE symsgid DEFAULT '00'
iv_msgno TYPE i DEFAULT 162.
ENDCLASS. "lcx_http_client DEFINITION
CLASS lcx_http_client IMPLEMENTATION
CLASS lcx_http_client IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
mv_method = iv_method.
mv_subrc = iv_subrc.
if_t100_message~t100key-msgid = iv_msgid.
if_t100_message~t100key-msgno = iv_msgno.
if_t100_message~t100key-attr1 = 'MV_METHOD'.
if_t100_message~t100key-attr2 = 'MV_SUBRC'.
ENDMETHOD. "constructor
ENDCLASS. "lcx_http_client IMPLEMENTATION
CLASS lcl_http_client DEFINITION
Facade for if_http_client
CLASS lcl_http_client DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
get_http_client_by_url
IMPORTING iv_url TYPE string
iv_proxy_host TYPE string OPTIONAL
iv_proxy_service TYPE string OPTIONAL
PREFERRED PARAMETER iv_url
RETURNING value(ro_http_client) TYPE REF TO lcl_http_client
RAISING lcx_http_client.
DATA:
mr_http_client TYPE REF TO if_http_client.
METHODS:
send
RAISING lcx_http_client,
receive
RAISING lcx_http_client,
close
RAISING lcx_http_client,
get_response_header_fields
RETURNING value(rt_fields) TYPE tihttpnvp,
get_response_cdata
RETURNING value(rv_data) TYPE string.
ENDCLASS. "lcl_http_client DEFINITION
CLASS lcl_http_client IMPLEMENTATION
CLASS lcl_http_client IMPLEMENTATION.
METHOD get_http_client_by_url.
DATA: lv_subrc TYPE sysubrc.
CREATE OBJECT ro_http_client.
cl_http_client=>create_by_url( EXPORTING url = iv_url
proxy_host = iv_proxy_host
proxy_service = iv_proxy_service
IMPORTING client = ro_http_client->mr_http_client
EXCEPTIONS argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 999 ).
CHECK sy-subrc <> 0.
lv_subrc = sy-subrc.
RAISE EXCEPTION TYPE lcx_http_client EXPORTING iv_method = 'GET_HTTP_CLIENT_BY_URL' iv_subrc = lv_subrc.
ENDMETHOD. "get_http_client_by_url
METHOD send.
DATA: lv_subrc TYPE sysubrc.
mr_http_client->send( EXCEPTIONS http_communication_failure = 5
http_invalid_state = 6
http_processing_failed = 7
http_invalid_timeout = 8
OTHERS = 999 ).
CHECK sy-subrc <> 0.
lv_subrc = sy-subrc.
RAISE EXCEPTION TYPE lcx_http_client EXPORTING iv_method = 'SEND' iv_subrc = lv_subrc.
ENDMETHOD. "send
METHOD close.
DATA: lv_subrc TYPE sysubrc.
CALL METHOD mr_http_client->close
EXCEPTIONS
http_invalid_state = 10
OTHERS = 999.
CHECK sy-subrc <> 0.
lv_subrc = sy-subrc.
RAISE EXCEPTION TYPE lcx_http_client EXPORTING iv_method = 'CLOSE' iv_subrc = lv_subrc.
ENDMETHOD. "close
METHOD receive.
DATA: lv_subrc TYPE sysubrc.
mr_http_client->receive( EXCEPTIONS http_communication_failure = 9
http_invalid_state = 10
http_processing_failed = 11
OTHERS = 999 ).
CHECK sy-subrc <> 0.
lv_subrc = sy-subrc.
RAISE EXCEPTION TYPE lcx_http_client EXPORTING iv_method = 'RECEIVE' iv_subrc = lv_subrc.
ENDMETHOD. "receive
METHOD get_response_header_fields.
mr_http_client->response->get_header_fields( CHANGING fields = rt_fields ).
ENDMETHOD. "get_response_header_fields
METHOD get_response_cdata.
rv_data = mr_http_client->response->get_cdata( ).
ENDMETHOD. "get_response_cdata
ENDCLASS. "lcl_http_client IMPLEMENTATION
PARAMETERS: p_url TYPE string DEFAULT 'http://www.google.com' LOWER CASE,
p_phost TYPE string DEFAULT 'your_proxy_here' LOWER CASE,
p_pserv TYPE string DEFAULT '8080' LOWER CASE.
*===================================================================================
START-OF-SELECTION.
TRY .
DATA: gt_data TYPE string_table,
gv_data TYPE string,
gr_http_client TYPE REF TO lcl_http_client,
go_cx TYPE REF TO lcx_http_client.
"Initialize the http client
gr_http_client =
lcl_http_client=>get_http_client_by_url( iv_url = p_url
iv_proxy_host = p_phost
iv_proxy_service = p_pserv ).
"Call the specified URL and retrieve data from the response
gr_http_client->send( ).
gr_http_client->receive( ).
gv_data = gr_http_client->get_response_cdata( ).
"Its over....
gr_http_client->close( ).
"Display result
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN gv_data WITH cl_abap_char_utilities=>newline.
SPLIT gv_data AT cl_abap_char_utilities=>newline INTO TABLE gt_data.
LOOP AT gt_data INTO gv_data.
WRITE: / gv_data.
ENDLOOP.
CATCH lcx_http_client INTO go_cx.
MESSAGE go_cx TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
</pre> -
Hi, how to use URL encoding in jsp
hi, how to apply URL encoding in jsp for a string, could u pls suggest some ideas to use URL encoding in jsp
thank you in advancehi, thnx for the reply, but my problem is to use url encoding method
i would u like to know how to represent in jsp program i have asp code some thing like this
href='/project/tel_number.asp?team=<%=DbRecTeam("id")%>&name=<%=Server.URLEncode(DbRec("name"))%>'
i would like to know how replace that Server.URLEncode stmt in jsp, could u pls suggest some equivalent method for the above stmt
thanx in advance -
How to encode URL parameters in pl/sql?
How to encode url and its paramters in PL/SQL to call a page using html GET method? Is there any equiavlent method of java's URLEncoder.encode() method in pl/sql (in any web packages) ?
Any help/pointers highly appreciated.
P.S. : URGENT PLEASE!!!http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:371959198986
-
How does this urls works!?
any brainy!?
Oh sorry i though people can understand what I was trying to ask...
Actually how to create url systems like twitter and facebook, where the url seem to become a folder name like
twitter.com/exoot
twitter.com/adobe
where "exoot" and "adobe" are users name.
Are these made possible by creating index.php file at the folder like this?
twitter.com/exoot/index.php
twitter.com/adobe/index.php
Or theres other url caching methods which capture/cache the "exoot" and "adobe" string and fetch thee user data from the server.
But if they have to create such a folder system, it would be a large amount of file storing would be required and updating all the would be extreamly hard..
My question is how this possible if they didnt practise the folder system i meantioned above... because i want to create such a system like
exoot.100webspace.com/username
instead of
exoot.100webspace.com/page.php?id=username
where, by using the username I able to show the username's profile page by fetching mysql.
thanks in advance -
How to read URL parameters of one wdp component into other WDP component?
Dear Experts,
Can anyone let me know how to read URL parameters of one wdp component into other WDP component?
My requirement is i have one standard WDP component with 3 URL parameters and i needto
read that URL parameters along with their values in my Z-WDP component.
Thanks
SKHi Santosh,
You can read parameters send from one WebDynpro Component to another component by adding code in "HANDLEDEFAULT" Event Handler method ( Window )of your target Web Dynpro Component.
data: lt_parameter type tihttpnvp,
ls_parameter type ihttpnvp.
lo_api_controller ?= wd_this->wd_get_api( ).
call method lo_api_controller->get_message_manager
receiving
message_manager = lo_message_manager.
clear : ls_parameter.
refresh : lt_parameter[].
* Read all URL parameters
wdevent->get_data( exporting name = if_wd_application=>all_url_parameters importing value = lt_parameter ).
if not lt_parameter[] is initial.
clear : ls_parameter.
read table lt_parameter into ls_parameter index 1.
if ls_parameter-name = 'ACTION' and
ls_parameter-value is initial.
lv_flag = 'X'.
clear : lo_msg.
lo_msg = 'Action Parameter Missing in URL Link !'.
* report message
call method lo_message_manager->report_error_message
exporting
message_text = lo_msg.
else.
endif.
Best Regards
Priyesh Shah -
How to use "url.openStream()" . What this function does?
how to use "url.openStream()" . What this function does?
Edited by: sahil1287 on Apr 16, 2009 10:02 PMhttp://java.sun.com/javase/6/docs/api/java/net/URL.html#openStream()
http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html -
How to use url iview???
how to use url iview???
HI all
I need to use url iview as back button in the same page with saptransaction iview.
url iview to used as back button to the home page.
pl suggeest how to use url ivew....what sort of properties need to be used.HI chander
thank u for ur response
I have done an aplication in which i have called sap transsaction ivew usind quick link property in .html(page) language.
where we will be fetching saplogon server using this sap trans saction ivew into the portal frame work .
when i loging into the server and log off with in the portal frame work i am not able to go to my aplication home page. since back/ forward link are disabled.
atleast i want know how to enable those links.
or else
i thought to use url ivew along with sap transaction ivew with a same page with diffrent layouts.but that is also fine.
and one more option was
i thought it to be used as pop up as so that when user login and log off into the server they will close that seperate window.
for that i have set the ivew property
"launch in a new window property As : display in a seperate head less portal window"
but even that is also not working.
i dont know y that property is not working
finally i have coded with java script , now i am able to open the portal in a seperate window but with headed portal.
for that i have coded some thing like below mentioned.
problem here is still i am getting the headed portal
but i want head less portal.
here headless in the sence i want it like the preview of the ivew.
please help me in this regard how to get the head less portal when i click on the link.
Regards
Gayathri -
Hi All,
How to read URL parameters in another WDA.
Thanks in advancehere is the sample code.
you can write this code in HANDLEDEFAULT method of Default Window of Application being called.
DATA:
wa_url TYPE LINE OF tihttpnvp,
int_url TYPE tihttpnvp.
wdevent->get_data(
EXPORTING
name = if_wd_application=>all_url_parameters
IMPORTING
value = int_url ). -
How to recategorize URL's when using IronPort Web Usage Controls
The usual way of recategorizing URL's doesn't work when Cisco IronPort Web Usage Controls are enabled. There's no Word in the doc about how to recategorize URL's neither. We're running AsyncOS 7.7 on S170. Please advise.
Hi,
You can try this link (normally takes 24-48 hours).
https://securityhub.cisco.com/web/submited_urls
If it doesn't work I suggest you to open a TAC case.
Regards,
Luis Silva -
How get browser URL from portlet JSR-168?
I use Oracle Portal. And I have problem.
How get browser URL from portlet JSR-168?Normaly it is
http://server:port/portletContextRoot
Did you create the portlet with JDeveloper? When you dpeloy the portlet to your application server, JDeveloper should output the URL of the portlet test page in the deployment output feedback.
Maybe you are looking for
-
Because of error 513, no message was created in Support Desk System
Hello all... Currently setting up Service Desk and when I create a service message in my satellite systems (ECC DEV, QAS, PRD, etc.), I get the error 513 as described in my subject line. I am able to create messages within the Solution Manager enviro
-
Does my hp Officejet Pro L7590 have a hard drive?
For Security reasons, is there a hard drive that needs to be removed prior to disposing of my Officejet Pro L7590?
-
Issue regarding bdc for capturing error records
Hi All, My requirement is to capture the error record and download the error record to a flat file . I have done recording for MM01 transaction . I am getting a problem like no error records are downloaded into the flat file .It is downloadin
-
Very new to using flash in websites: browser display issue
I am very new to flash ads and we are on a new platform after a website redesign. I'm having trouble with flash display settings I'm guessing since the ad displays fine in IE, but not fine in Firefox and Chrome. Images to follow (for the curious it
-
How to access my database through internet?
so my program have a database in it and the program have lots of getting and setting information from this database. but this database is supposed to be on a server obviously, but since renting server is something that i put as last thing to do when