Encoding url problem

hi experts i want use this program to understand the concept of session cookies
<HTML><HEAD><TITLE>Encoding URLs</TITLE></HEAD>
<BODY>
<B>Example encoded hyperlink: </B>
<% String link = response.encodeURL("Process.jsp");
String button = response.encodeURL("Process.jsp");
String sessionID = request.getRequestedSessionId();
out.print(link);
%>
<a href="<%=link%>">Click here</a>
<HR>
<FORM METHOD=POST ACTION="<%=button%>">
<B>Example encoded button: </B><INPUT TYPE=SUBMIT VALUE="Submit">
</FORM>
<HR>
<B>Session ID</B>
<%=sessionID%>
</BODY>
</HTML>
and thn i go to internet explorer tools tab thn privacy tab and thn in cookies section i blocked all first party and third party cookies and when i run the above code it doesnot show me the encodedurl that i take in link variable and try to display it
plz tell me where i am wrong

hi thankx direct me
i ll check this after when i obtain an domain name
is it possible to chek it on localmachine becaz i am yet developing my portal and i can run it only my server that is on my own machine
is there any method in which i can use my computer ip address instead localhost(127.0.0.0)

Similar Messages

  • A wierd problem while encoding URLs

    Hi all,
    I'm facing a wierd problem with the java.net.URLEncoder class. The encode function in this class is used for encoding URL based on standards like "UTF-8" etc..
    I need to encode the URLs, because i have to send this information in a XML to another server.. Here's what the URLEncoder is doing if i give it the URL
    http://mydomain.com:80/myServlet?_fileName=filename.mp3&_useStreaming=true
    its encoding this as
    http%3A%2F%2Fmydomain.com%3A80%2FmyServlet%3F_fileName%3Dfilename.mp3%26_useStreaming%3Dtrue
    but, all I wanted is to encode only '&' character ( as XML misinterprets this character with schemes ).
    So, my question is .. is there any way that i can selectively encode the characters in the URL?
    Any help wud be appriciated in this regard. :-)

    I accept what you are saying.. URLEncoder encodes any string that's passed to it..
    I infact have two different problems in hand.. The reason i mentioned only one above is because the solution to the first problem cud as well solve the second.. Anyway, here's the second problem ...
    I'm recieving an XML from a server, where i get the URL info and i have to download the CONTENT from that URL.. Sample xml is given below
    <Music>
    <Singer>Tata Young</Singer>
    <contentURL>http://myMusic.com/sexy naughty.mp3</contentURL>
    </Music>
    if you see the URL in the xml, that infact contains spaces in it.. I have my logic which checks if the given URL is a absolute URL or relative URL
    if( relative URL)
    I append "http://domain name:" stuff to make it absolute
    else
    i connect to the URL directly to get the Content
    I'm using
    URI i = new URI(str);
    i.isAbsolute() method to determine whether its a absolute URL or not..
    but this method doesn't seem to work for URLs that have spaces in them.. So, i encoded the URL and tried passing it to the method.. but it still doesn't work..
    I probed into URI class itself and found out to my amazement that URI class assumes that URL contains only alpha numeric characters and few special characters like '+' , '/' , ':' etc..
    Since the encoded URL has '%' character in it.. its not able to say that its a absolute URL.. Tht's the reason I asked for selective encoding.. ( say, which encodes only [space] character)..

  • A peculiar problem with encode url

    Hi,
    I have the following code snippet in jsp
    <a href="<%=urlencoder.encode("cxc.jsp?P1=RWDS") %">> Rewards</a>
    But when this page is requested, the oracle application server responds with response 404 stating requested url not found.we aer using oracle application server 10g release 2.
    But without encoding the response is correctly displayed.
    has it got to do anything with encoding? or will it be required to change the code.
    But the same encoded url works perfectly fine on iplanet application server.
    Thanks in advance

    I was able to solve this by including the google code in an external PHP file as well. However if my template has a repeating region in it, and my contribute user adds a region from it, it breaks the code again :/
    Are there any other suggestions out there??

  • [SOLVED] Encoded URL's are Re-Encoded When Clicked

    Some of our users here are copying URL's of relevant files [from one of our sites] and pasting them into Excel.
    As the need arises, they refer back to the Excel document and click the link to retrieve the document.
    When clicked the already-encoded URL's:
    https://sub.domain/some/path/to/files/My%20Super%20Long%20File%20Name-Thats%20Already%20Encoded.pdf
    Are getting encoded a second time, which result in a URL like:
    https://sub.domain/some/path/to/files/My%2520Super%2520Long%2520File%2520Name-Thats%2520Already%2520Encoded.pdf
    This naturally won't work because its now literally looking for a file called "My%20Super%20Long%20File%20Name-Thats%20Already%20Encoded.pdf" which of course doesn't exist.
    The URL's in Excel appear normal in the cells themselves.
    The editing the actual hyperlink confirms its also correct there as well.
    The URL's also look normal in the formula bar.
    I've reproduced this behavior on multiple company machines: Windows 7 x64 Enterprise SP1 with Office ProPlus 2010 32-bit.
    I was also able to reproduce this on vanilla Windows 7 VM's in Hyper-V using Office ProPlus 2010 and 2013.  Although domain joined, they're in an OU with blocked inheritance enabled and no linked GPO's.
    I can't figure out where the problem is: Excel, Windows, IIS or something else?

    Hi,
    I’ve done a test for this situation, but the url won’t change after reopening the file.
    1. A pdf file in SharePoint, and the file name contains some spaces which is the same with customers.
    2. Input the SharePoint URL into Excel, and each spaces has been replaced by %20
    3. Then, I can open the file in IE
    4. After I closed the website and excel file, I could open it in IE again and the URL didn’t change.
    As you mentioned in the ticket “Are getting encoded a second time, which result in a URL like”, may I know if the re-encoding was done automatically or manually? Based on the test result, it won’t encode a second automatically.
    If it is done manually, the issue should be most likely caused by the space character being encoded twice, because the space character is encoded as %20 as our two url show. However, based on your second url, it turned into %2520, Since the % character
    is encoded as %25, it should be a result of a double encoded. Actually, URLs need their characters to be in a specific format, ASCII characters, so that browsers can correctly interpret and parse the data. For every ASCII character in URLs, it will be encoded
    a string starting with %, and % is also an ASCII character in URLs and encoded to %25. If we double encode a URL, which results that every ASCII character in the URL will be encoded a string starting with %25, and that the URL becomes invalid. Therefore, I
    suggest you name the file using
    alpha-numeric
    characters
    only or do not encode it twice.
    If it is done automatically, since you have reproduced the issue on multiple machines, could you please help check the following Excel settings in several machines to make comparisons with each other.
    Excel Option>Advanced, Scroll to the General section and click Web Options, select Encoding
    If it possible, would you mind sharing a test file with me to do a test from my end?
    Regards,
    Melon Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • HT3281 Podcasts from Current Tv, since three weeks prior to the Nov 2012 election have had a url problem and cannot be played on my mac mini 2011 with 10.8.2 and the latest Itunes? anyone know why ? I am in contact with Itunes now and they wanted screensh

    Podcasts from Current Tv, since three weeks prior to the Nov 2012 election have had a url problem and cannot be played on my mac mini 2011 with 10.8.2 and the latest Itunes? anyone know why> ? I am in contact with Itunes now and they wanted screenshots of the problem, I can get these current tv episodes with a vpn and my isp says they are not blocking them, but i was surprised that prior to the election they were blocked, ?
    I also can get them on my Android Samsung Galaxy note 2 with no problem but on the Macmini cannot>/? I Unsubscribed and subscribed many times but still no luck, any ideas? I am waiting for the senior advisor to get back to me on this issue. I am in THailand now where the problem is happening and as I said the ISP says they do not block any podcasts.I also do not want it on my iphone 5, so I have to wait and see why the mac mini is not getting it.

    I seem to have fixed it by putting <div  class="clearfloat"></div> after the navigation bar?

  • 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

  • Encoding URL in jsp

    Hello All,
    I want to encode URL in my jsp code such that when the jsp is rendered and if user sees the source code then the url should not be shown.
    Is this possible ?
    Thanks

    if user sees the source code then the url should not be shownIf html source code doesn't contain the URLs then how will browser know where to send HTTP request? It is like saying "I sent my sister a $100 bank cheque but didn't sign it because I don't want her to know who has sent it."

  • Iisforward and encoded URLs

    I cannot seem to get the iisproxy/iisforward combination to properly handle
    encoded URL session strings.
    I have been performing my tests with WebLogic Sever 5.1.0sp5, IIS 5 and
    Windows 2000 (both IE and Netscape). I use the
    examples.servlets.SessionServlet included with WebLogic server. It has a
    link that tests encoded URL session management. With sp4 and before, the
    iisproxy handled this well, so long as I included the arbitrary extension.
    The forwarding works to hit the servlet the first time, but subsequent
    times present me with a 404, as if the proxy decided it shouldn't forward
    the request and IIS is searching its files. IIS logs confirm this.
    Anyone been able to get encodeURL() calls to work through the proxy?
    Jesse

    Either no one uses encodedURLs or no one bothered trying this. However, I
    found this behavior in both IIS 4 and IIS 5 and filed a bug report. A
    change request has been made and can be tracked via ID 189897.
    Jesse

  • Protecting Live Stream Encoding URL

    We set up a Flash Media Server and we are trying to figure out how to protect our live encoding url. Seems like anyone with a Flash Media Encoder and who knew the location of our server could publish a live stream. Can we password protect this in any way?

    Asa,
    Are you able to share details of what the solution being developed by Adobe will involve, and which versions of FMS it will apply to (an update for 3.0, 3.5 or just a feature of 4.0)
    Thanks,
    Michael

  • Url problem??

    Hi!
    I wanna know that what i should use to handle the url problem
    like if there is a url
    http://localhost:8080/myserver/mydir/home.jsp // mydir is physical dir
    http://localhost:8080/myserver/mydir2/home.jsp
    http://localhost:8080/myserver/mydir4/home.jsp
    http://localhost:8080/myserver/mydir/index.html
    how i can mapp more then one files regardles of only index.html file how i can map a ruquest to them like if user just enter
    http://localhost:8080/myserver/mydir/
    home.jsp should be shoown to him.
    Waiting for reply.
    Bye.

    This has to do with webserver configuration, which one are you using?

  • Problem translating servlet name from an encoded URL when using HTTPS

    Hello:
    I am experiencing a wierd issue when using WLS 5.1 with HTTPS and am hoping someone might
    be able to shed some light...
    I have deployed a web application and am using HTTPS.
    So, a typical call to a servlet is
    https://foo.com/web_app_context/servlet_name/servlet_arguments
    The servlet is used to upload files from disk to a database and to also download the same.
    Therefore, the servlet_arguments string contains the file name among other things.
    The problem seems to arise when the file name contains either a space or an
    underscore e.g. "file_name" or "file name". It is then typically encoded as
    "file%20name" in
    the URL.
    So a call then looks like:
    https://foo.com/web_app_context/servlet_name/file%20name
    When this request is sent to WLS, it seems to truncate the servlet_name by a couple
    of characters causing the request to fail.
    This works fine using HTTP.
    Any thoughts would be much appreciated.
    Thanks in advance.
    Prashant

    The JNDI call is different when you call an EJB from inside the J2EE.
    ctx = new InitialContext();
    ref = ctx.lookup("java:comp/env/<JNDI-Name>");
    Regards
    Stefan

  • Problems with decoding an latin1-encoded url

    Hi,
    i have a problem with decoding german umlaut-characters from an URL.
    I'm using Tomcat 5.5 on a Linux server and one on a windows machine for development. Both webapps have the same configurations.
    A servlet decodes the URL-String, parses it and stores the parsed data into a mysql-DB.
    For decoding the query-string i'm using org.apache.commons.codec.net.URLCodec.URLCodec.decode .
    Here's the code:
    String unparsedParameters = request.getQueryString();
    URLCodec codec = new URLCodec("ISO-8859-1");
    result = codec.decode(unparsedParameters);Here an example for a query-string: http://servername:8080/servlet/Import?Etwas%20wurde%20am%2025.08.2010%2010%3A16%3A50%20*ge%E4ndert*
    On the windows machine the word "*ge&auml;ndert*" is decoded correctly. But on the linux server i get "*ge?ndert*". It makes no difference if i write the result into the database or just into a logfile.
    Can anyone help?
    Thanks in advance.
    Edited by: sol1640 on Aug 26, 2010 5:59 AM

    Problem resolved.
    Instead of using the decode-method as described in my fist message now i'm doing the folowing:
    fURLDecodigCharset = "ISO8859-1";
    byte[] bytes = originalParam.getBytes(fURLDecodigCharset);
    byte[] decodeUrl = URLCodec.decodeUrl(bytes);
    result = new String (decodeUrl, fURLDecodigCharset);because the method "decode" decodes the string by using the defaultcharset. And that was the problem.
    >
    The default charset is determined during virtual-machine startup and typically depends upon the locale and charset of the underlying operating system.
    >
    Thats why i've got different behaviours on different systems.
    Thanks

  • WebDAV: Excel 2013 truncates the encoded URL at # (%23)

    (originally posted in Open Spec forum, but was asked to repost here)
    We encountered a problem  on our existing WebDAV server with Office 2013. When a file name contains a number sign (aka hash, aka pound sign), Excel truncates the URL at that sign. Note that the URL is properly encoded, i.e. "#" is replaced
    with %23.
    Word and Powerpoint behave properly and have no issues opening files via URLs containing %23. E.g, for the URL http://server/otcsdav/nodes/1500722/doc1%23end.docx, Word first calls OPTIONS on  otcsdav/nodes/1500722, then HEAD otcsdav/nodes/1500722/doc1%23end.docx,
    then eventually a GET.  The file opens successfully as "doc1#end.docx", gets locked, edited, updated and unlocked.
    Excel, however, truncates the URL (http://server/otcsdav/nodes/1500722/excel1%23end.xls), and sends HEAD for /otcsdav/nodes/1500722/excel1, which, of course, returns 404.
    Funny enough, double-encoding (i.e. to %2523) seems to work for Excel, but breaks everything else. I.e, with url = "otcsdav/nodes/1500722/excel1%2523end.xls" Excel sends HEAD for "/otcsdav/nodes/1500722/excel1%23end.xls", while Word will
    send HEAD for the URL verbatim, i.e. "/otcsdav/nodes/1500722/doc1%2523end.docx"
    Does anyone know it it's an Excel bug? is there anything we can do to circumvent this?
    P.S.1 Excel 2010 works just fine, the issue first appeared in Excel 2013.
    P.S.2 I know that Sharepoint doesn't support "#" in filenames. Our server is NOT Sharepoint, and "#" doesn't seem to be disallowed in WebDAV protocol.

    Hi Maria,
    This forum is used to discuss questions about Excel for developers, most probably the issue is related to code.
    According to your description, it seems the issue doesn't meet the topic. It might be related to how the server analysis the URL and find the corresponding file.
    I have moved this thread to "Where is the forum for" forum.
    Thanks for your understanding.
    Regards,
    George.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • RCVR_DETERMINATION.NO_RECEIVER_CASE_BE - encoded URL in WSDL

    Hi
    I have a SOAP to RFC scenario and generated the wsdl using PI 7.11 Integration Builder.  The generated URL in the wsdl contains HTML encoded characters because the URL contains a URL e.g..
    https://myhost/sap/xi/engine?type=entry&version=3.0&Sender.Service=BC_MY_SENDER&Interface=http%3A%2F%2Four_host%2Fsap%2Fabcd%5ESI_MY_PROCESS_OUTBOUND.
    I have tried to use this URL in soapUI but it does not work and returns a message like the one in this thread's subject.
    If you urldecode the url it works in soapUI.  One of our clients who will use this web service to call us has to have the url encoded (with %) in it because of the url in a url.  Problem is as soon as it hits PI, PI does not perform a urldecode and it fails.
    Has anybody else encounter this problem?
    Regards
    Naas

    Hi
    If I use the suggested method I get this message:
    Servlet com.sap.aii.adapter.soap.web.MessageServlet (Version $Id: //tc/xpi.adapters/NW711_05_REL/src/_soap_application_web_module/webm/api/com/sap/aii/adapter/soap/web/MessageServlet.java#6 $) bound to /MessageServlet
    Classname ModuleProcessor: null
    Lookupname for localModuleProcessorLookupName: localejbs/ModuleProcessorBean
    Lookupname for remoteModuleProcessorLookupName: null
    ModuleProcessorClass not instantiated
    ModuleProcessorLocal is Instance of $Proxy95
    ModuleProcessorRemote not instantiated
    I tried the following: (No party) where SI = Service Interface, BC = Buss. Comp and CC = Comm. Channel - all for the Sender.
    http://myhost/XISOAPAdapter/MessageServlet?channel=:SI:BC
    http://myhost/XISOAPAdapter/MessageServlet?channel=:BC:CC
    http://myhost/XISOAPAdapter/MessageServlet?channel=:SI:CC
    http://myhost/XISOAPAdapter/MessageServlet?channel=:CC:BC
    Then I tried the suggestion in point 1 of the note.
    https://dpi.buw.bu.edu/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_TEST_SENDER&interface=SI_TEST_OUTBOUND&receiverParty=&receiverService=BC_TEST_RECEIVER&interfaceNamespace=http://myhost/sap/kcrm
    What am I missing?
    Naas

  • Encode URL with h:outputLink

    Hi All,
    I have used an output Link to access a servlet.
    But the problem lies in i want to encode my URL. something like
    href='<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/theme/exestyle.css") %>'
    I am currently using the url in the following manner.     
    <h:outputLink value="#{facesContext.externalContext.requestContextPath}/RProcessorServlet" >

    Hi,
    Thanks for replying.
    At a plain jsf level this does not pose a problem at all for me.
    But in our project we use WSRP Portlets.Which has a producer and consumer framework.So any url we hit for file downloading hits the proxy servlet first which rewrites the URL and hits the actual servlet.
    At a higher level this is the architecture we support.
    Its a very simple requirement there is a pdf icon onclick of that i need to download the report from the database.
    I can actually invoke a javascript to handle the url in the following way.
    String encodedURL_dtd = response.encodeURL(request.getContextPath()+ "/DownloadServlet");
    But here i fail to send the row data to the javascript to be send as request parameters.
    So based on a similar post before i used <h:outputLink> in the following manner.
    <h:datatable var="item" value="databean.list" >
    <h:outputLink rendered="#{(item.strreportFormat == 'P') onclick="<context-path>/DownloadServlet">
    <h:graphicImage value="/images/icon/icon_small_pdf.gif" alt="View Reports"></h:graphicImage>
    <f:param id="id1" value="item.id" />
    <f:param id="sys1" value="item.sysName" />
    </h:outputLink>
    </h:datatable>
    I hope i could explain my query...
    Given me a chance i would stick to my jsf application running in the test environment.But things don't work when they go to the framework level.

Maybe you are looking for