Moined Mogul

Ranch Hand
+ Follow
since Jul 11, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Moined Mogul

I would like to be able to do what I have done below in my JSP to prevent someone from book marking the page and then being able to access it without logging in. This works fine as long as I use the absolute path of the URL. Unfortunetly I can not use the absolute path. I can only use the name of the JSP as in First.jsp instead of http://Project...
How can I do the same as I am below but without using the absolute path?
<%
if (request.getHeader("referer").compareToIgnoreCase("http://Project/First.jsp") == 0 | |
request.getHeader("referer").compareToIgnoreCase("http://Project/Second.jsp") == 0 | |
request.getHeader("referer").compareToIgnoreCase("http://Project/Third.jsp") == 0 | |
request.getHeader("referer").compareToIgnoreCase("http://Project/Fourth.jsp") == 0 | |
request.getHeader("referer").compareToIgnoreCase("http://Project.Fifth.jsp") == 0)
{
%>
{
<<THE JSP I WANT TO DISPLAY>>
}
<%
}
else
{
%>
<script language = javascript>
location.href="adminlogin.jsp";
</script>
<%
}
%>
22 years ago
Could someone please tell me how to display a single quote within a string?
22 years ago
Could someone please tell me how to display a single quote within a string?
22 years ago
Wouldn't that be quite costly though if you had several fields to validate....going to the server for validation every time???
22 years ago
I seem to have quite a bit of javascript within my JSP just doing simple authentication of user inputted data which will throw an alert to the user if something they entered does not meet the criteria I have defined.
I want to try and limit the business logic as much as possible within my JSP by getting rid of this javascript.
Could someone please suggest some alternative methods and give some examples of throwing something similar to a javascript alert if the user enters something that does not meet the criteria of the text box???
Thank you!
22 years ago
How can I take a string that is selected from a drop down menu and check to see if it has double quotes around it, if it does, then remove the quotes and submit the new string without quotes instead of the one selected?
Please help....urgent!!!
How can I take a string that is selected from a drop down menu and check to see if it has double quotes around it, if it does, then remove the quotes and submit the new string without quotes instead of the one selected?
Please help....urgent!!!
22 years ago
I really do not understand why it works fine for displaying the values with quotes in my drop down menu but when I try to retrieve that selected value from the drop down with quotes around it, I get nothing???
By using the prepared statement, will that automatically get rid of any special characters within the string???
Could someone please clarify this???
22 years ago
I have tried escaping them within the bean method but that did not work...
I will look into using a prepared statement for it...could someone give me an example of using a prepared statement for query.....
22 years ago
I have a JSP where the user enters a string that is then placed within a column of a table of a database using a JDBC connection. I have found that the user can enter a string with quotes around it and it enters the table fine. I can then query that column fine and place all the values of the column into an array that I use in a drop down menu displaying all of them in another JSP. My propblem now is that if I try and take that value that is selected in the drop down menu that has quotes around it (values without quotes work fine) and use that value to place in another JDBC update statement, I get an emptry string.
For example, if I have something like this that appears in my drop down menu, it will not work:
"This is a test"
If I have the same string without quotes there is no problem:
This is a test
I believe it has something to do with the string being read like this when it has quotes around it:
""This is a test""
I am not quite sure how to deal with this problem since the correct value appears in the database table and can be seen in the drop down even with quotes around it. Whenever I try to use that selected string that has quotes around it though by accessing it in my bean method, I get a totally empty string.
If anyone could please make some suggestions on how to solve this I would greatly appreciate it. This is quote urgent, so the sooner you could answer the better.
Thank you VERY much in advance.
22 years ago
PLEASE HELP!!!
URGENT!!!
THANK YOU!!!
22 years ago
If the user enters quotes around a string they are entering, how is it that I can strip the quotes off and then reassign the string to the text box. Please show some sample code if you can?
Thank you.
How can I strip these off within the JSP and then reassign it to the name of the text box???

Originally posted by Vlad Patryshev:
Why not just strip the enclosing quotes and leave the user do what she/he likes?


22 years ago
Does anyone know how I could ensure that quotes were never permitted to be added into my database table where the input is coming from user input in a JSP???