When i define either one of the parameters below in a html page which starts the applet:
<param name=testParam value=test\\test>
<param name=testParam value='test\\test'>
applet.getParameter("testParam") method returns value as "test\\test". In my logic it should return "test\test".(for value=test\test then method returns "test\test") How is this possible? is it something relating to the encoding or something that java handles when it gets output.
Java requires back-slashes to be escaped. HTML does not.
/* <applet
code='TestParam'
width='200'
height='30'>
<param name='path' value='test\test'>
</applet> */
import javax.swing.*;
public class TestParam extends JApplet {
public void init() {
JTextField output = new JTextField(getParameter("path"), 20);
add(output);
validate();
}
}

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With