How to read HashMark in parameters from URL
<p>I have written a Java Servlet which queries the database and returns the result to JSP.
I am executing the SQL Statement based on the parameters passed from the URL</p>

<pre><code>//Reading Parameter
String User = request.getParameter("userid");

//Executing the SQL
String sqluser = "SELECT 1  FROM &lt;table name&gt; WHERE username = ?

pstmt = con.prepareStatement(sqluser);
pstmt.setString(1, User);
rset = pstmt.executeQuery();
</code></pre>

<p>The sample URL:
http:\testenv.com\test?userid=tana</p>

<p>The above URL displays correct result since user='tana'. </p>

<p>But there are some users that have "#" in their user name.</p>

<p>For e.g:
http:\testenv.com\test?userid=la#na</p>

<p>The SQL Statement does not return any value because User= 'la' in above case even though the URL has "la#na". Can i get the value "la#na" using getParameter? If so what do i need to do?</p>

<p>Thanks.</p>
