Servlet - param passed in url ,lose carons

Hi,
I have the following servlet code
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
// res.setContentType("text/html;charset=ISO-8859-2");
PrintWriter out = res.getWriter();
String param = req.getParameter("my_param");
//param = new String(param.getBytes(), "8859_2"); // I tried this and other encodings like UTF-8 , Cp1252 etc but didnt work
out.println(param + "<br>");
I am passing a 8859_2 string to servlet . Though I cannot see any junk characters displayed, what I see is that some characters lose caron above them .
http://host:port:/myservlet?my_param=<param>
For eg if I have 'c' ( with a caron above ), it gets converted to just 'c'. Can anybody tell me why is this? .
Thanks
Ratheesh

The sending HTML page / URL should have a meta tag with content-type to text/html;charset=... and better yet, the parameter should be URL encoded: %CF or so.
In this way it is clear what is coming in.

Similar Messages

  • Servlet - czech param passed in url ,lose carons

    Hi,
    The problem I am facing that some czech characters passed in url lose the carons above them when displayed.
    I have the following servlet code
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    // res.setContentType("text/html;charset=ISO-8859-2");
    PrintWriter out = res.getWriter();
    String param = req.getParameter("my_param");
    //param = new String(param.getBytes(), "8859_2"); // I tried this and other encodings like UTF-8 , Cp1252 etc but didnt work
    out.println(param + "<br>");
    I am passing a 8859_2 string to servlet . Though I cannot see any junk characters displayed, what I see is that some characters lose caron above them .
    http://host:port:/myservlet?my_param=<param>
    For eg if I have 'c' ( with a caron above ), it gets converted to just 'c'. Can anybody tell me why is this? .
    Thanks
    Ratheesh

    http://host:port:/myservlet?my_param=<param>
    Is this the original request? If yes, make sure that the parameters are 'encoded' correctly. For example if you generate this url/request with jsp/servlet code, than use the
      java.net.URLEncoder.encode(my_param,character_coding);to do this.
    Carstig.

  • Any way to access params passed in URL  implementing JSR 168 on Oracle Appl

    I'm trying to access the params passed through URL like : http://hostname:7777/portal/page/portal/Wes%20store%20Sample/OnlyOnePortal
    webStoreId=100&Id=10000
    I have create a portlet with jsp implementing JSR 168 on Oracle Application Server 10g
    But unable to access them in either actionProcess() as well as render() using actionRequest and renderRequest as well.
    I wonder will this possible with JSR 168 to access params passed in URL in any way
    Can any body help me do this

    access params passed in URL  implementing JSR 168 on Oracle Application Ser

  • Can't receive variables from HTML to Flash in AS3 passed via URL (not Flashvars)

    hey all,
    can't seem to get AS3 to recognize variables passed via URL
    (not Flashvars). i can get vars passed with Flashvars in the
    javascript but I don't want to use that method. i'm simply
    extending the .swf call with .swf?var=123 in the embed and on the
    AS3 side i'm calling loaderInfo.parameters.var
    thought this would work but doesn't. what am i doing wrong?
    HTML:
    <object
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
    width="1024" height="768" id="main" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="main.swf?var=123"
    /><param name="quality" value="best" /><param
    name="bgcolor" value="#ffffff" /> <embed
    src="main.swf?var=123" quality="best" bgcolor="#ffffff"
    width="1024" height="768" name="main" align="middle"
    allowScriptAccess="sameDomain" allowFullScreen="false"
    type="application/x-shockwave-flash" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    />
    </object>
    AS:
    t = new TextField();
    t.text = String(loaderInfo.parameters.var);
    thx in adv.
    michael

    appreciate you were going for brevity, but i think the
    answer's going to be hidden either in your complete html code or
    your complete AS code. without seeing this i can only keep
    guessing.
    that said, my latest guess is that you're not passing your
    variable within the AC_FL_RunContent function. there are two
    properties set in this function - src and movie, which contain your
    movie name, to which you can add any parameters you wish to pass.
    eg.
    'src', 'main?var=123',
    'movie', 'main?var=123',
    where main is the name of your swf and var the name of the
    parameter you wish to pass.
    if this function fails - if javascript isn't available in the
    browser, for example, or AC_RunActiveContent.js is missing, then
    the <object> tag you described is used. (this object tag is
    sitting inside a <noscript> tag.)

  • ADF Faces + ADF BC : how to pass an url parameter to a backend business ser

    Hi,
    I'm using latest JDev studio version SU 3.
    My project is using ADF Faces with BC4J in the service layer.
    I have a backend application module which exposes a method taking a String parameter as an input (ex: void setUsername(String username))
    I need to have a jspx page which reads a parameter passed in the url (http://localhost/faces/registerUser.jspx?username=john) and send it to the backend service method when a submit is raised on a clicked button.
    It's pretty simple when using inputtext for example but not obvious if I want to use urm param instead of inputtext.
    How do I do this ?
    Thanks

    Hi,
    Thanks a lot for your answers.
    The link http://www.it-eye.nl/weblog/2006/06/12/passing-a-url-parameter-to-model-using-adf/ is no more reachable.
    The following EL expression work for displaying the parameter inside an outputText component :
    #{facesContext.externalContext.requestParameterMap[’yourParameter&#8242;]}
    The parameter is not sent to the business service when the button is clicked.
    Thanks,
    Seb.

  • Servlet redirection but maintain url in browser (make sense?!?)

    Hi,
    Would like to have a url like www.foo.com/careers
    which will call a Servlet, passing in a parameter of "careers" so I know what content to display.
    But instead of the url changing to www.foo.com/Servlet?page=careers in the browser (due to obj.con redirect), is there a way I can do this without the url changing from www.foo.com/careers, but still calls the relevant servlet and passes in the correct parameter?
    Thanks

    We were covering a very similar topic in this thread:
    http://forum.java.sun.com/thread.jspa?threadID=5194280&tstart=10
    Ultimately you would use the If structure with regular expressions to restart the request internally (the user-agent does not see this) with the full URI. Something like:
    <If $uri =~ "/(.*)"
    and $uri !~ "^/Servlet.*" >
    NameTrans fn="restart" uri="/Servlet?page=$1"
    </If>
    This block appropriately placed in your obj.conf will internally restart the request with the original URI now used as the query string of the new request.
    You could also use this instead:
    <If not $internal
    and $uri =~ "/(.*)" >
    This will only perform the restart if the request being processed is determined to NOT be internally generated (e.g. an already restarted request).
    Of course you should make sure that you application generates URLs that are appropriate to this URI space, not the canonical URI space. This configuration will also be pretty greedy with your URI space, preferring to rewrite everything:
    /foobar/sub/dir/image.jpg
    becomes
    /Servlet?foobar/sub/dir/image.jpg
    So you'll want to refine what options you're willing to match, and restrict the expression used here to be less inclusive.
    For more information on this very nifty feature, see the docs at:
    http://docs.sun.com/app/docs/doc/820-1062/6ncoqnpfh?a=view

  • Reading a properties file in a servlet and passing its contents to a JSP pa

    Hi all,
    I'm totally new to Servlet pgmg n JSP. Please can ne1 tell how to read a simple properties file (in a servlet) and pass its contents to a JSP page.Actually the reason is to fill a combo box in a JSP page with the contents of a properties file.If calling a servlet for the same is d best way to do that, plz can ne1 tell me :
    1> whether to override the doPost method in the servlet in which to read d file using FileInputStream
    2> Putting the contents in an array and then how to pass this array to the JSP page.
    Thanks,
    deepthy.

    I'm using a properties file to let my web application know what the name of the database is. I'm using an abstract class GeneralDao which will be extended by all the DAO's (Data Access Objects or java classes containing SQL statements).
    Here's the code :
    protected Connection getDatabaseConnection()
              throws Melding
         Connection dbconn = null;     
         ResourceBundle resBundle;
         try
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         resBundle = ResourceBundle.getBundle("gcoConfig");
         String dbConnectie = resBundle.getString("databaseconnection");
         gcoLogger.debug("lezen databaseconnection in resourceBundle " );
         dbconn = DriverManager.getConnection(dbConnectie);
         } catch (InstantiationException exc)The ResourceBundle is used to read the properties file, named gcoConfig.properties.
    With the getString() command I read the content of the string named databaseconnection.
    The gcoConfig.properties file is placed inside the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes
    The GeneralDao is placed in the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes\org\gertcuppens\cluifDao.
    So this class is placed some folder below the WEB-INF\classes folder of gcoConfig.properties.
    And the content of the properties file is just one line :
    databaseconnection=jdbc:mysql://localhost/cluif
    If you want to let the JSP know what's inside the properties file, wrap the content in a Javabean, put it in the request or even the session and pass the control to the JSP.

  • How to specify  a servlet mapping as the url pattern with in the security constraints

    Hi ,
    Weblogic 6.0 documentation says the following:-
    Define which resources in the Web Application the security constraint applies to using the <url-pattern> element that is nested inside the <web-resource-collection> element. The <url-pattern> can refer to either a directory, filename or a <servlet-mapping>.
    To apply the security constraint to the entire Web Application, use the following <url-pattern>:
    <url-pattern>/*</url-pattern>
    Could any one let me know how to specify servlet mapping as the url pattern.
    I tried various combination and it doesn't seem to work and any help in this regard will be greatly appreciated.
    Thanks
    kannan

    The answer is posted here:
    Unapproved User Flag in UME

  • Use of variable passed with url

    hi ,
    i am new user for this forum.
    i have one problem. i call the html page resides in
    coldfution directory from the another web server. now my problem is
    that how can i get the variable which are passed with URL ? for
    example i call page x.x.x:8500//temp/test.html?id=2 from other
    windows web server ie x.x.x.//temp1/test1.php.
    now my problem is that is there any facility in coldfusion to
    get the value of the variable which are passed with URL . in this
    case it is ID

    Hi
    do you mean accessing the URL varialbes in CF?
    if it is you can say #URL.varname#.

  • Pass current url as report prarameter while using report viewer web part

    hello everybody
    is there a way to
    pass current url as report prarameter while using report viewer web part
    thanks in advance
    Sergey Vdovin

    Hi Evolex,
    Per my understanding that you want to get the current url and create an parameter to add this URL as its value, right?
    gernerally, we can use some code to get the current url but it almost impossible for us to get it automatically as value of the report parameter.
    In your senario, i suggest you to copy the url and specify values when creating parameters.
    Thanks for your understanding.
    Regards
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • HttpURLConnection -- getting error 502 passing ftp url  w embedded password

    I am connecting to http proxy server which supports cern ftp.
    I specify the -DftpProxySet command line options to point java to the http proxy.
    I specify a ftp url like following and it works OK:
    ftp://machine.company.com/readme.txt
    it works fine.
    But when I change the ftp server to require password and pass ftp url such as
    ftp://user:[email protected]/readme.txt. , it fails.
    It works OK when I type above password ftp Url manually into the IE browser that is pointing to same http proxy the java is using.
    Error:
    java.io.IOException: Server returned HTTP response code: 502 for URL: ftp://user:[email protected]/readme.txt
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:562) at com.mycompany....Line 300
    Line 300:
    InputStream stream = connection.getInputStream();

    Hi, I have exactly the same problem!
    Could you solve it?
    Regards, Markus

  • Why can't Mail pass a URL to my Camino browser?

    Is Mail inability to to pass an embedded URL to my 'Net browser related to Java permissions which never stay "repaired"?
    I performed the typical remedy of using Safari Preferences to set the default browser. No improvement.
    When a link is clicked in a Mail e-mail, the browser window becomes front-most, but no new window or tab opens.
    This problem seems to coincide with Software Update installing Update 3 to Java 1.6. Since that installation, every run of Disk Utility to Repair Permissions yields the same log of Java-related files requiring repair.
    Any suggestions are welcome.

    More 'cutting and trying,' to borrow a shop worn fitter phrase.
    Asking at Apple Support for a search of "rebuild Launch Services" yielded 150 documents to inspect, such as OS X 10.6 Server advice. Not much help.
    And I am resuming where I started because the Safe Mode repair didn't last. The Java 1.6 permissions faults endure, though, so I again repaired permissions first, then used Onyx.app to rebuild Launch Services. That reinstated the ability of Mail.app to pass a URL link to my default Web browser, which is not Safari. In a matter of seconds, actually, to my smiling surprise.
    Thus, OS function is as designed among applications, and I will wait a few more days to see whether the repair is more than transient.
    ===== Discussion =====
    What might you learn from this incomplete experience?
    1) Don't decide you must completely re-install all your applications or the complete Operating System because your particular system has developed a quirk.
    2) Be ready to look outside Apple Support search, which consistently offers me tons of information, which I am expected to cull for the exact phrase I submitted.
    3) In my situation, with a couple of third-party maintenance applications already on hand, I simply launched Onyx and explored its many features for repair, for upkeep, including the always-recommended repairing of permissions. I never needed to rebuild Launch Services before, but chose that task because of the comprehensive description of its effect and intended outcome presente by the Help window in Onyx.
    You might say that I highly recommend Onyx, though I use few of its numerous capabilities.

  • Passing a URL paramater

    hi
    I am having Wdb dynpro application and I want to pass some URL parameters while calling that application for example
    I want to enable or disable some options for a particular portal, then what is the way to do it.
    For example if I want to pass "Pricing= Yes" that ,means that the Pricing column would be displayed if "Pricing =No" then that column would not be displayed.
    Kindly let me know what all I have to do in order to implement this kind of functionality.
    Thanks and regards
    kris

    Hi,
    See this link
    Can we pass parameters in querystring of the webdynpro application?
    Hope this helps you\
    Regards
    Rohit

  • Passing custom URL parameter to a FPM app

    Hello,
    I am facing a problem when trying to pass an URL parameter to a GAF FPM application.
    The standard way by adding a parameter to the WD application and adding a parameter to the default plug in the window doesn't work for FPM... at least in my case.
    Does anyone know how URL parameters work with the FPM framework?
    Thank you and BR,
    Chris

    You just need to declare parameters which you will be using in WD Application - Parameters tab.
    To fetch parameters for application which is using FPM, you have to use following piece of code -
        wd_this->app_param = wd_this->mr_fpm->mo_app_parameter.
        CALL METHOD wd_this->app_param->get_value
          EXPORTING
            iv_key   = 'INTERFACE_MODEL'
          IMPORTING
            ev_value = wd_this->lv_interface_model.
        CALL METHOD wd_this->app_param->get_value
          EXPORTING
            iv_key   = 'MODE'
          IMPORTING
            ev_value = wd_this->lv_mode.
    Here wd_this->mr_fpm holds FPM reference and is of type ref to IF_FPM
    and wd_this->app_param holds FPM parameters reference and is of type IF_FPM_PARAMETER.
    After getting reference I'm calling methods to get individual application parameters by sending their names.
    We called this in DOINIT of component controller.
    Regards
    Manas Dua

  • How to get the query values from the url in a servlet and pass them to jsp

    ok..this is the situation...
    all applications are routed through a login page...
    so if we have a url like www.abc.com/appA/login?param1=A&param2=B , the query string must be passed onto a servlet(which is invoked before the login page is displayed)..the servlet must process the query string and then should pass all those values(as hidden values) to the login jsp..then user enters username and pswd, then there should be another servlet which takes all the hidden values of jsp and also username and pswd, authenticates the user and sends the control back to that particular application along with the hidden values...
    so i need help on how to parse the query string from the original url in the servlet, pass it out to jsp, and then pass it back to the servlet and back to the original application...damnn...any help would be greatly appreciated...thanks

    ok..this is the situation...Sounds like you have a bad design on your hands.
    You're going to send passwords in a GET request as clear text? Nice security there.
    Why not start with basic security and work your way up?
    %

Maybe you are looking for

  • [E71-1] Nokia messaging not sync even after firmwa...

    Hi all, For the past 3 months, my Nokia messaging is not SYNC automatically again from my Nokia E71-1. Yesterday I tried to firmware upgrade my E71-1 (to latest firmware ver 410.21.010); and install Nokia Messaging from OVI store. And then after 1st

  • XML load limited to 20 child nodes? Why?

    I use the attached code to load the attached xml file, but it will only load the first 20 nodes. I have moved the 20th to the 21st and the 21st up to the 20th and it will still load the first 20, so it isn't a formatting problem.

  • How to get past a phony FBI block(lock) on Safari?

    clicked on a video clip and got an "FBI" block asking for $600.00 to unlocked

  • EPS Graphic with transparent bkgd placed over shape: IDCS3

    In Photoshop CS3 I created a graphic of a basketball player and masked him out. I then deleted the mask, leaving me with just the player. I now have a document that is 8x10", 300 dpi, with a transparent background. I flattened it and saved it as a Ph

  • RDBMS Version 8.0.5.0.0  Start시 mount 상태로 있어요.

    alert 로그 파일을 보면 아래와 같이 마지막 부분에 alter database mount 상태로 있습니다.. db를 mount 후 open 하고 싶습니다. 방법이 없나요... Wed Aug 12 17:47:01 2009 Shutting down instance (abort) License high water mark = 3 Instance terminated by USER, pid = 9937 Wed Aug 12 17:50:12 2009 S