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."

Similar Messages

  • 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??

  • 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)

  • 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

  • Get Gateway name / url via JSP

    Anyone say what is the method to get the Gateway name / url via JSP?
    Thanks
    Fausto

    Alex, in the normal case you have reason the client host is the gateway host.
    A simple code:
    <%
    InetAddress inet = InetAddress.getByName( request.getRemoteHost() );
    String gateway = inet.getHostName();
    String portal="http://" + gateway + "/portal/dt";
    gateway="https://" + gateway + "/";
    String url=request.getParameter("url");
    if ( url != null) {
    response.sendRedirect(gateway + url);;
    }else{
    responde.sendRedirect(gateway + portal);
    %>
    I put a jsp in the web container, I contact the jsp trough an url
    http://www.mydomain/portal/desktop/redirect.jsp without the method get for the url variable, if I call the jsp directly without gateway from my client the gateway variable is my dns hostname and the jsp cannot redirect my in the portal login page
    If I take the localhost, it works fine but if a particular case when the gateway and the platform are the same host.
    There is not a HTTP enviroment variable to get the gateway name or a simple java method to ask the correct host?
    Thank you again
    Fausto
    http://www.mydomain/portal/desktop/redirect.jsp
    i

  • [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

  • 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

  • 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)..

  • 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

  • How to retrieve URL in JSP

    Hi guys.
    Does somebody knows how can I retrieve URL in JSP?
    I need to know if the user came to my page via www.MySite.com/page.jsp or 128.951.0.0/page.jsp
    Thanks in advance,
    and have a nice day.
    Vadim.

    String URL = "http://"+request.getServerName()+":"+request.getServerPort()+request.getRequestURI()+(request.getQueryString() != null ? "?"+request.getQueryString() : "" )

  • Swing Class to send encoded url??

    Can a normal Java Swing class( NOT a SERVLET) able to use the
    javax.servlet.http.HttpServletRequest methods?
    Explaination:
    1). The user enters a handphone number into a textfield
    2). Then clicks on the "Send" button.
    3). The ActionListener of the "Send" button will retrieve the handphone number from above, performs some database retrieval.
    4). Encode a static url together with the handphone number, message and sender number.
    5). Create a HttpServletRequest and uses the sendRedirect(encodedURL) to the WWW.
    In Addition Info
    This Swing class will be running all the while
    The host computer has 24*7 internet connection
    Is it possible to do it in Java Swing?

    Can a normal Java Swing class( NOT a SERVLET) able to use the
    javax.servlet.http.HttpServletRequest methods?No, Swing cannot directly call request methods. But url may be encoded by other means.
    5). Create a HttpServletRequest and uses the sendRedirect(encodedURL) to the WWW.You may need to make Applet-Servlet/JSP communication.
    Thanks
    Hafizur Rahman
    SCJP

  • 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.

  • Building dynamic URLS in jsp

    Hello,
    I wonder if you could help , please.
    I have prepared a JSP page which has three different combo boxes.
    Depending on the option chosen , I have to submit the form to an html page that it is located in a different server.
    So I have to make the url to that server but with the value chosen in the last combo box.
    I mean , in another server in the address (http://www/ejemplo.com/test/)I have pages like :
    a1.html
    b2.html
    c1.html
    Where a1, b2 and c3 are the values chosen in the last combo.
    I have an input button , and when it is clicked , it should forward to the address:
    http://www/ejemplo.com/test/a1.html if a1 were chosen.
    I have written teh following code, but it does not work....How can I do it??? Could anybody help, please???
    <INPUT TYPE="submit" name="Solicitud" value ="Request Page" >
    <%
    if ( request.getParameter("Solicitud") != null )
    String pagina = "http://www/ejemplo.com/test/" ;
    String sel3 = request.getParameter( "Combo3" );
    pagina = "pagina" + "sel3";
    pageContext.forward(pagina);
    }%>
    </form>

    Hi Ani,
    First of all, you were correct , I forgot to include the .html for the option chosen in the combo3.....I have corrected it..but still does not work....
    Do you have any idea???
    Here you have my new code...
    <INPUT TYPE="submit" name="Solicitud" value ="Request Page" >
    <% if ( request.getParameter("Solicitud") != null )
    String pagina = "http://www.ejemplo.com/test/";
    String sel3 = request.getParameter( "CountryCode" );
    sel3 = sel3+".html";
    pagina = pagina + "sel3"; //removed the quotes for pagina
    %>
    <jsp:forward page="<%=pagina%>">
    </jsp:forward>
    <%}%>
    </form>

  • Using gateway'd URLs in JSP custom tag attributes

    Hello,
    I am running Plumtree G6 using a gateway prefix to gateway Javascript from a remote server. I have recently discovered, thanks to people's help on the forum here, that in certain cases, you need to wrap a URL in a pt:url tag in order for Plumtree to recognize it as a URL that has to be gateway'd (i.e. a URL inside of a Javascript function).
    However, I have a custom tag that contains a contextPath attribute. This custom tag then includes other XML files that get included in the final page that is displayed. I am passing this value as my contextPath:
    <mytag:body sessionName="mysession" campusName="SampleCampus" contextPath="<pt:url pt:href='http://localhost:7021/application/scripts' xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>"/>
    However, in the resulting content that is created from this custom tag, the contextPath value is still set to <pt:url pt:href=......./>, and not the actual gateway'd URL. I would have thought that Plumtree would have recognized and gateway'd this URL before it got substituted in the custom tag.
    Does anyone have any thoughts on how to get around a problem like this? One thought I had was to get ahold of the gateway URL value and pass that value directly in my contextPath attribute. Is it possible to get that gateway value, or is there a better solution here?
    Thanks again for any help you can provide.

    Chris,
    I added your code, changed the portlet's web service to send a login token for this portlet, and was then getting some ClassNotFoundExceptions related to Axis classes. So, I went and added all of the jar files from the devkit's lib directory (i.e. plumtree\ptedk\5.3\devkit\WEB-INF\lib), recompiled, and those errors went away. But, now I see the following error:
    java.lang.NoSuchFieldError: RPC
         at com.plumtree.remote.prc.soap.QueryInterfaceAPISoapBindingStub.(QueryInterfaceAPISoapBindingStub.java:27)
         at com.plumtree.remote.prc.soap.QueryInterfaceAPIServiceLocator.getQueryInterfaceAPI(QueryInterfaceAPIServiceLocator.java:43)
         at com.plumtree.remote.prc.soap.QueryInterfaceProcedures.(QueryInterfaceProcedures.java:37)
         at com.plumtree.remote.prc.xp.XPRemoteSession.(XPRemoteSession.java:202)
         at com.plumtree.remote.prc.xp.XPRemoteSessionFactory.GetTokenContext(XPRemoteSessionFactory.java:80)
         at com.plumtree.remote.portlet.xp.XPPortletContext.getRemotePortalSession(XPPortletContext.java:261)
         at com.plumtree.remote.portlet.PortletContextWrapper.getRemotePortalSession(PortletContextWrapper.java:45)
         at jsp_servlet._collabrasuite.__riarooms._jspService(__riarooms.java:325)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:417)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    I am using version 5.3 of the EDK, and running Plumtree Foundation G6. Have you ever seen an error like this before?
    Thanks again for all of your help.

  • Encoding url in web dynpro

    hi
    i have creatend an abap webdynpro which send to an Employee pdf file with his details. In the url i have the a variable which contains the employee pernr and the program in the webdynpro controller calculate his details according to this pernr.
    Is there a way to hid or encode this part in the url  (cause i dont want that the user will have a way to chabge the pernr no in the url and watch other employee details ) ?
    thanks
    elad

    You should generate a GUID for every employee in your database and save it in the same table. For instance you have employee 1234. You run FM GUID_CREATE and the GUID is DFEC37D77015D8F19D1B005056995118. Now save this GUID in the table where your employee master data is stored (use an append structure or so). When you generate the URL include this GUID instead of the pernr so something like http://my.system/wdapp/get_details?guid=DFEC37D77015D8F19D1B005056995118. In your application you can select the corresponding employee from the masterdata table as you saved the GUID with his pernr. I can't make it simpler than this
    Rob's approach is the best way to go, security-wise! But it requires that all employees have a user ID in the system.
    Cheers, Roel

Maybe you are looking for