How to encode request url

String szUsrName="venkat & ashique";
<a href="javascript :
window.open(../jsp/Customer.jsp?cust_name=<%=szUsrName%">)">
</a>
Request URL:=> Customer.jsp?cust_name=venkat & ashique
--I think from ashique it is taking as another req parameter.
but in Customer.jsp the request parameter value comming as '''venkat''' iwant to get whole String venkat & ashique. What is the problem i know.Problem is in the string '&' symbol is there.But the solution i dont know plz can u help me. How to encode that url</a>

You need to escape non-alphanumeric characters with %XX where XX is the hexadecimal value for that character. For example:
"venkat & ashique" => "venkat%20%26%20ashique"%20 is space and %26 is the &.

Similar Messages

  • How to encode request parameters?

    Hi I'm running a small web application developed with JSP pages. But it turns out that it relies on cookies to maintain sessions, which is a limitation if the client's cookie setting disables cookies.
    I know that I could encode the request parameters and use GET method to communicate information between client and server, but have no idea how this is done.
    Can you give me some code, or recommend some tutorial to me? Thanks!

    1. If you don't want to use cookies, you could use URL rewriting to append the session ID. When you redirect to another page, do something like the following:
    a. first choose whether you want to forward or sendRedirect: (the following example is a redirect)
    //encode the parameter values to encode special characters, such as spaces
    String parameterOne = java.net.URLEncoder.encode("some value");
    String parameterTwo = java.net.URLEncoder.encode("some other value");
    //build the query string any way you want
    String queryString="?key1="+parameterOne+"&key2="+parameterTwo;
    /* Use response.encodeRedirectURL if running it through a sendRedirect.
       Doing so will rewrite the url with the session ID appended to the
       end. */
    response.sendRedirect(response.encodeRedirectURL("some.jsp"+queryString));This little code snippet demonstrates two things. It shows that URL rewriting can be used to append the session ID. It also shows you how to encode parameters (i.e. use URLEncoder.encode()).
    If you want to encode your string in the JSP, you could also do it using javascript:
    <script language="JavaScript">
    <!--
       //this is just an example javascript function
       function openPage() {
          var thisForm=document.formName;
          /* get your form element values (these are text boxes).
             Note: the javascript escape() function url encodes the values.
                   there are also other js functions to do this. */
          var paramOne=escape(thisForm.paramOne);
          var paramTwo=escape(thisForm.paramTwo);
          var queryString="?paramOne="+paramOne+"&paramTwo="+paramTwo;
          window.open("some.jsp"+queryString,"some_window_name");
       }//end openPage
    //-->
    </script>Or, you could build it using JSP expressions and scriptlets. Its really up to you. These are just rudimentary examples to help you get started.

  • How to encode entire url

    hi,
    I want to know how can i encode url. Provide me code if u can.
    thanks

    thanks for reply
    here something, that i have tried pls check the code
    example.jsp
    <%
    String Login_Id = request.getParameter("Login_Id");
    String Pwd = request.getParameter("Pwd");
    String url = URLEncoder.encode("example2.jsp?Login_Id=" + Login_Id + "&Pwd=" + Pwd );
                   %>
                        <FORM name="form" ACTION="<%=url%>" style="margin-bottom: 0px" onsubmit="return check(this)">
         <TABLE border="0" align="center">
         <TR>
                                  <TD><B>Login Id:</B></TD>
                                  <TD><INPUT TYPE="text" NAME="Login_Id" style="border: 1px solid #800000"></TD>
                                  <TD><FONT SIZE="" COLOR="#D20000">*</FONT></TD>
         </TR>
         <TR>
                                  <TD><B>Password:</B></TD>
                                  <TD><INPUT TYPE="password" NAME="Pwd" style="border: 1px solid #800000"></TD>
                                  <TD><FONT SIZE="" COLOR="#D20000">*</FONT></TD>
         </TR>
         <TR>
                                  <TD colspan="2" align="right"><INPUT TYPE="submit" value="go.">
    </TD>
    </TR>
    </TABLE>
    </FORM>
    example2.jsp
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD>
    <BODY>
    welcome, <%=request.getParameter("Login_Id")%>
    </BODY>
    </HTML>
    here i want to encode url along with queryString.

  • How to encode/decode URLs ...

    Hello,
    I wanted to send an entire URL as parameter to a Stored Procedure.
    How can I encode/decode this URL?
    Thanks
    Madhav

    I don't know of an encoder, but IBM alphaWorks has a decoder:
    http://www.alphaworks.ibm.com/tech/mpeg-4

  • How to encode short urls to long

    Hi community,
    Is there a way, to encode a short url like http://myServer:50000/irj/portal?NavigationTarget=navurl://b3d6d9ebac16a46574d62757803b05d4 to a long one like http://myServer:50000/irj/portal?NavigationTarget=ROLES://portal_content/every_user/general/eu_role/com.sap.portal.portal_personalization/com.sap.portal.persoUserMapping?
    I want to keep the short urls for the navigation, however I have a issue where I need to get some infos that I can only find in the long url.
    Thanks!
    Edited by: Harald Falzberger on Mar 31, 2011 3:19 PM

    check this :
    http://www.sap-basis-abap.com/sapac002.htm
    this apply to PM orders too

  • Request url

    I am new to action script, can any when tell me how to
    retrieve request url in AS2.0

    Thanks but this is what I am trying achieve in my embed tag
    src= "
    http://localhost:8080/vts/v?Id=123"
    and server interprets this request and redirects it to
    http://localhost:8080/vts/test.swf?videoId=xyz&imageId=abc
    this works fine in FF but not in ie
    when I use trace(this._url); inside actionscript I am getting
    this response
    FF
    http://localhost:8080/vts/test.swf?videoId=xyz&imageId=abc
    IE
    http://localhost:8080/vts/test.swf?Id=123

  • Encoding the URL request

    Could you plz assist me how encode the URL request that is getting from the client.The query about discarding a session is as follows
    (1)What will happened when employing invalidate() method of a session.
    (2) What is the distinguishing of invalidate() and logout if both has performed that all of the user's session will have been expired if we invoke anyone

    Making some guesses here.
    The invalidate() method does what it says: it invalidates the session. Most HttpSessionMethods will throw an IllegalStateException if called on an invalid session.
    There is no method or event that causes a "logout". It's something you have to do programmatically using the invalidate() method. Or the session could timeout in which case also it becomes invalid ( which is basically done by the container as opposed to you calling invalidate() )
    About URL encoding: do you mean URL rewriting which appends a session id to the URL to be used in case cookies are disabled? Then you need encodeURL() and encodeRedirectURL(). Working with the session with rewriting of URLs is exactly the same for you ( in your code ) as it is normally.
    If you mean making a safe URL, you need URLEncoder: http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLEncoder.html
    I hope I got something right here.

  • When trying to play videos I get the message "requested URL is not supported on this network" how do I fix this?

    I receive the error "requested URL is not supported on this network" when trying to play videos on my iPhone. Can you please advise how to fix this problem?

    Hi,
    You will need to re-instal iCal as an optional install from your OSX installer DVDs. Then run the Mac OS X 10.5.8 Combo Update.
    Best wishes

  • HT1657 I rented movies on my iPad, they all downloaded, but when I click 'play' it says 'The requested URL was not found on this server'. What does it mean and how can I restore my rented movies?

    I rented movies on my iPad, they all downloaded, but when I click 'play' it says 'The requested URL was not found on this server'. What does it mean and how can I restore my rented movies?

    See this previous discussion:
    https://discussions.apple.com/message/16962474#16962474

  • 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 to encode URL in UTF-8 Using PL/SQL

    Hello,
    Platform:Oracle 9i, Sun Solaris,
    Using Oracle 0i XML/XDK Iam able to generate xml data and post it to url via HTTP POST. But the xml data need to be encoded in utf-8. Does anyone know how to encode the xml data within PL/sql ?
    Thanks for your time
    Seema

    Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
    Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
    ajt

  • How can a servlet determine the exact requesting URL

    This seems like a simple question, but I cannot find a solution. I am wondering how a servlet can determine the exact requesting URL that invoked the servlet. Specifically, I am having trouble making my servlet determine if the port number was specified or not. I am using session tracking, and my web server (by default) produces two separate sessions when hitting https://myserver.com/myservlet and https://myserver.com:443/myservlet.
    I have tried to use the HttpUtils.getRequestURL(), but this function seems to assume that if you used https over port 443, that you DID NOT specify 443 in the URL.
    SV

    If your servlet container implements servlet 2.2 or better, try the request.getRequestURL() method. It should return everything that was originally entered for the request address at the client except the query string (use request.getQueryString() to get that).
    I am not sure how it handles the port number for specifically entered vs not specifically entered.

  • On the zynga game, mafia wars, every time i click on something within the game a get a popup that says "Requested URL not found: 400" all pages load fine it just gives the message every time i click something, how can i stop this?

    on the zynga game, mafia wars, every time i click on something within the game a get a popup that says "Requested URL not found: 400" all pages load fine it just gives the message every time i click something, how can i stop this?

    Sorry, the above thread should have been a "new" post, not a reply post.

  • I keep getting The requested URL "/zumablitz/?ref=bookmarks&count=0", is invalid. Reference #9.1ed83bd0.1296679780.83aff6a ....everytime I try to go to any of the games I play..Have tried everything, how do I fix this?

    The requested URL "/zumablitz/?ref=bookmarks&count=0", is invalid.
    Reference #9.1ed83bd0.1296679780.83aff6a , happens all the time now , how do I fix this?

    As you can see below, when I right click, I have no such option.  In the User Account Settings, I'm operating as the "System Administrator".
    Any other suggestions?

  • When using firefox on yahoo and opening my mail it says Not Found The requested URL /dc/launch was not found on this server. How can this be fixed?

    when using firefox on yahoo and opening my mail it says Not Found The requested URL /dc/launch was not found on this server. How can this be fixed?

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

Maybe you are looking for

  • Facing problem while changing the database at runtime

    hi everyone, Before posting this thread, i have gone through the various posts addressing the problem....but still iam unable to get the solution for this problem. The report has been generated in one system, so the database properties (connection st

  • Can I get the apple warranty on a phone purchased from verizon?

    I need to purchase an Iphone 5 from Verizon because I have to transfer upgrade status. I do not want their insurance I want the Apple extended service. Can I purchase it after I get the phone from Verizon?

  • Home Sync never completes on a logout from OSX Server

    I have a Mac Pro running 10.6.4 and MacBook running same rev level. Seemed to have successfully configured Open Directory on the Mac Pro to manage mobile accounts. Mac Pro OD also is configured with AFP file sharing turned "on" and /Network share for

  • Creating PDF Error - Acrobat 10

    Hi I am having this issue when using Adobe Acrobat 10, running on Windows 7 64Bit, Acrobat X is up to date with updates.  This is a brand new install of this software and already it is crashing when creating PDF's.  8GIG RAM in the workstation in que

  • DBVERIFY - Data in bad block

    During RMAN validate structure I notice that I have plenty of files with data corruption. Then I run DBVERIFY and identify those files and database objects. I know what to do with broken tables and indexes, but 2 lines are strange for me: 1) object w